Code

Added missing class var.
[gosa.git] / gosa-plugins / systems / admin / systems / class_servGeneric.inc
index 37445077785644a10b92dec83d7cc0b9afc649c3..dd5a5e2c2070d7cf4fdc5b47126c171b5ac237ae 100644 (file)
@@ -32,6 +32,7 @@ class servgeneric extends plugin
   var $l= "";
   var $description= "";
   var $orig_dn= "";
+  var $orig_cn= "";
 
   /* attribute list for save action */
   var $attributes= array("cn", "description","gotoMode");
@@ -93,6 +94,7 @@ class servgeneric extends plugin
        
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
+    $this->orig_cn= $this->cn;
   }
 
 
@@ -122,7 +124,7 @@ class servgeneric extends plugin
 
     /* Do we represent a valid server? */
     if (!$this->is_account && $this->parent === NULL){
-      $display= "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
+      $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle>&nbsp;<b>".
         msgPool::noValidExtension(_("server"))."</b>"; 
       return($display);
     }
@@ -241,6 +243,8 @@ class servgeneric extends plugin
     $ldap= $this->config->get_ldap_link();
     $ldap->rmdir($this->dn);
 
+    update_accessTo($this->orig_cn,"");
+
     new log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
     if (!$ldap->success()){
@@ -323,8 +327,13 @@ class servgeneric extends plugin
 
     /* Warn the user, that this host is currently installing */
     if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("incomingou"))."/",$this->orig_dn)){
+
+      /* Force aborting without message dialog */
+      $message[] = "";
       $this->currently_installing_warned = TRUE;
-      $message[] = _("This host is currently installing, if you really want to save it, save again.");
+      msg_dialog::display(_("Software deployment"), 
+          _("This host is currently installing, if you really want to save it, press 'OK'."),
+          CONFIRM_DIALOG);
     }
 
     return ($message);
@@ -364,25 +373,17 @@ class servgeneric extends plugin
       new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $mode= "add";
     } else {
-   
-      /* 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->recursive_move($this->orig_dn, $this->dn);
-          plugin::save();
-        }
-      }else{
-        if ($this->orig_dn != $this->dn){
-          $this->recursive_move($this->orig_dn, $this->dn);
-          plugin::save();
-        }
-      }
   
       $ldap->cd($this->dn);
       $this->cleanup();
       $ldap->modify ($this->attrs); 
       new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
+      /* Update all accessTo/trust dependencies */
+      if($this->orig_cn != $this->cn){
+        update_accessTo($this->orig_cn,$this->cn);
+      }
+
       $mode= "modify";
     }
     if (!$ldap->success()){