From: hickert Date: Thu, 15 Nov 2007 07:17:08 +0000 (+0000) Subject: Updated service plugins. (Workstation/Terminal) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d834ce6c5f8c228805c2bed4bf14d37212754f2d;p=gosa.git Updated service plugins. (Workstation/Terminal) - Read Xdrivers from file (/etc/gosa/xdrivers) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7798 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 1bd893919..db898e17e 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -39,10 +39,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 (); @@ -68,7 +65,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( @@ -467,7 +466,29 @@ class termservice extends plugin } -/* Return plugin informations for acl handling */ + 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); + } + + + /* Return plugin informations for acl handling */ function plInfo() { return (array( diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index eb6900384..642cce63f 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -32,13 +32,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(); @@ -90,6 +85,9 @@ class workservice extends plugin } } + /* Get list of available xdrivers */ + $this->XDrivers = $this->getListOfXDrivers(); + array_unshift($this->XDrivers, "["._("unknown")."]"); $this->XColordepths= array( @@ -452,6 +450,28 @@ class workservice extends plugin $this->handle_post_events("modify"); } + + function getListOfXDrivers() + { + /* Generate list of xdrivers from from CONFIG_DIR./xdrivers */ + $drivers = array(); + 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); + } + + /* Return plugin informations for acl handling */ function plInfo() {