From 382443db9d291ebe40f97a94534a0913f7c0a6ef Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 22 Nov 2007 15:59:44 +0000 Subject: [PATCH] Fixed broken fetch() call on non existing resources. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7861 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index bcd2ccfb1..1973c820b 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -216,7 +216,6 @@ class LDAP{ $basedn= LDAP::convert($basedn); $start = microtime(); - $this->sr = @ldap_list($this->cid, LDAP::fix($basedn), $filter,$attrs); $this->error = @ldap_error($this->cid); $this->resetResult(); @@ -276,8 +275,12 @@ class LDAP{ if($this->hasres){ if ($this->start == 0) { - $this->start = 1; - $this->re= @ldap_first_entry($this->cid, $this->sr); + if ($this->sr){ + $this->start = 1; + $this->re= @ldap_first_entry($this->cid, $this->sr); + } else { + return array(); + } } else { $this->re= @ldap_next_entry($this->cid, $this->re); } @@ -816,7 +819,6 @@ class LDAP{ if ($info= @ldap_get_values_len($this->cid, $ei, "$name")){ $data= $info[0]; } - } } if($r_array==0) -- 2.30.2