mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +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;
|
$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
|
* Run the search
|
||||||
*
|
*
|
||||||
|
|
|
@ -42,6 +42,9 @@ class LSsearchEntry {
|
||||||
// The hash of the search parameters
|
// The hash of the search parameters
|
||||||
private $hash = NULL;
|
private $hash = NULL;
|
||||||
|
|
||||||
|
// The attributes list
|
||||||
|
private $attrs_list=array();
|
||||||
|
|
||||||
// The attributes values
|
// The attributes values
|
||||||
private $attrs=array();
|
private $attrs=array();
|
||||||
|
|
||||||
|
@ -69,6 +72,7 @@ class LSsearchEntry {
|
||||||
$this -> params = $params;
|
$this -> params = $params;
|
||||||
$this -> id = $id;
|
$this -> id = $id;
|
||||||
$this -> dn =& $result[$id]['dn'];
|
$this -> dn =& $result[$id]['dn'];
|
||||||
|
$this -> attrs_list = $LSsearch -> getAttributes();
|
||||||
$this -> attrs =& $result[$id]['attrs'];
|
$this -> attrs =& $result[$id]['attrs'];
|
||||||
$this -> cache =& $result[$id]['cache'];
|
$this -> cache =& $result[$id]['cache'];
|
||||||
}
|
}
|
||||||
|
@ -227,8 +231,8 @@ class LSsearchEntry {
|
||||||
$this -> cache[$key] = $ret;
|
$this -> cache[$key] = $ret;
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
elseif (in_array($key,array_keys($this -> attrs))) {
|
elseif (in_array($key,array_keys($this -> attrs_list))) {
|
||||||
return $this -> attrs[$key];
|
return (isset($this -> attrs[$key])?$this -> attrs[$key]:null);
|
||||||
}
|
}
|
||||||
elseif (array_key_exists($key,$this->params['customInfos'])) {
|
elseif (array_key_exists($key,$this->params['customInfos'])) {
|
||||||
if(isset($this -> cache['customInfos'][$key])) {
|
if(isset($this -> cache['customInfos'][$key])) {
|
||||||
|
|
Loading…
Reference in a new issue