]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/login/class_ShipSimuUserLogin.php
readConfig() is not naming convention, renamed to getConfigEntry()
[shipsimu.git] / application / ship-simu / main / login / class_ShipSimuUserLogin.php
index 178c4088a7b81c744c685834d2775599c9fb835c..3b1acf7dd5a19d1a555f1b89edbabb54853496e5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -73,24 +73,19 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                $method = null;
                $data = "";
 
-               // Get a instance of the registry
-               $userInstance = Registry::getRegistry()->getInstance('user');
+               // Get member class
+               $userClass = $this->getConfigInstance()->getConfigEntry('user_class');
 
-               // Is there an instance?
-               if (is_null($userInstance)) {
-                       // Get member class
-                       $userClass = $this->getConfigInstance()->readConfig('user_class');
+               // Get a user instance
+               $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
 
-                       // Get a user instance
-                       $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
-
-                       // Remember this new instance in registry
-                       Registry::getRegistry()->addInstance($userInstance);
-               } // END - if
+               // Remember this new instance in registry
+               Registry::getRegistry()->addInstance('user', $userInstance);
 
                // Is the password correct?
                if ($userInstance->ifPasswordHashMatches($requestInstance) === false) {
                        // Mismatching password
+                       $userInstance->debugInstance();
                        throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if