]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/login/class_ShipSimuGuestLogin.php
Links in all templates reworked, Primera API (see www.primusportal.de for details...
[shipsimu.git] / application / ship-simu / main / login / class_ShipSimuGuestLogin.php
index 4fe5915bac3c5247ef1a10297b6d4b7093d51ef5..ba7ac31f961fbd4d5e80f5cdb9d161dfcb36bc49 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
  *
@@ -36,12 +36,6 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser {
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set part description
-               $this->setObjectDescription("Guest login for Ship-Simu");
-
-               // Create unique ID number
-               $this->generateUniqueId();
-
                // Clean up a little
                $this->removeNumberFormaters();
                $this->removeSystemArray();
@@ -81,15 +75,11 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser {
                $data = "";
 
                // Detect login method (username or email) and try to get a userinstance
-               if (!is_null($requestInstance->getRequestElement('username'))) {
+               if (!is_null($requestInstance->getRequestElement('user'))) {
                        // Username found!
-                       $method = "createGuestByUsername";
-                       $data = $requestInstance->getRequestElement('username');
-               } elseif (!is_null($requestInstance->getRequestElement('email'))) {
-                       // Email found!
-                       $method = "createGuestByEmail";
-                       $data = $requestInstance->getRequestElement('email');
-               }
+                       $method = 'createGuestByUsername';
+                       $data = $requestInstance->getRequestElement('user');
+               } // END - if
 
                // Is a method detected?
                if (is_null($method)) {
@@ -115,7 +105,7 @@ class ShipSimuGuestLogin 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
 
                // Now do the real login. This can be cookie- or session-based login