diff --git a/ChangeLog b/ChangeLog index c02b34550..752e7519b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-08-26 Marc Delisle + * index.php, libraries/common.lib.php: bug 1006011: now we save + the chosen connection collation into a cookie + 2004-08-25 Michal Čihař * main.php: Don't show port after verbose name (bug #1013401). diff --git a/index.php b/index.php index 46e212154..2138572f8 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,6 @@ /* $Id$ */ // vim: expandtab sw=4 ts=4 sts=4: - /** * 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 */ 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 PMA_setFontSizes(); diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 07caf3a36..eee7881e6 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -347,6 +347,15 @@ if (!is_dir($pmaThemeImage)) { } // 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) { /**