From: cajus Date: Tue, 7 Oct 2008 16:19:42 +0000 (+0000) Subject: Fixed problem with inherited kernel settings for goto enabled clients X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=182758110e7b70ae707ab22003a2974175a7ae8a;p=gosa.git Fixed problem with inherited kernel settings for goto enabled clients git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12623 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc index e2488e675..acdd4af3c 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc @@ -71,36 +71,6 @@ class termstartup extends plugin $this->orig_dn= $this->dn; - /* Get list of boot kernels */ - if (isset($this->config->data['TABS'])){ - $command= $this->config->search(get_class($this), "systemKernelsHook",array('tabs')); - - if (!check_command($command)){ - $message[]= sprintf(_("Command '%s', specified as systemKernelsHook for plugin '%s' doesn't seem to exist."), $command, - get_class($this)); - } else { - $fh= popen($command, "r"); - while (!feof($fh)) { - $buffer= trim(fgets($fh, 256)); - - if(!empty($buffer)){ - - $name=$value = $buffer; - - if(preg_match("/:/",$buffer)){ - $name = preg_replace("/:.*$/","",$buffer); - $value= preg_replace("/^.*:/","",$buffer); - $this->gotoBootKernels[$name]= $name.":".$value; - }else{ - $this->gotoBootKernels[$name]= $value; - } - } - } - pclose($fh); - } - - } - foreach($this->config->data['SERVERS']['LDAP'] as $server) { $this->gotoLdapServerList[]= $server; } @@ -120,6 +90,8 @@ class termstartup extends plugin if ($ldap->count() == 1){ $map= array("gotoLdapServer","gotoBootKernel"); $attrs= $ldap->fetch(); + $this->member_of_ogroup = TRUE; + $this->o_group_dn = $attrs['dn']; foreach ($map as $name){ if (!isset($attrs[$name][0])){ @@ -129,7 +101,7 @@ class termstartup extends plugin case 'gotoBootKernel': /* Handle inheritance value "default" */ if ($this->member_of_ogroup){ - $this->gotoBootKernels= array("default-inherited" => '['._("inherited").']'); + $this->gotoBootKernels["default-inherited"]= _("inherited")." [".$attrs['gotoBootKernel'][0]."]"; } break; case 'gotoLdapServer': @@ -137,14 +109,42 @@ class termstartup extends plugin break; } } - - $this->member_of_ogroup = TRUE; - $this->o_group_dn = $attrs['dn']; } if(!count($this->gotoLdapServers) && $this->member_of_ogroup){ $this->gotoLdap_inherit = TRUE; } + + /* Get list of boot kernels */ + if (isset($this->config->data['TABS'])){ + $command= $this->config->search(get_class($this), "systemKernelsHook",array('tabs')); + + if (!check_command($command)){ + $message[]= sprintf(_("Command '%s', specified as systemKernelsHook for plugin '%s' doesn't seem to exist."), $command, + get_class($this)); + } else { + $fh= popen($command, "r"); + while (!feof($fh)) { + $buffer= trim(fgets($fh, 256)); + + if(!empty($buffer)){ + + $name=$value = $buffer; + + if(preg_match("/:/",$buffer)){ + $name = preg_replace("/:.*$/","",$buffer); + $value= preg_replace("/^.*:/","",$buffer); + $this->gotoBootKernels[$name]= $name.":".$value; + }else{ + $this->gotoBootKernels[$name]= $value; + } + } + } + pclose($fh); + } + + } + } function execute()