using the singleton passtern to get a instance of the accounts class and call the setAccountId function to set the accountId

This commit is contained in:
Lars Kneschke 2008-02-08 11:20:50 +00:00
parent 51f14c8d82
commit 09f1287d6c
2 changed files with 6 additions and 3 deletions

View File

@ -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.

View File

@ -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);