Code

Added better acl assignment
[gosa.git] / plugins / admin / systems / class_servGeneric.inc
index ee9c214a051989bcca1e8667e8d0b15061402e6c..b85d9c834acfad10647d435721ebd3500e23d48e 100644 (file)
@@ -43,6 +43,9 @@ class servgeneric extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Do we represent a valid server? */
     if (!$this->is_account && $this->parent == NULL){
       $display= "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
@@ -214,10 +217,20 @@ class servgeneric extends plugin
       $ldap->add($this->attrs);
       $mode= "add";
     } else {
-      if ($this->orig_dn != $this->dn){
-        $this->move($this->orig_dn, $this->dn);
+   
+      /* cn is not case sensitive for ldap, but for php it is!! */ 
+      if($this->config->current['DNMODE'] == "cn"){
+        if (strtolower($this->orig_dn) != (strtolower($this->dn))){
+          $this->move($this->orig_dn, $this->dn);
+          plugin::save();
+        }
+      }else{
+        if ($this->orig_dn != $this->dn){
+          $this->move($this->orig_dn, $this->dn);
+          plugin::save();
+        }
       }
-
+  
       $ldap->cd($this->dn);
       $ldap->modify($this->attrs);
       $mode= "modify";