bug #3039384 [auth] Force signon auth on signon URL change.

This commit is contained in:
Michal Čihař
2011-03-18 16:12:16 +01:00
parent efd8db8298
commit 8fb267930e
2 changed files with 12 additions and 0 deletions

View File

@@ -149,6 +149,7 @@
- bug #3206876 [core] Work without mbstring installed. - bug #3206876 [core] Work without mbstring installed.
- rfe #3196075, patch #3212068 [interface] Add links to variables documentation. - rfe #3196075, patch #3212068 [interface] Add links to variables documentation.
- bug #3208723 [import] Fix import of utf-8 XML files. - bug #3208723 [import] Fix import of utf-8 XML files.
- bug #3039384 [auth] Force signon auth on signon URL change.
3.3.10.0 (not yet released) 3.3.10.0 (not yet released)
- patch #3147400 [structure] Aria table size printed as unknown, - patch #3147400 [structure] Aria table size printed as unknown,

View File

@@ -19,6 +19,7 @@
* @access public * @access public
*/ */
function PMA_auth() { function PMA_auth() {
unset($_SESSION['LAST_SIGNON_URL']);
if (empty($GLOBALS['cfg']['Server']['SignonURL'])) { if (empty($GLOBALS['cfg']['Server']['SignonURL'])) {
PMA_fatalError('You must set SignonURL!'); PMA_fatalError('You must set SignonURL!');
} elseif (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) { } elseif (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) {
@@ -54,9 +55,17 @@ function PMA_auth_check()
{ {
global $PHP_AUTH_USER, $PHP_AUTH_PW; global $PHP_AUTH_USER, $PHP_AUTH_PW;
/* Check if we're using same sigon server */
if (isset($_SESSION['LAST_SIGNON_URL']) && $_SESSION['LAST_SIGNON_URL'] != $GLOBALS['cfg']['Server']['SignonURL']) {
return false;
}
/* Session name */ /* Session name */
$session_name = $GLOBALS['cfg']['Server']['SignonSession']; $session_name = $GLOBALS['cfg']['Server']['SignonSession'];
/* Login URL */
$signon_url = $GLOBALS['cfg']['Server']['SignonURL'];
/* Current host */ /* Current host */
$single_signon_host = $GLOBALS['cfg']['Server']['host']; $single_signon_host = $GLOBALS['cfg']['Server']['host'];
@@ -150,8 +159,10 @@ function PMA_auth_check()
// Returns whether we get authentication settings or not // Returns whether we get authentication settings or not
if (empty($PHP_AUTH_USER)) { if (empty($PHP_AUTH_USER)) {
unset($_SESSION['LAST_SIGNON_URL']);
return false; return false;
} else { } else {
$_SESSION['LAST_SIGNON_URL'] = $GLOBALS['cfg']['Server']['SignonURL'];
return true; return true;
} }
} // end of the 'PMA_auth_check()' function } // end of the 'PMA_auth_check()' function