]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/login/class_ShipSimuGuestLogin.php
readConfig() is not naming convention, renamed to getConfigEntry()
[shipsimu.git] / application / ship-simu / main / login / class_ShipSimuGuestLogin.php
index d4b0365c4d58e40b7dcb986c81bb76cde983d2a4..a026284d88abba64112ac18553915079f57d2dad 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
  *
@@ -85,22 +85,16 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser {
                if (is_null($method)) {
                        // Then abort here
                        throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD);
-               } elseif (!method_exists($this->getConfigInstance()->readConfig('guest_class'), $method)) {
+               } elseif (!method_exists($this->getConfigInstance()->getConfigEntry('guest_class'), $method)) {
                        // The method is invalid!
                        throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD);
                }
 
-               // Get a instance of the registry
-               $userInstance = Registry::getRegistry()->getInstance('user');
+               // Get a user instance
+               $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), $method), array($data));
 
-               // Is there an instance?
-               if (is_null($userInstance)) {
-                       // Get a user instance
-                       $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('guest_class'), $method), array($data));
-
-                       // 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) {