mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
LSsearchEntry : Fix 'unknwon property error' on accessing undefined attribute
This commit is contained in:
parent
059b72958b
commit
59943dc3ee
2 changed files with 18 additions and 3 deletions
|
@ -835,7 +835,18 @@ class LSsearch {
|
|||
|
||||
$this -> _searchParams = $retval;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get search attributes
|
||||
*
|
||||
* @retval array The attributes asked in this search
|
||||
**/
|
||||
public function getAttributes() {
|
||||
if (!$this -> _searchParams)
|
||||
$this -> generateSearchParams();
|
||||
return $this -> _searchParams['attributes'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the search
|
||||
*
|
||||
|
|
|
@ -42,6 +42,9 @@ class LSsearchEntry {
|
|||
// The hash of the search parameters
|
||||
private $hash = NULL;
|
||||
|
||||
// The attributes list
|
||||
private $attrs_list=array();
|
||||
|
||||
// The attributes values
|
||||
private $attrs=array();
|
||||
|
||||
|
@ -69,6 +72,7 @@ class LSsearchEntry {
|
|||
$this -> params = $params;
|
||||
$this -> id = $id;
|
||||
$this -> dn =& $result[$id]['dn'];
|
||||
$this -> attrs_list = $LSsearch -> getAttributes();
|
||||
$this -> attrs =& $result[$id]['attrs'];
|
||||
$this -> cache =& $result[$id]['cache'];
|
||||
}
|
||||
|
@ -227,8 +231,8 @@ class LSsearchEntry {
|
|||
$this -> cache[$key] = $ret;
|
||||
return $ret;
|
||||
}
|
||||
elseif (in_array($key,array_keys($this -> attrs))) {
|
||||
return $this -> attrs[$key];
|
||||
elseif (in_array($key,array_keys($this -> attrs_list))) {
|
||||
return (isset($this -> attrs[$key])?$this -> attrs[$key]:null);
|
||||
}
|
||||
elseif (array_key_exists($key,$this->params['customInfos'])) {
|
||||
if(isset($this -> cache['customInfos'][$key])) {
|
||||
|
|
Loading…
Reference in a new issue