Code

Fixed comment
[gosa.git] / plugins / admin / systems / class_workstationService.inc
index 7ba6be5e186e0a50b2220c793c5cfc1c11af48d8..51982ff1f7d2e3384742c9ee2bc808869bceda72 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= "";
@@ -31,13 +26,8 @@ class workservice extends plugin
   var $cn= "";
   var $orig_dn= "";
   var $XMethods= array();
-  var $XDrivers= array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev",
-      "i128", "i740", "i810", "imstt", "mga", "neomagic", "newport", "nsc",  "nv",
-      "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
-      "sis", "tdfx", "tga", "trident", "tseng", "vesa", "vga", "vmware");
-
+  var $XDrivers= array();
   var $XResolutions = array();
-
   var $MouseTypes= array();
   var $MousePorts= array();
   var $hardware_list= array();
@@ -58,9 +48,9 @@ class workservice extends plugin
   var $XKbLayouts       =array();
   var $XKbVariants      =array();
 
-  function workservice ($config, $dn= NULL)
+  function workservice ($config, $dn= NULL, $parent= NULL)
   {
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, $dn, $parent);
 
     $this->XResolutions= array( 
         "640x480"   =>  "640x480",
@@ -89,6 +79,9 @@ class workservice extends plugin
       }
     }
 
+    /* Get list of available xdrivers */
+    $this->XDrivers = $this->getListOfXDrivers();
+
     array_unshift($this->XDrivers, "["._("unknown")."]");
  
     $this->XColordepths= array( 
@@ -112,9 +105,9 @@ class workservice extends plugin
                              "/dev/ttyS1"       => "/dev/ttyS1",          "/dev/psaux"  =>"/dev/psaux", 
                              "/dev/input/mice"  => "/dev/input/mice");
 
-    /* Additional values will be extracted from /etc/gosa/keyboardLayouts */
+    /* 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 
      */
@@ -341,7 +334,7 @@ class workservice extends plugin
   {
     plugin::save_object();
 
-    if(isset($_POST['gotoXDriver'])){
+    if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){
       if(isset($_POST['AutoSync'])){
         $this->AutoSync = true;
       }else{
@@ -434,6 +427,27 @@ class workservice extends plugin
     $this->handle_post_events("modify");
   }
 
+
+  function getListOfXDrivers()
+  {
+    $drivers = array();
+
+    /* Generate a list of xdrivers from CONFIG_DIR/xdrivers */
+    if (file_exists(CONFIG_DIR.'/xdrivers')){
+      $xdrivers = file (CONFIG_DIR.'/xdrivers');
+      foreach ($xdrivers as $line){
+        if (!preg_match ("/^#/", $line)){
+          $drivers[]= trim($line);
+        }
+      }
+    } else {
+      $drivers = array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev", "fglrx",
+          "i128", "i740", "i810", "imstt", "mga", "neomagic", "newport", "nsc",  "nv", "nvidia",
+          "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
+          "sis", "tdfx", "tga", "trident", "tseng", "vesa", "vga", "vmware");
+    }
+    return($drivers);
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: