use PMA_sendHeaderLocation() and new functionality of PMA_generate_common_url()

This commit is contained in:
Sebastian Mendel
2005-11-25 10:25:27 +00:00
parent a79b25c0e2
commit 42feed2cca
2 changed files with 13 additions and 41 deletions

View File

@@ -12,6 +12,8 @@ $Source$
- add SID only if set - add SID only if set
- check for url params already exist or not (wether & . SID or ? . SID) - check for url params already exist or not (wether & . SID or ? . SID)
- respect arg_separator.input from php.ini - respect arg_separator.input from php.ini
* libraries/auth/cookie.auth.lib.php: use PMA_sendHeaderLocation()
and new functionality of PMA_generate_common_url()
2005-11-25 Michal Čihař <michal@cihar.com> 2005-11-25 Michal Čihař <michal@cihar.com>
* Documentation.html, config.footer.inc.php(deleted), * Documentation.html, config.footer.inc.php(deleted),

View File

@@ -146,7 +146,7 @@ echo sprintf( $GLOBALS['strWelcome'],
echo '<div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n"; echo '<div class="error"><h1>' . $GLOBALS['strError'] . '</h1>' . "\n";
echo $conn_error . '</div>' . "\n"; echo $conn_error . '</div>' . "\n";
} }
// Displays the languages form // Displays the languages form
if (empty($cfg['Lang'])) { if (empty($cfg['Lang'])) {
echo "\n"; echo "\n";
@@ -459,53 +459,23 @@ function PMA_auth_set_user()
} }
} }
// loic1: workaround against a IIS 5.0 bug
// lem9: here, PMA_sendHeaderLocation() has not yet been defined,
// so use the workaround
if (empty($GLOBALS['SERVER_SOFTWARE'])) {
if (isset($_SERVER) && !empty($_SERVER['SERVER_SOFTWARE'])) {
$GLOBALS['SERVER_SOFTWARE'] = $_SERVER['SERVER_SOFTWARE'];
}
} // end if
// URL where to go: // URL where to go:
$redirect_url = $cfg['PmaAbsoluteUri'] . 'index.php'; $redirect_url = $cfg['PmaAbsoluteUri'] . 'index.php';
$separator = '?';
// any parameters to pass? // any parameters to pass?
$params = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', $url_params = array();
isset($GLOBALS['table']) ? $GLOBALS['table'] : '', '&'); if ( ! empty($GLOBALS['target']) ) {
if (!empty($params)) { $url_params['db'] = $GLOBALS['db'];
$redirect_url .= $separator . $params; }
$separator = '&'; if ( ! empty($GLOBALS['target']) ) {
$url_params['table'] = $GLOBALS['table'];
} }
unset($params);
// any target to pass? // any target to pass?
if (!empty($GLOBALS['target'])) { if ( ! empty($GLOBALS['target']) ) {
$redirect_url .= $separator . 'target=' . urlencode($GLOBALS['target']). $url_params['target'] = $GLOBALS['target'];
$separator = '&';
}
// any seesion id to pass?
$sid = '' . SID;
if (!empty($sid)) {
$redirect_url .= $separator . $sid;
$separator = '&';
}
unset($sid);
// cleanup
unset($separtor);
// And finally redirect
if (!empty($GLOBALS['SERVER_SOFTWARE']) && $GLOBALS['SERVER_SOFTWARE'] == 'Microsoft-IIS/5.0') {
header('Refresh: 0; url=' . $redirect_url);
}
else {
header('Location: ' . $redirect_url);
} }
PMA_sendHeaderLocation( $redirect_url . PMA_generate_common_url( $url_params, '&' ) );
exit(); exit();
} // end if } // end if