diff options
author | Michael Hamann <michael@content-space.de> | 2013-02-20 19:43:29 +0100 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-02-24 12:39:02 +0000 |
commit | b6235013d0c936d6852299af46d0f6a7eb907665 (patch) | |
tree | 0c695bc1feb14447af727270190b0a01457d7899 | |
parent | 853d4ca11402324fa6a12c21ab65fd813d5dec87 (diff) | |
download | rpg-b6235013d0c936d6852299af46d0f6a7eb907665.tar.gz rpg-b6235013d0c936d6852299af46d0f6a7eb907665.tar.bz2 |
Fix handling of failed authentication loading
In the case of a failed authentication initialization, the
authentication setup was simply continued with an unset $auth object.
This restores the previous behavior (before merging #141) of simply
returning after unsetting $auth. Furthermore this re-introduces the
check if $auth is set before checking $auth and removes a useless
check if $auth is true (could never be false).
-rw-r--r-- | inc/auth.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/auth.php b/inc/auth.php index d82b8b5dd..92a56e163 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -54,16 +54,17 @@ function auth_setup() { } } - if(!$auth){ + if(!isset($auth) || !$auth){ msg($lang['authtempfail'], -1); return false; } - if ($auth && $auth->success == false) { + if ($auth->success == false) { // degrade to unauthenticated user unset($auth); auth_logoff(); msg($lang['authtempfail'], -1); + return false; } // do the login either by cookie or provided credentials XXX |