From 883179a4d109b59b43041f979e362f8800a9052f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 16 Jan 2009 15:53:45 +0100 Subject: keep breadcrumbs for anonymous users FS#1519 darcs-hash:20090116145345-7ad00-153c9e6e0a83d937c48967ed5bc90578a5f49a15.gz --- inc/auth.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'inc/auth.php') 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 + * @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']); -- cgit v1.2.3