Code

Reenabled copy & paste for ACLroles.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Oct 2009 11:24:38 +0000 (11:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Oct 2009 11:24:38 +0000 (11:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14613 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/acl/class_aclRole.inc

index e78f0dfa1d604105fee21bfada69b3d9d6bd0c11..748d4b9c7538cc688838daaa569cb12f9225b289 100644 (file)
@@ -49,6 +49,7 @@ class aclrole extends acl
   /* Role attributes */
   var $gosaAclTemplate= "";
   var $cn = "";
+  var $orig_cn = "";
   var $description = "";
   var $orig_dn;
   var $orig_base;
@@ -139,6 +140,7 @@ class aclrole extends acl
     $this->is_account= TRUE;
     $this->orig_base = $this->base;
     $this->orig_dn = $this->dn;
+    $this->orig_cn = $this->cn;
   }
 
 
@@ -761,7 +763,20 @@ class aclrole extends acl
     if(empty($this->cn)){
       $message[] = msgPool::required(_("Name"));
     }
-   
+  
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    if($this->cn != $this->orig_cn){
+      $ldap->search("(&(objectClass=gosaRole)(cn=".$this->cn."))");
+      if($ldap->count()) {
+        while($attrs = $ldap->fetch()){
+          if($attrs['dn'] != $this->orig_dn){
+            $message[] = msgPool::duplicated(_("Name"));
+          }
+        }
+      }
+    } 
     if(!count($this->gosaAclTemplate)){
       $message[] = msgPool::required(_("ACL"));
     }