fixed errors when schema is not readable
This commit is contained in:
parent
835583383b
commit
4269c46e1f
|
@ -189,8 +189,13 @@ class Ldap{
|
|||
$info = @ldap_get_entries($this->server,$sr);
|
||||
if ($info) {
|
||||
$this->objectClasses = $info[0]['objectclasses'];
|
||||
if (is_array($this->objectClasses)) {
|
||||
array_shift($this->objectClasses);
|
||||
}
|
||||
else {
|
||||
$this->objectClasses = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
// if search failed save empty result
|
||||
else $this->objectClasses = array();
|
||||
|
@ -204,8 +209,16 @@ class Ldap{
|
|||
$info = @ldap_get_entries($this->server,$sr);
|
||||
if ($info) {
|
||||
$attributes = $info[0]['attributetypes'];
|
||||
if (is_array($attributes)) {
|
||||
array_shift($attributes);
|
||||
}
|
||||
else {
|
||||
$attributes = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$attributes = array();
|
||||
}
|
||||
// build Attribute list
|
||||
for ($i=0; $i<count($attributes); $i++) {
|
||||
|
|
Loading…
Reference in New Issue