From eb6bea34b2c240baf8508e7aed8bbab04548c213 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 14 Jun 2011 08:44:24 +0000 Subject: [PATCH] some fixes to run save_repository() reliable within setup --- phpgwapi/inc/class.preferences.inc.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 3511337a87..221def3952 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -693,7 +693,7 @@ class preferences } //echo "

preferences::save_repository(,$type): account_id=$account_id, prefs="; print_r($prefs); echo "

\n"; - if (!$GLOBALS['egw']->acl->check('session_only_preferences',1,'preferences')) + if (isset($GLOBALS['egw_setup']) || !$GLOBALS['egw']->acl->check('session_only_preferences',1,'preferences')) { $this->db->transaction_begin(); $this->db->delete($this->table,array('preference_owner' => $account_id),__LINE__,__FILE__); @@ -715,13 +715,18 @@ class preferences } $this->db->transaction_commit(); - // no need to invalidate session cache, if we write the prefs to the session too - $egw = unserialize($_SESSION[egw_session::EGW_OBJECT_CACHE]); - $egw->preferences = $this; - $_SESSION[egw_session::EGW_OBJECT_CACHE] = serialize($egw); + if (!isset($GLOBALS['egw_setup'])) + { + // no need to invalidate session cache, if we write the prefs to the session too + $egw = unserialize($_SESSION[egw_session::EGW_OBJECT_CACHE]); + $egw->preferences = $this; + $_SESSION[egw_session::EGW_OBJECT_CACHE] = serialize($egw); + } + } + if (!isset($GLOBALS['egw_setup'])) + { + $_SESSION[egw_session::EGW_INFO_CACHE]['user']['preferences'] = $GLOBALS['egw_info']['user']['preferences'] = $this->data; } - $_SESSION[egw_session::EGW_INFO_CACHE]['user']['preferences'] = $GLOBALS['egw_info']['user']['preferences'] = $this->data; - return $this->data; }