From 3a5f08f32d256cae9e12e9edd9171f0edea959f7 Mon Sep 17 00:00:00 2001 From: Crack Date: Tue, 21 Sep 2010 13:10:59 +0200 Subject: [PATCH] load LoginCookieValidity from user prefereces cache to make it usable in auth plugins --- libraries/common.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/common.inc.php b/libraries/common.inc.php index ee2014582..e4ce8c8ce 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -801,7 +801,19 @@ if (! defined('PMA_MINIMUM_COMMON')) { require_once './libraries/logging.lib.php'; - // Gets the authentication library that fits the $cfg['Server'] settings + // get LoginCookieValidity from preferences cache + // no generic solution for loading preferences from cache as some settings need to be kept + // for processing in PMA_Config::loadUserPreferences() + $cache_key = 'server_' . $GLOBALS['server']; + if (isset($_SESSION['cache'][$cache_key]['userprefs']['LoginCookieValidity'])) { + $value = $_SESSION['cache'][$cache_key]['userprefs']['LoginCookieValidity']; + $GLOBALS['PMA_Config']->set('LoginCookieValidity', $value); + $GLOBALS['cfg']['LoginCookieValidity'] = $value; + unset($value); + } + unset($cache_key); + + // Gets the authentication library that fits the $cfg['Server'] settings // and run authentication // to allow HTTP or http