From 4269c46e1fd6a3bb7bc3ef8f9d736dde1ae97386 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 2 Nov 2005 12:17:39 +0000 Subject: [PATCH] fixed errors when schema is not readable --- lam/lib/ldap.inc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index 2f6c14aa..30d5170e 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -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