From d8932b3ad300522b66e27c5333f004f087a23a8c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 24 Nov 2005 20:08:09 +0000 Subject: [PATCH] calling invalidate_session_cache only if it exists (setup does not have/need it) --- phpgwapi/inc/class.acl.inc.php | 12 ++++++++---- phpgwapi/inc/class.config.inc.php | 2 +- phpgwapi/inc/class.preferences.inc.php | 6 ++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index cf47a227ab..7a18aedf53 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -243,7 +243,8 @@ ),false,__LINE__,__FILE__); } } - if ($this->account_id == $GLOBALS['egw_info']['user']['account_id']) + if ($this->account_id == $GLOBALS['egw_info']['user']['account_id'] && + method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited { $GLOBALS['egw']->invalidate_session_cache(); } @@ -386,7 +387,8 @@ 'acl_account' => $account_id, ),__LINE__,__FILE__); - if ($account_id == $GLOBALS['egw_info']['user']['account_id']) + if ($account_id == $GLOBALS['egw_info']['user']['account_id'] && + method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited { $GLOBALS['egw']->invalidate_session_cache(); } @@ -420,8 +422,10 @@ $where['acl_account'] = $cache_accountid[$accountid] = get_account_id($accountid,$this->account_id); } } - $GLOBALS['egw']->invalidate_session_cache(); - + if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited + { + $GLOBALS['egw']->invalidate_session_cache(); + } if ($app == '%' || $app == '%%') unset($where['acl_appname']); $this->db->delete($this->table_name,$where,__LINE__,__FILE__); diff --git a/phpgwapi/inc/class.config.inc.php b/phpgwapi/inc/class.config.inc.php index 180670aa3f..32201d585b 100755 --- a/phpgwapi/inc/class.config.inc.php +++ b/phpgwapi/inc/class.config.inc.php @@ -94,7 +94,7 @@ } $this->db->unlock(); - if ($this->appname == 'phpgwapi') + if ($this->appname == 'phpgwapi' && method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited { $GLOBALS['egw']->invalidate_session_cache(); // in case egw_info is cached in the session (phpgwapi is in egw_info[server]) } diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 624a246b4e..a790b7d4ba 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -602,8 +602,10 @@ $GLOBALS['egw_info']['user']['preferences'] = $this->data; $GLOBALS['egw']->session->save_repositories(); } - $GLOBALS['egw']->invalidate_session_cache(); // in case with cache the egw_info array in the session - + if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited + { + $GLOBALS['egw']->invalidate_session_cache(); // in case with cache the egw_info array in the session + } return $this->data; }