From 984f5985428bba4ec9212f3051ceace3985dd207 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 11 Aug 2006 06:38:44 +0000 Subject: [PATCH] Removed inherit from boot kernel options, if this object isn't member in an objectGroup git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4478 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_terminalStartup.inc | 12 ++++++++---- plugins/admin/systems/class_workstationStartup.inc | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index fab6d1d1a..c7bafb9c2 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= "default-inherit"; + var $gotoBootKernel= ""; var $gotoKernelParameters= ""; var $gotoLdapServer= ""; var $gotoModules= array(); @@ -36,8 +36,6 @@ class termstartup extends plugin { plugin::plugin ($config, $dn); - $this->gotoBootKernels = array("default-inherit"=>"["._("inherited")."]"); - /* Get arrays */ foreach (array("gotoModules") as $val){ if (isset($this->attrs["$val"]["count"])){ @@ -108,6 +106,9 @@ class termstartup extends plugin }else{ $this->gotoBootKernels[$name]= $value; } + if(empty($this->gotoBootKernel)){ + $this->gotoBootKernel = $name; + } } } pclose($fh); @@ -128,7 +129,7 @@ class termstartup extends plugin $ldap->cd($this->config->current['BASE']); $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))"); if ($ldap->count() == 1){ - $map= array("gotoLdapServer"); + $map= array("gotoLdapServer","gotoBootKernel"); $attrs= $ldap->fetch(); foreach ($map as $name){ @@ -140,6 +141,9 @@ class termstartup extends plugin case 'gotoLdapServer': $this->goLdapServerList= array_merge(array('default-inherit' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList); break; + case 'gotoBootKernel': + $this->gotoBootKernels= array_merge(array('default-inherit' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList); + break; } } } diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index b9b5d1ec9..9c9087eb8 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -9,7 +9,7 @@ class workstartup extends plugin /* Generic terminal attributes */ var $bootmode = "G"; var $goLdapServerList = array(); - var $gotoBootKernel = "default-inherited"; + var $gotoBootKernel = ""; var $gotoKernelParameters = ""; var $gotoLdapServer = "default-inherited"; var $gotoModules = array(); @@ -269,7 +269,7 @@ class workstartup extends plugin $this->orig_dn= $this->dn; /* Handle inheritance value "default" */ - $this->gotoBootKernels= array("default-inherited" => '['._("inherited").']'); + $this->gotoBootKernels= array(); /* Load hardware list */ @@ -316,6 +316,7 @@ class workstartup extends plugin get_class($this)); } else { + $first = false; $fh= popen($command, "r"); while (!feof($fh)) { $buffer= trim(fgets($fh, 256)); @@ -323,7 +324,6 @@ class workstartup extends plugin if(!empty($buffer)){ $name=$value = $buffer; - if(preg_match("/:/",$buffer)){ $name = preg_replace("/:.*$/","",$buffer); $value= preg_replace("/^.*:/","",$buffer); @@ -331,6 +331,10 @@ class workstartup extends plugin }else{ $this->gotoBootKernels[$name]= $value; } + if($this->gotoBootKernel =="" ){ + $this->gotoBootKernel = $name; + } + } } pclose($fh); -- 2.30.2