fixed PHP notice

This commit is contained in:
Roland Gruber 2010-06-10 15:34:52 +00:00
parent 154154a7ab
commit 7bb254e27f
1 changed files with 6 additions and 2 deletions

View File

@ -183,9 +183,13 @@ class cache {
* @return array list of variables to save
*/
function __sleep() {
$this->ldapcache = $_SESSION['ldap']->encrypt(serialize($this->ldapcache));
$attrs = array("attributes", "time");
if (isset($this->ldapcache)) {
$this->ldapcache = $_SESSION['ldap']->encrypt(serialize($this->ldapcache));
$attrs[] = 'ldapcache';
}
// define which attributes to save
return array("ldapcache", "attributes", "time");
return $attrs;
}
/**