From 554b4a00e44dc8dd9325a121dd8ae635e4ceca0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 24 Aug 2006 12:39:16 +0000 Subject: [PATCH] Add support for LogoutURL. --- ChangeLog | 2 ++ libraries/auth/cookie.auth.lib.php | 6 ++++++ libraries/auth/http.auth.lib.php | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 115d930b73..4a47258186 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ $Source$ libraries/auth/signon.auth.lib.php, scripts/signon.php, scripts/setup.php: Add single signon authentication method (patch #1545366, patch #1541379, patch #1531302 and RFE #1031391). + * libraries/auth/cookie.auth.lib.php, libraries/auth/http.auth.lib.php: + Add support for LogoutURL. 2006-08-22 Marc Delisle * scripts/setup.php: bug #1536112, better fix (in case of diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 9a8b840b61..c4fcd5ad7e 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -47,6 +47,12 @@ function PMA_auth() { global $cfg, $lang, $server, $convcharset, $conn_error; + /* Perform logout to custom URL */ + if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) { + PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']); + exit; + } + // Tries to get the username from cookie whatever are the values of the // 'register_globals' and the 'variables_order' directives if last login // should be recalled, else skip the IE autocomplete feature. diff --git a/libraries/auth/http.auth.lib.php b/libraries/auth/http.auth.lib.php index 2f201f4136..594e09f34f 100644 --- a/libraries/auth/http.auth.lib.php +++ b/libraries/auth/http.auth.lib.php @@ -21,6 +21,12 @@ */ function PMA_auth() { + /* Perform logout to custom URL */ + if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) { + PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']); + exit; + } + header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))) . '"'); header('HTTP/1.0 401 Unauthorized'); header('status: 401 Unauthorized'); -- 2.11.4.GIT