]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/login/class_ShipSimuUserLogin.php
Now we really have ship-simu specific user/member classes
[shipsimu.git] / application / ship-simu / main / login / class_ShipSimuUserLogin.php
index 72471e586efcae38328d832f8ad74966cb0f02f9..eced73d98f53ec54eb18aed803084eb5ec4fff30 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, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -84,8 +84,11 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
 
                // Is there an instance?
                if (is_null($userInstance)) {
+                       // Get member class
+                       $userClass = $this->getConfigInstance()->readConfig('user_class');
+
                        // Get a user instance
-                       $userInstance = User::createUserByRequest($requestInstance);
+                       $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
 
                        // Remember this new instance in registry
                        Registry::getRegistry()->addInstance($userInstance);
@@ -94,7 +97,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                // Is the password correct?
                if (!$userInstance->ifPasswordHashMatches($requestInstance)) {
                        // Mismatching password
-                       throw new UserPasswordMismatchException(array($this, $userInstance), User::EXCEPTION_USER_PASS_MISMATCH);
+                       throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
 
                // ToDo place
@@ -141,7 +144,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                        $userInstance = Registry::getRegistry()->getInstance('user');
 
                        // Get a crypto helper and hash the password
-                       $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashPassword($plainPassword, $userInstance->getPasswordHash());
+                       $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash());
 
                        // Store the hash back in the request
                        $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);