"using isset($GLOBALS['egw']->accounts) instead of is_object, as egw object always instanciates accounts object (with wrong config) if is_object() is used"

This commit is contained in:
Ralf Becker 2009-12-07 17:47:57 +00:00
parent 1db92b3b90
commit a3a3faab22

View File

@ -969,7 +969,7 @@ class setup
function setup_account_object(array $config=array()) function setup_account_object(array $config=array())
{ {
if (!is_object($this->accounts) || $config) if (!isset($this->accounts) || $config)
{ {
if (!is_object($this->db)) if (!is_object($this->db))
{ {
@ -987,7 +987,7 @@ class setup
} }
} }
$this->accounts = new accounts($config); $this->accounts = new accounts($config);
if (!is_object($GLOBALS['egw']->accounts)) $GLOBALS['egw']->accounts = $this->accounts; if (!isset($GLOBALS['egw']->accounts)) $GLOBALS['egw']->accounts = $this->accounts;
$this->accounts->cache_invalidate(); // the cache is shared for all instances of the class $this->accounts->cache_invalidate(); // the cache is shared for all instances of the class
if($this->accounts->backend instanceof accounts_ldap && !$this->accounts->backend->ds) if($this->accounts->backend instanceof accounts_ldap && !$this->accounts->backend->ds)