diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index a0d1d356c0..9e40a077f8 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -108,7 +108,14 @@ // enable the caching in the session onyl for ldap $this->use_session_cache = $GLOBALS['egw_info']['server']['account_repository'] == 'ldap'; - $this->db =& $GLOBALS['egw']->db; + if (is_object($GLOBALS['egw_setup']->db)) + { + $this->db = clone($GLOBALS['egw_setup']->db); + } + else + { + $this->db = clone($GLOBALS['egw']->db); + } if($account_id != '') { diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index 7a18aedf53..23130284a0 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -72,7 +72,14 @@ */ function acl($account_id = '') { - $this->db = clone($GLOBALS['egw']->db); + if (is_object($GLOBALS['egw_setup']->db)) + { + $this->db = clone($GLOBALS['egw_setup']->db); + } + else + { + $this->db = clone($GLOBALS['egw']->db); + } $this->db->set_app('phpgwapi'); if ((int)$this->account_id != (int)$account_id)