bug 1006011, save the chosen connection collation into a cookie

This commit is contained in:
Marc Delisle
2004-08-26 11:12:17 +00:00
parent a56d76b55d
commit 5103056f34
3 changed files with 27 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-08-26 Marc Delisle <lem9@users.sourceforge.net>
* index.php, libraries/common.lib.php: bug 1006011: now we save
the chosen connection collation into a cookie
2004-08-25 Michal Čihař <michal@cihar.com> 2004-08-25 Michal Čihař <michal@cihar.com>
* main.php: Don't show port after verbose name (bug #1013401). * main.php: Don't show port after verbose name (bug #1013401).

View File

@@ -2,7 +2,6 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
/** /**
* Gets core libraries and defines some variables * Gets core libraries and defines some variables
*/ */
@@ -12,6 +11,20 @@ require_once('./libraries/common.lib.php');
* Includes the ThemeManager if it hasn't been included yet * Includes the ThemeManager if it hasn't been included yet
*/ */
require_once('./libraries/select_theme.lib.php'); require_once('./libraries/select_theme.lib.php');
/**
* Saves collation_connection (coming from main.php) in a cookie
*/
// (from grab_globals)
if (isset($collation_connection)) {
if (!isset($pma_uri_parts)) {
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
$cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
$is_https = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
}
setcookie('pma_collation_connection', $collation_connection, time() + 60*60*24*30, $cookie_path, '', $is_https);
}
// Gets the default font sizes // Gets the default font sizes
PMA_setFontSizes(); PMA_setFontSizes();

View File

@@ -347,6 +347,15 @@ if (!is_dir($pmaThemeImage)) {
} }
// end theme manager // end theme manager
/**
* collation_connection
*/
// (could be improved by executing it after the MySQL connection only if
// PMA_MYSQL_INT_VERSION >= 40100 )
if (isset($_COOKIE) && !empty($_COOKIE['pma_collation_connection']) && empty($_POST['collation_connection'])) {
$collation_connection = $_COOKIE['pma_collation_connection'];
}
if ($is_minimum_common == FALSE) { if ($is_minimum_common == FALSE) {
/** /**