Code

Apply fix for #4368
[gosa.git] / trunk / gosa-plugins / goto / admin / systems / goto / class_workstationStartup.inc
index 1460629097d3757677d1313780411bb1f15c4da3..b1ae491fcc536fb43adbaa9feac5d5332f53a839 100644 (file)
@@ -694,6 +694,18 @@ class workstartup extends plugin
 
   function remove_from_parent()
   {
+    /* Cancel if there's nothing to do here */
+    if ((!$this->acl_is_removeable())){
+      return;
+    }
+
+    /* Remove and write to LDAP */
+    plugin::remove_from_parent();
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cd($this->dn);
+    $this->cleanup();
+    $this->attrs['gotoModules'] = array();
+    $ldap->modify($this->attrs);
     $this->handle_post_events("remove");
     new log("remove","workstation/".get_class($this),$this->dn);
   }
@@ -845,7 +857,7 @@ class workstartup extends plugin
       }
     }
 
-    if ($this->attrs['gotoBootKernel'] == "default-inherited"){
+    if ($this->gotoBootKernel == "default-inherited"){
       $this->attrs['gotoBootKernel']= array();
     }
 
@@ -991,7 +1003,7 @@ class workstartup extends plugin
     plugin::PrepareForCopyPaste($source);    
     $source_o = new workstartup ($this->config, $source['dn']);
     foreach(array("FAIclass","gotoModules", "gotoAutoFs", "gotoFilesystem",
-          "gotoKernelParameters","gotoShares") as $attr){
+          "gotoKernelParameters","gotoShares","gotoLdapServers", "gotoLdap_inherit") as $attr){
       $this->$attr = $source_o->$attr;
     }
   }