Code

Fixed department creation with already existing ou's
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 12:47:29 +0000 (12:47 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 12:47:29 +0000 (12:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3912 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentGeneric.inc

index ca08ba3e3e4f19ce449c34a1a8f68f3a850e6594..6dd6ff7de85406c7652c6bf4220f60ed8f4c0291 100644 (file)
@@ -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.");