moved __wakeup code to reconnect to ldap server to the accounts_ldap class own __wakeup method, fixing an error with editing accounts using php4-restore together with accounts in ldap

This commit is contained in:
Ralf Becker 2007-12-20 19:38:26 +00:00
parent b3f40cdff8
commit b0146349db
2 changed files with 27 additions and 9 deletions

View File

@ -1017,4 +1017,13 @@ class accounts_ldap
}
return $sign * $account_id;
}
/**
* __wakeup function gets called by php while unserializing the object to reconnect with the ldap server
*/
function __wakeup()
{
$this->ds = $this->ldap->ldapConnect($this->frontend->config['ldap_host'],
$this->frontend->config['ldap_root_dn'],$this->frontend->config['ldap_root_pw']);
}
}

View File

@ -32,20 +32,34 @@
{
/**
* Turn on debug mode. Will output additional data for debugging purposes.
* @var string $debug
* @var string
* @access public
*/
var $debug = 0; // This will turn on debugging information.
/**
* @var egw_db-object $db instance of the db-object
* Instance of the db-object
*
* @var egw_db
*/
var $db;
var $config_table = 'egw_config';
/**
* Instance of the account object
*
* @var accounts
*/
var $accounts;
/**
* Instace of the common object
*
* @var common
*/
var $common;
/**
* tplsav2 savant2 templating object
* savant2 templating object
*
* @var object
* @var tplsavant2
*/
var $tplsav2;
@ -206,11 +220,6 @@
$this->$class->db->Link_ID =& $this->db->Link_ID;
}
}
if ($GLOBALS['egw_info']['server']['account_repository'] == 'ldap')
{
// reconnect the LDAP server, unfortunally this does not work via accounts::__wakeup() as the common-object is not yet available
$this->accounts->ds = $this->common->ldapConnect();
}
$this->define_egw_constants();
}