From: hickert Date: Tue, 20 Oct 2009 08:20:08 +0000 (+0000) Subject: Updated class ldap. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=294e3366af7a87231a7e530d985f7fdb9e6d8420;p=gosa.git Updated class ldap. -Added information about missing objectClass name git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14607 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 3bcf7f410..4b578a8f9 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -566,6 +566,12 @@ class LDAP{ if ($this->reconnect) $this->connect(); $r = @ldap_modify($this->cid, LDAP::fix($this->basedn), $attrs); $this->error = @ldap_error($this->cid); + if(!$this->success() && preg_match("/^objectClass: value #([0-9]*) invalid per syntax$/", $this->get_additional_error())){ + $oc = preg_replace("/^objectClass: value #([0-9]*) invalid per syntax$/","\\1", $this->get_additional_error()); + if(isset($attrs['objectClass'][$oc])){ + $this->error.= " objectClass: ".$attrs['objectClass'][$oc].""; + } + } return($r ? $r : 0); }else{ $this->error = "Could not connect to LDAP server"; @@ -579,6 +585,12 @@ class LDAP{ if ($this->reconnect) $this->connect(); $r = @ldap_add($this->cid, LDAP::fix($this->basedn), $attrs); $this->error = @ldap_error($this->cid); + if(!$this->success() && preg_match("/^objectClass: value #([0-9]*) invalid per syntax$/", $this->get_additional_error())){ + $oc = preg_replace("/^objectClass: value #([0-9]*) invalid per syntax$/","\\1", $this->get_additional_error()); + if(isset($attrs['objectClass'][$oc])){ + $this->error.= " objectClass: ".$attrs['objectClass'][$oc].""; + } + } return($r ? $r : 0); }else{ $this->error = "Could not connect to LDAP server";