From 14b62806d20eec7d0a064d9013dd40ba60590285 Mon Sep 17 00:00:00 2001 From: github138 Date: Mon, 9 Mar 2015 20:52:03 +0100 Subject: [PATCH 1/2] fix login twice after logout --- wwwroot/inc/auth.php | 3 +++ wwwroot/inc/interface.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wwwroot/inc/auth.php b/wwwroot/inc/auth.php index ff31aa955..498b970a1 100644 --- a/wwwroot/inc/auth.php +++ b/wwwroot/inc/auth.php @@ -35,6 +35,9 @@ function authenticate () if (isset ($_SESSION['logout'])) { unset($_SESSION['logout']); + unset($_SERVER['PHP_AUTH_USER']); + unset($_SERVER['PHP_AUTH_PW']); + if (isset ($user_auth_src) and 'saml' == $user_auth_src) saml_logout (); throw new RackTablesError ('', RackTablesError::NOT_AUTHENTICATED); // Reset browser credentials cache. diff --git a/wwwroot/inc/interface.php b/wwwroot/inc/interface.php index f4b230abb..0f72abffe 100644 --- a/wwwroot/inc/interface.php +++ b/wwwroot/inc/interface.php @@ -90,7 +90,7 @@ function showLogoutURL () // add a trailing slash if the installation resides in a subdirectory if ($dirname != '/') $dirname .= '/'; - printf ('http%s://logout@%s%s?logout', $https, $_SERVER['SERVER_NAME'], $dirname); + printf ('http%s://%s%s?logout', $https, $_SERVER['SERVER_NAME'], $dirname); } $quick_links = NULL; // you can override this in your local.php, but first initialize it with getConfiguredQuickLinks() From 647fd112caf82a99e146881c14576ac8d41f0fc7 Mon Sep 17 00:00:00 2001 From: github138 Date: Fri, 29 May 2015 13:09:20 +0200 Subject: [PATCH 2/2] fix logout url --- wwwroot/inc/interface.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wwwroot/inc/interface.php b/wwwroot/inc/interface.php index 0f72abffe..29c5b246b 100644 --- a/wwwroot/inc/interface.php +++ b/wwwroot/inc/interface.php @@ -85,12 +85,8 @@ function showLogoutURL () { $https = (isset ($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? 's' : ''; $port = (! in_array ($_SERVER['SERVER_PORT'], array (80, 443))) ? ':' . $_SERVER['SERVER_PORT'] : ''; - $pathinfo = pathinfo ($_SERVER['REQUEST_URI']); - $dirname = $pathinfo['dirname']; - // add a trailing slash if the installation resides in a subdirectory - if ($dirname != '/') - $dirname .= '/'; - printf ('http%s://%s%s?logout', $https, $_SERVER['SERVER_NAME'], $dirname); + $uri = explode('?',$_SERVER['REQUEST_URI']); + printf ('http%s://%s%s?logout', $https, $_SERVER['SERVER_NAME'], $uri[0]); } $quick_links = NULL; // you can override this in your local.php, but first initialize it with getConfiguredQuickLinks()