diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-01-16 15:53:45 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-01-16 15:53:45 +0100 |
commit | 883179a4d109b59b43041f979e362f8800a9052f (patch) | |
tree | a3ab79ed301c3d8fcef7f3f5dd9759ac651579e6 | |
parent | a93e6f851f16103e0293124cf566c99a5493b2e7 (diff) | |
download | rpg-883179a4d109b59b43041f979e362f8800a9052f.tar.gz rpg-883179a4d109b59b43041f979e362f8800a9052f.tar.bz2 |
keep breadcrumbs for anonymous users FS#1519
darcs-hash:20090116145345-7ad00-153c9e6e0a83d937c48967ed5bc90578a5f49a15.gz
-rw-r--r-- | inc/auth.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/inc/auth.php b/inc/auth.php index 25c0f87f9..26246ba1b 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -172,7 +172,7 @@ function auth_login($user,$pass,$sticky=false,$silent=false){ } } //just to be sure - auth_logoff(); + auth_logoff(true); return false; } @@ -262,12 +262,15 @@ function auth_cookiesalt(){ } /** - * This clears all authenticationdata and thus log the user - * off + * Log out the current user + * + * This clears all authentication data and thus log the user + * off. It also clears session data. * * @author Andreas Gohr <andi@splitbrain.org> + * @param bool $keepbc - when true, the breadcrumb data is not cleared */ -function auth_logoff(){ +function auth_logoff($keepbc=false){ global $conf; global $USERINFO; global $INFO, $ID; @@ -282,7 +285,7 @@ function auth_logoff(){ unset($_SESSION[DOKU_COOKIE]['auth']['pass']); if(isset($_SESSION[DOKU_COOKIE]['auth']['info'])) unset($_SESSION[DOKU_COOKIE]['auth']['info']); - if(isset($_SESSION[DOKU_COOKIE]['bc'])) + if(!$keepbc && isset($_SESSION[DOKU_COOKIE]['bc'])) unset($_SESSION[DOKU_COOKIE]['bc']); if(isset($_SERVER['REMOTE_USER'])) unset($_SERVER['REMOTE_USER']); |