From a6b34a5977fd68e7da5e4703dbff487fbb579e5b Mon Sep 17 00:00:00 2001 From: Crack Date: Wed, 4 Aug 2010 15:27:47 +0200 Subject: [PATCH] fix generation of theme unique value refresh session cache for config after save --- libraries/Config.class.php | 3 ++- prefs_forms.php | 2 ++ prefs_manage.php | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 66c36e8f2..16fe5a1b3 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -458,6 +458,7 @@ class PMA_Config $config_data = $_SESSION['cache'][$cache_key]['userprefs']; // type is 'db' or 'session' $this->set('user_preferences', $_SESSION['cache'][$cache_key]['userprefs_type']); + $this->set('user_preferences_mtime', $_SESSION['cache'][$cache_key]['userprefs_mtime']); // backup some settings $org_fontsize = $this->settings['fontsize']; @@ -712,7 +713,7 @@ class PMA_Config $fontsize + $this->source_mtime + $this->default_source_mtime + - (isset($_SESSION['cache']['userprefs_mtime']) ? $_SESSION['cache']['userprefs_mtime'] : 0) + + $this->get('user_preferences_mtime') + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info) . (isset($_SESSION['tmp_user_values']['custom_color']) ? substr($_SESSION['tmp_user_values']['custom_color'],1,6) : ''); diff --git a/prefs_forms.php b/prefs_forms.php index 63cdea502..c5cb8d134 100644 --- a/prefs_forms.php +++ b/prefs_forms.php @@ -52,6 +52,8 @@ if ($form_display->process(false) && !$form_display->hasErrors()) { $old_settings = PMA_load_userprefs(); $result = PMA_save_userprefs(ConfigFile::getInstance()->getConfigArray()); if ($result === true) { + // reload config + $GLOBALS['PMA_Config']->loadUserPreferences(); $hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#'); PMA_userprefs_redirect($forms, $old_settings, 'prefs_forms.php', array( 'form' => $form_param), $hash); diff --git a/prefs_manage.php b/prefs_manage.php index 52a33f084..3df224988 100644 --- a/prefs_manage.php +++ b/prefs_manage.php @@ -175,6 +175,8 @@ if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') == } else { $return_url = 'prefs_manage.php'; } + // reload config + $GLOBALS['PMA_Config']->loadUserPreferences(); PMA_userprefs_redirect($forms, $old_settings, $return_url, $params); exit; } else {