Code

Fixed comment
[gosa.git] / plugins / admin / systems / class_workstationService.inc
index 84c3b42c7df79addf3f6d9ec5df98515da27660d..51982ff1f7d2e3384742c9ee2bc808869bceda72 100644 (file)
@@ -26,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();
@@ -53,18 +48,10 @@ 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);
 
-
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd ($this->config->current['BASE']);
-    $ldap->search("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))",array("cn"));
-    $this->member_of_ogroup = $ldap->count() >= 1;
-
     $this->XResolutions= array( 
         "640x480"   =>  "640x480",
         "800x600"   =>  "800x600",
@@ -92,6 +79,9 @@ class workservice extends plugin
       }
     }
 
+    /* Get list of available xdrivers */
+    $this->XDrivers = $this->getListOfXDrivers();
+
     array_unshift($this->XDrivers, "["._("unknown")."]");
  
     $this->XColordepths= array( 
@@ -330,8 +320,6 @@ 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__))));
   }
@@ -346,10 +334,6 @@ class workservice extends plugin
   {
     plugin::save_object();
 
-    if(isset($_POST["inheritAll"])){
-      $this->set_everything_to_inherited();
-    }
-
     if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){
       if(isset($_POST['AutoSync'])){
         $this->AutoSync = true;
@@ -443,18 +427,26 @@ class workservice extends plugin
     $this->handle_post_events("modify");
   }
 
-  
-  function set_everything_to_inherited()
+
+  function getListOfXDrivers()
   {
-      $this->gotoXKbLayout = "default";
-      $this->gotoXKbModel = "default";
-      $this->gotoXKbVariant = "default";      
-
-      $this->gotoXDriver ="default";
-      $this->gotoXResolution ="default";
-      $this->gotoXColordepth ="default";
-      $this->gotoXMouseType ="default";
-      $this->gotoXMouseport ="default";
+    $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);
   }
 }