fixed errors when schema is not readable

This commit is contained in:
Roland Gruber 2005-11-02 12:17:39 +00:00
parent 835583383b
commit 4269c46e1f
1 changed files with 15 additions and 2 deletions

View File

@ -189,7 +189,12 @@ class Ldap{
$info = @ldap_get_entries($this->server,$sr);
if ($info) {
$this->objectClasses = $info[0]['objectclasses'];
array_shift($this->objectClasses);
if (is_array($this->objectClasses)) {
array_shift($this->objectClasses);
}
else {
$this->objectClasses = array();
}
}
}
// if search failed save empty result
@ -204,9 +209,17 @@ class Ldap{
$info = @ldap_get_entries($this->server,$sr);
if ($info) {
$attributes = $info[0]['attributetypes'];
array_shift($attributes);
if (is_array($attributes)) {
array_shift($attributes);
}
else {
$attributes = array();
}
}
}
else {
$attributes = array();
}
// build Attribute list
for ($i=0; $i<count($attributes); $i++) {
// TODO: is it save to use while in lower code?