Code

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

Changelog
plugins/admin/departments/class_departmentGeneric.inc

index ee58e803248eeae7068c260c2607513497e3cba8..5d2bc8d093cb83099ffb2fd7902f9882483584a6 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -14,6 +14,7 @@ GOsa2 changelog
   - Fixed problems when moving around departments including a comma
   - Unified bool values in gosa.conf. true/yes and false/no are valid
     now in upper and lower case.
+  - Avoid the try of creating already existing ou's
 
 * gosa 2.5.1
   - Fixed problems with NFS shares and terminals
index e7bdf678d109cfd848982d612b0bb4be3f4402de..5205da94447f99145248934c108fc8bb617b3a91 100644 (file)
@@ -221,8 +221,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.");