From: cajus Date: Mon, 26 Jun 2006 12:47:29 +0000 (+0000) Subject: Fixed department creation with already existing ou's X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e0344fb5c61e22830606e4830641ad4090aad30;p=gosa.git Fixed department creation with already existing ou's git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3912 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index ca08ba3e3..6dd6ff7de 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -228,8 +228,8 @@ class department extends plugin /* Check for presence of this department */ $ldap= $this->config->get_ldap_link(); - $attrs= $ldap->cat ($this->dn, array('dn')); - if ($this->orig_dn == "new" && !($attrs === FALSE)){ + $ldap->ls ("(&(ou=".$this->ou.")(objectClass=organizationalUnit))", $this->base, array('dn')); + if ($this->orig_dn == "new" && $ldap->count()){ $message[]= _("Department with that 'Name' already exists."); } elseif ($this->orig_dn != $this->dn && !($attrs === FALSE)){ $message[]= _("Department with that 'Name' already exists.");