diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index e8df0b3601..3405e79883 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -145,7 +145,10 @@ $this->common =& CreateObject('phpgwapi.common'); $this->hooks =& CreateObject('phpgwapi.hooks'); $this->auth =& CreateObject('phpgwapi.auth'); - $this->accounts =& CreateObject('phpgwapi.accounts'); + # maybe we can also include this file at another place + # with PHP5 we can also use autoloading now + include_once(EGW_INCLUDE_ROOT.'/phpgwapi/inc/class.accounts.inc.php'); + $this->accounts = accounts::getInstance(); $this->acl =& CreateObject('phpgwapi.acl'); /* Do not create the session object if called by the sessions class. This way * we ensure the correct db based on the user domain. diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index 651183518a..4f1784cdff 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -428,7 +428,7 @@ if ($fill_egw_info_and_repositories) { $GLOBALS['egw']->acl->acl($this->account_id); - $GLOBALS['egw']->accounts->accounts($this->account_id); + accounts::getInstance()->setAccountId($this->account_id); $GLOBALS['egw']->preferences->preferences($this->account_id); $GLOBALS['egw']->applications->applications($this->account_id); } @@ -1019,7 +1019,7 @@ function read_repositories($cached='',$write_cache=True) { $GLOBALS['egw']->acl->acl($this->account_id); - $GLOBALS['egw']->accounts->accounts($this->account_id); + accounts::getInstance()->setAccountId($this->account_id); $GLOBALS['egw']->preferences->preferences($this->account_id); $GLOBALS['egw']->applications->applications($this->account_id);