Code

Added inherit fix.
[gosa.git] / plugins / admin / systems / class_workstationGeneric.inc
index 294f8e537f1bea00d1bb16243e1732e0943ea818..e3900e931c2e1b098d02dd8be6be11886fd7e4c1 100644 (file)
@@ -110,6 +110,11 @@ class workgeneric extends plugin
       $this->gotoNtpServer=array();
     }
 
+    /* You can't inherit the NTP service, if we are not member in an object group */
+    if(!$this->member_of_ogroup){
+      $this->inheritTimeServer = FALSE;
+    }
+
     /* Create available ntp options */
     $tmp = $this->config->data['SERVERS']['NTP'];
     $this->gotoNtpServers = array();
@@ -133,7 +138,7 @@ class workgeneric extends plugin
     $tmp = $this->config->data['SERVERS']['SYSLOG'];
     foreach($tmp as $server){
       $visible = $server;
-      if($server == "default") {
+      if($server == "default" && $this->member_of_ogroup) {
         $visible = "["._("inherited")."]";
       }
       $this->gotoSyslogServers[$server] = $visible;
@@ -395,13 +400,16 @@ class workgeneric extends plugin
 
     /* Set inherit mode */
     if((isset($_POST['workgeneric_posted'])) && ($this->acl_is_writeable("gotoNtpServer"))){
-      if(isset($_POST["inheritTimeServer"])){
+      if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
         $this->inheritTimeServer = true;
       }else{
         $this->inheritTimeServer = false;
       }
     }
-
+    
+    if(isset($_POST["inheritAll"])){
+      $this->set_everything_to_inherited();
+    }
   }
 
 
@@ -628,7 +636,7 @@ class workgeneric extends plugin
     /* Set workstation service attributes to inherited */
     if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){
       foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
-            "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseType") as $name){
+            "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
         $this->parent->by_object['workservice']->$name = "default"; 
       }
     }