From 43ae18fb7aaee732781cae4a619a58ef6b45e916 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 24 Nov 2005 20:48:31 +0000 Subject: [PATCH] finding the db-object from setup too --- phpgwapi/inc/class.accounts.inc.php | 9 ++++++++- phpgwapi/inc/class.acl.inc.php | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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)