From f5f0698ba955a324bf2e9dfffb8b4bdf8ea50d46 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 15 Nov 2007 07:14:30 +0000 Subject: [PATCH] Added alternative resource for XDriver attribute - Terminal-/Workstationservice If /etc/gosa/xdriver extists, read drivers from file. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7797 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_terminalService.inc | 30 +++++++++++++++--- .../systems/class_workstationService.inc | 31 +++++++++++++++---- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 5199369f5..32c8d207a 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -32,10 +32,7 @@ class termservice extends plugin var $cn= ""; var $orig_dn= ""; var $XMethods= array(); - var $XDrivers= 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"); + var $XDrivers= array(); var $XResolutions= array(); var $XColordepths= array(); var $XKbModels= array (); @@ -61,7 +58,9 @@ class termservice extends plugin function termservice ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - + + /* Get list of available xdrivers */ + $this->XDrivers = $this->getListOfXDrivers(); array_unshift($this->XDrivers, "["._("unknown")."]"); $this->XResolutions= array( @@ -452,6 +451,27 @@ class termservice extends plugin $this->handle_post_events("modify"); } + + function getListOfXDrivers() + { + $drivers = array(); + + /* Generate list of xdrivers from 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: diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index 5fac20be9..c31d976ba 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -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", "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"); - + var $XDrivers= array(); var $XResolutions = array(); - var $MouseTypes= array(); var $MousePorts= array(); var $hardware_list= array(); @@ -84,6 +79,9 @@ class workservice extends plugin } } + /* Get list of available xdrivers */ + $this->XDrivers = $this->getListOfXDrivers(); + array_unshift($this->XDrivers, "["._("unknown")."]"); $this->XColordepths= array( @@ -429,6 +427,27 @@ class workservice extends plugin $this->handle_post_events("modify"); } + + function getListOfXDrivers() + { + $drivers = array(); + + /* Generate list of xdrivers from 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: -- 2.30.2