diff options
author | Michael Hamann <michael@content-space.de> | 2013-02-20 19:43:29 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2013-02-20 20:45:49 +0100 |
commit | 6416b708d3d115a6d7529b6c388c796fcb651d55 (patch) | |
tree | 099b8d2786ffb2696e3e901f1d48375f9ce15a44 /inc/auth.php | |
parent | a4ce95c84dca904abb57d30efa2a9d5d68eeda1b (diff) | |
download | rpg-6416b708d3d115a6d7529b6c388c796fcb651d55.tar.gz rpg-6416b708d3d115a6d7529b6c388c796fcb651d55.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).
Diffstat (limited to 'inc/auth.php')
-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 |