]> git.mxchange.org Git - shipsimu.git/commitdiff
Guests now remain guests in login area (bug fixed)
authorRoland Häder <roland@mxchange.org>
Thu, 19 Jun 2008 18:15:36 +0000 (18:15 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 19 Jun 2008 18:15:36 +0000 (18:15 +0000)
inc/classes/main/filter/auth/class_UserAuthFilter.php

index dac1ebc09205806a17c3b6baa386df245a2992d9..a75e7be66acd3687c045f9fe5c081199c50347e8 100644 (file)
@@ -106,8 +106,14 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
                } // END - if
 
-               // Now, try to get a user instance
-               $userInstance = User::createUserByUserName($authLogin);
+               // Now, try to get a user or guest instance
+               if ($authLogin == $this->getConfigInstance()->readConfig('guest_login_username')) {
+                       // Guest login!
+                       $userInstance = Guest::createGuestByUserName($authLogin);
+               } else {
+                       // Regular user account
+                       $userInstance = User::createUserByUserName($authLogin);
+               }
 
                // Is the password correct?
                if ($userInstance->getPasswordHash() !== $authHash) {