From ac04409df7a3c489d5c86276abc8fe484fc620ef Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 21 Mar 2008 20:50:13 +0000 Subject: [PATCH] dynamically autoloading sub-object of egw-object, moved __wakeup methods to concerned classes and other "modernsations" ;-) --- phpgwapi/inc/class.accounts_ldap.inc.php | 6 +----- phpgwapi/inc/class.ldap.inc.php | 12 +++++------- phpgwapi/inc/class.sessions.inc.php | 2 -- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index b6e8969242..702e8ae226 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -134,11 +134,7 @@ class accounts_ldap $this->ds = $this->ldap->ldapConnect($this->frontend->config['ldap_host'], $this->frontend->config['ldap_root_dn'],$this->frontend->config['ldap_root_pw']); - if(!@is_object($GLOBALS['egw']->translation)) - { - $GLOBALS['egw']->translation =& new translation(); - } - $this->translation =& $GLOBALS['egw']->translation; + $this->translation = $GLOBALS['egw']->translation; $this->user_context = $this->frontend->config['ldap_context']; $this->account_filter = $this->frontend->config['ldap_search_filter']; diff --git a/phpgwapi/inc/class.ldap.inc.php b/phpgwapi/inc/class.ldap.inc.php index 1ea29bf278..9eb8e9aeb3 100644 --- a/phpgwapi/inc/class.ldap.inc.php +++ b/phpgwapi/inc/class.ldap.inc.php @@ -14,8 +14,6 @@ /* $Id$ */ - include_once(EGW_INCLUDE_ROOT.'/phpgwapi/inc/class.ldapserverinfo.inc.php'); - /*! @class contacts @abstract Contact List System @@ -89,7 +87,7 @@ if(!function_exists('ldap_connect')) { /* log does not exist in setup(, yet) */ - if(is_object($GLOBALS['egw']->log)) + if(isset($GLOBALS['egw']->log)) { $GLOBALS['egw']->log->message('F-Abort, LDAP support unavailable'); $GLOBALS['egw']->log->commit(); @@ -117,7 +115,7 @@ if(!$this->ds = ldap_connect($host)) { /* log does not exist in setup(, yet) */ - if(is_object($GLOBALS['egw']->log)) + if(isset($GLOBALS['egw']->log)) { $GLOBALS['egw']->log->message('F-Abort, Failed connecting to LDAP server'); $GLOBALS['egw']->log->commit(); @@ -209,7 +207,7 @@ } if(!@ldap_bind($this->ds, $dn, $passwd)) { - if(is_object($GLOBALS['egw']->log)) { + if(isset($GLOBALS['egw']->log)) { $GLOBALS['egw']->log->message('F-Abort, Failed binding to LDAP server'); $GLOBALS['egw']->log->commit(); } @@ -237,7 +235,7 @@ */ function restoreSessionData() { - if (is_object($GLOBALS['egw']->session)) // no availible in setup + if (isset($GLOBALS['egw']->session)) // no availible in setup { $this->ldapServerInfo = $GLOBALS['egw']->session->appsession('ldapServerInfo'); } @@ -247,7 +245,7 @@ */ function saveSessionData() { - if (is_object($GLOBALS['egw']->session)) // no availible in setup + if (isset($GLOBALS['egw']->session)) // no availible in setup { $GLOBALS['egw']->session->appsession('ldapServerInfo','',$this->ldapServerInfo); } diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index 4f1784cdff..a742e2446c 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -182,8 +182,6 @@ $this->egw_domains = $domain_names; - /* Create the crypto object */ - $GLOBALS['egw']->crypto =& CreateObject('phpgwapi.crypto'); if ($GLOBALS['egw_info']['server']['usecookies']) { $this->egw_set_cookiedomain();