From: hickert Date: Wed, 9 Aug 2006 06:14:00 +0000 (+0000) Subject: Fixed inherit / default for terminalStartup X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e76bf1896511e9a4f1efcca03733c3cd88d82ad9;p=gosa.git Fixed inherit / default for terminalStartup git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4431 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 84c72ffb0..d325b7478 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -9,7 +9,7 @@ class termstartup extends plugin /* Generic terminal attributes */ var $bootmode= "G"; var $goLdapServerList= array(); - var $gotoBootKernel= ""; + var $gotoBootKernel= "default-inherit"; var $gotoKernelParameters= ""; var $gotoLdapServer= ""; var $gotoModules= array(); @@ -36,7 +36,7 @@ class termstartup extends plugin { plugin::plugin ($config, $dn); - $this->gotoBootKernels = array("default"=>"["._("inherited")."]"); + $this->gotoBootKernels = array("default-inherit"=>"["._("inherited")."]"); /* Get arrays */ foreach (array("gotoModules") as $val){ @@ -95,9 +95,17 @@ class termstartup extends plugin } else { $fh= popen($command, "r"); while (!feof($fh)) { - $buffer= fgets($fh, 256); + $buffer= trim(fgets($fh, 256)); + + $name=$value = $buffer; + + if(preg_match("/:/",$buffer)){ + $name = preg_replace("/:.*$/","",$buffer); + $value= preg_replace("/^.*:/","",$buffer); + } + if(!empty($buffer)){ - $this->gotoBootKernels[]= $buffer; + $this->gotoBootKernels[$name]= $value; } } pclose($fh); @@ -107,7 +115,7 @@ class termstartup extends plugin $tmp = $this->config->data['SERVERS']['LDAP']; foreach($tmp as $server){ $visible = $server; - if($server == "default"){ + if($server == "default-inherit"){ $visible = "["._("inherited")."]"; } $this->goLdapServerList[$server] = $visible; @@ -128,7 +136,7 @@ class termstartup extends plugin switch ($name){ case 'gotoLdapServer': - $this->goLdapServerList= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList); + $this->goLdapServerList= array_merge(array('default-inherit' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList); break; } } @@ -304,7 +312,7 @@ class termstartup extends plugin /* Find proper terminal path for tftp configuration FIXME: This is suboptimal when the default has changed to another location! */ - if ($this->gotoTerminalPath == "default"){ + if ($this->gotoTerminalPath == "default-inherit"){ $ldap= $this->config->get_ldap_link(); /* Strip relevant part from dn, keep trailing ',' */ @@ -363,7 +371,7 @@ class termstartup extends plugin /* Strip out 'default' values */ foreach(array("gotoBootKernel","gotoLdapServer") as $value){ - if (!isset($this->attrs[$value]) || $this->attrs[$value] == "default"){ + if (!isset($this->attrs[$value]) || $this->attrs[$value] == "default-inherit"){ $this->attrs[$value] = array(); } } diff --git a/plugins/admin/systems/terminalStartup.tpl b/plugins/admin/systems/terminalStartup.tpl index e45fa874a..6a5d38f02 100644 --- a/plugins/admin/systems/terminalStartup.tpl +++ b/plugins/admin/systems/terminalStartup.tpl @@ -7,7 +7,7 @@ - {html_options options=$gotoBootKernels selected=$gotoBootKernel}