From: Roland Häder Date: Thu, 19 Jun 2008 18:15:36 +0000 (+0000) Subject: Guests now remain guests in login area (bug fixed) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d483cb900b449fc3260ad959c71f154268e9eac3;p=shipsimu.git Guests now remain guests in login area (bug fixed) --- diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php index dac1ebc..a75e7be 100644 --- a/inc/classes/main/filter/auth/class_UserAuthFilter.php +++ b/inc/classes/main/filter/auth/class_UserAuthFilter.php @@ -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) {