Code

Apply patch for #3305
[gosa.git] / trunk / gosa-plugins / goto / admin / systems / goto / class_workstationService.inc
index 11394020cb07940417786a3ab4acb400a7635757..fde0993dee56fd7ce4e142a2a532266bcc7344bd 100644 (file)
@@ -201,7 +201,10 @@ class workservice extends plugin
         
         switch ($name){
           case 'gotoXDriver':
-            $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
+            $ogroup_driver = $attrs['gotoXDriver'][0];
+            if (in_array($ogroup_driver, $this->XDrivers) && (empty($this->attrs['gotoXDriver']))) {
+                $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
+            }
             break;
           case 'gotoXResolution':
             $this->XResolutions= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XResolutions;
@@ -355,6 +358,17 @@ class workservice 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();
+    $ldap->modify($this->attrs);
     $this->handle_post_events("remove");
     new log("remove","workstation/".get_class($this),$this->dn);
   }