mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
fix PHP 8.1 Error: Serialization of 'LDAP\Connection' is not allowed
This commit is contained in:
parent
12863efb78
commit
03099756d7
@ -1445,6 +1445,22 @@ class adLDAP extends \adLDAP
|
|||||||
parent::__construct($options);
|
parent::__construct($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magic method called when object gets serialized
|
||||||
|
*
|
||||||
|
* We do NOT store ldapConnection, as we need to reconnect anyway.
|
||||||
|
* PHP 8.1 gives an error when trying to serialize LDAP\Connection object!
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function __sleep()
|
||||||
|
{
|
||||||
|
$vars = get_object_vars($this);
|
||||||
|
unset($vars['ldapConnection']);
|
||||||
|
unset($this->ldapConnection);
|
||||||
|
return array_keys($vars);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert 8bit characters e.g. accented characters to UTF8 encoded characters
|
* Convert 8bit characters e.g. accented characters to UTF8 encoded characters
|
||||||
*
|
*
|
||||||
|
@ -1294,6 +1294,22 @@ class Ldap
|
|||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magic method called when object gets serialized
|
||||||
|
*
|
||||||
|
* We do NOT store ldapConnection, as we need to reconnect anyway.
|
||||||
|
* PHP 8.1 gives an error when trying to serialize LDAP\Connection object!
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function __sleep()
|
||||||
|
{
|
||||||
|
$vars = get_object_vars($this);
|
||||||
|
unset($vars['ds']);
|
||||||
|
unset($this->ds);
|
||||||
|
return array_keys($vars);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __wakeup function gets called by php while unserializing the object to reconnect with the ldap server
|
* __wakeup function gets called by php while unserializing the object to reconnect with the ldap server
|
||||||
*/
|
*/
|
||||||
|
@ -360,6 +360,22 @@ class Ldap
|
|||||||
$this->accountsFilter = "(&$this->accountsFilter$accounts_filter)";
|
$this->accountsFilter = "(&$this->accountsFilter$accounts_filter)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magic method called when object gets serialized
|
||||||
|
*
|
||||||
|
* We do NOT store ldapConnection, as we need to reconnect anyway.
|
||||||
|
* PHP 8.1 gives an error when trying to serialize LDAP\Connection object!
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function __sleep()
|
||||||
|
{
|
||||||
|
$vars = get_object_vars($this);
|
||||||
|
unset($vars['ds']);
|
||||||
|
unset($this->ds);
|
||||||
|
return array_keys($vars);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __wakeup function gets called by php while unserializing the object to reconnect with the ldap server
|
* __wakeup function gets called by php while unserializing the object to reconnect with the ldap server
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user