Code

Systems Workstation Startup
[gosa.git] / plugins / admin / systems / class_workstationService.inc
index 4db156af858d7e14cdddb9189beb1a08fbbe2d22..a12ac099244755167392beb14dd4f5e2062d83a7 100644 (file)
@@ -2,11 +2,6 @@
 
 class workservice extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Manage terminal service aspects";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   var $gotoScannerEnable;
   /* Generic terminal attributes */
   var $gotoXMonitor= "";
@@ -58,10 +53,19 @@ class workservice extends plugin
   var $XKbLayouts       =array();
   var $XKbVariants      =array();
 
+  var $member_of_ogroup = FALSE;
+
   function workservice ($config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
 
+    if(!isset($this->parent->by_object['ogroup'])){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd ($this->config->current['BASE']);
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+      $this->member_of_ogroup = $ldap->count() >= 1;
+    }
+
     $this->XResolutions= array( 
         "640x480"   =>  "640x480",
         "800x600"   =>  "800x600",
@@ -114,7 +118,7 @@ class workservice extends plugin
 
     /* Additional values will be extracted from CONFIG_DIR/gosa/keyboardLayouts */
     $this->XKbLayouts= array ("de"=> "de","intl" =>"intl","us" =>"us");
-    $this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic");
+    $this->XKbVariants= array ("basic"=>"basic", "nodeadkeys"=>"nodeadkeys");
 
     /* try to read additional keyboard layouts 
      */
@@ -327,6 +331,8 @@ class workservice extends plugin
       $smarty->assign("hiddenState","");
     }
 
+    $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
+
     /* Show main page */
     return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__))));
   }
@@ -341,7 +347,11 @@ class workservice extends plugin
   {
     plugin::save_object();
 
-    if(isset($_POST['gotoXDriver'])){
+    if(isset($_POST["inheritAll"])){
+      $this->set_everything_to_inherited();
+    }
+
+    if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){
       if(isset($_POST['AutoSync'])){
         $this->AutoSync = true;
       }else{
@@ -434,6 +444,19 @@ class workservice extends plugin
     $this->handle_post_events("modify");
   }
 
+  
+  function set_everything_to_inherited()
+  {
+      $this->gotoXKbLayout = "default";
+      $this->gotoXKbModel = "default";
+      $this->gotoXKbVariant = "default";      
+
+      $this->gotoXDriver ="default";
+      $this->gotoXResolution ="default";
+      $this->gotoXColordepth ="default";
+      $this->gotoXMouseType ="default";
+      $this->gotoXMouseport ="default";
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: