From c28928f1e81a2d5c22ef79e988fcfc2b1914eaf3 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 21 Sep 2007 12:53:07 +0000 Subject: [PATCH] Replaced search_config with config->search git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7373 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_goService.inc | 4 ++-- plugins/admin/systems/class_servGeneric.inc | 5 +++-- plugins/admin/systems/class_servRepository.inc | 2 +- plugins/admin/systems/class_servRepositorySetup.inc | 2 +- plugins/admin/systems/class_systemManagement.inc | 5 +++-- plugins/admin/systems/class_terminalGeneric.inc | 9 +++++---- plugins/admin/systems/class_terminalStartup.inc | 2 +- plugins/admin/systems/class_workstationGeneric.inc | 4 ++-- plugins/admin/systems/class_workstationStartup.inc | 6 +++--- 9 files changed, 21 insertions(+), 18 deletions(-) diff --git a/plugins/admin/systems/class_goService.inc b/plugins/admin/systems/class_goService.inc index 63b8850dc..afbbf3001 100644 --- a/plugins/admin/systems/class_goService.inc +++ b/plugins/admin/systems/class_goService.inc @@ -178,9 +178,9 @@ class goService extends plugin{ function action_hook($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "ACTION_HOOK"); + $command= $this->config->search(get_class($this), "ACTION_HOOK",array('menu')); if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "ACTION_HOOK"); + $command= $this->config->search(get_class($this), "ACTION_HOOK",array('tabs')); } if ($command != ""){ diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index d74fb92cd..54df43945 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -43,7 +43,8 @@ class servgeneric extends plugin function servgeneric (&$config, $dn= NULL, $parent= NULL) { /* Check if FAI is activated */ - $tmp = search_config($config->data,"faiManagement","CLASS"); + $tmp = $config->search("faiManagement", "CLASS",array('tabs')); + if(!empty($tmp)){ $this->fai_activated = TRUE; } @@ -104,7 +105,7 @@ class servgeneric extends plugin /* Check for action */ if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate")){ - $cmd= search_config($this->config->data['TABS'], "workgeneric", "ACTIONCMD"); + $cmd = $this->config->search("workgeneric", "ACTIONCMD",array('tabs')); if ($cmd == ""){ print_red(_("No ACTIONCMD definition found in your gosa.conf")); } else { diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index c7fea3871..ce5aeb07d 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -33,7 +33,7 @@ class servrepository extends goService plugin::plugin ($config, $dn, $parent); /* Skip this if fai is deactivated */ - $tmp = search_config($this->config->data,"faiManagement","CLASS"); + $tmp= $this->config->search("faiManagement", "CLASS"); if(!empty($tmp)){ $this->fai_activated = TRUE; }else{ diff --git a/plugins/admin/systems/class_servRepositorySetup.inc b/plugins/admin/systems/class_servRepositorySetup.inc index e8c512746..40f37b062 100644 --- a/plugins/admin/systems/class_servRepositorySetup.inc +++ b/plugins/admin/systems/class_servRepositorySetup.inc @@ -193,7 +193,7 @@ class servRepositorySetup extends plugin function GetHookElements() { $ret = array(); - $cmd= search_config($this->config->data['TABS'], "servrepository", "REPOSITORY_HOOK"); + $cmd = $this->config->search("servrepository", "REPOSITORY_HOOK",array('tabs')); if(!empty($cmd)){ $res = shell_exec($cmd); $res2 = trim($res); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index ade28ad56..8c4c5c3cc 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -175,7 +175,8 @@ class systems extends plugin $dsc = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w")); /* Get and check command */ - $command= search_config($this->config->data['TABS'], "workgeneric", "ISOCMD"); + $command= $this->config->search("workgeneric", "ISOCMD",array('tabs')); + if (check_command($command)){ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute"); @@ -956,7 +957,7 @@ class systems extends plugin $sys_categories = array("terminal", "workstation", "server", "phone" ,"printer"); /* Add FAIstate to attributes if FAI is activated */ - $tmp = search_config($this->config->data,"faiManagement","CLASS"); + $tmp = $this->config->search("faiManagement", "CLASS"); if(!empty($tmp)){ $sys_attrs[] = "FAIstate"; } diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 6b7d04b4f..e0f05f862 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -63,7 +63,7 @@ class termgeneric extends plugin function termgeneric (&$config, $dn= NULL, $parent= NULL) { /* Check if FAI is activated */ - $tmp = search_config($config->data,"faiManagement","CLASS"); + $tmp= $config->search("faiManagement", "CLASS"); if(!empty($tmp)){ $this->fai_activated = TRUE; } @@ -204,7 +204,8 @@ class termgeneric extends plugin switch($_POST['saction']){ case 'wake': - $cmd= search_config($this->config->data['TABS'], "termgeneric", "WAKECMD"); + $cmd= $this->config->search("termgeneric", "WAKECMD",array('tabs')); + if ($cmd == ""){ print_red(_("No WAKECMD definition found in your gosa.conf")); } else { @@ -216,7 +217,7 @@ class termgeneric extends plugin break; case 'reboot': - $cmd= search_config($this->config->data['TABS'], "termgeneric", "REBOOTCMD"); + $cmd= $this->config->search("termgeneric", "REBOOTCMD",array('tabs')); if ($cmd == ""){ print_red(_("No REBOOTCMD definition found in your gosa.conf")); } else { @@ -228,7 +229,7 @@ class termgeneric extends plugin break; case 'halt': - $cmd= search_config($this->config->data['TABS'], "termgeneric", "HALTCMD"); + $cmd= $this->config->search("termgeneric", "HALTCMD",array('tabs')); if ($cmd == ""){ print_red(_("No HALTCMD definition found in your gosa.conf")); } else { diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 8bab797f4..9a138f218 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -89,7 +89,7 @@ class termstartup extends plugin /* Get list of boot kernels */ if (isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS"); + $command= $this->config->search(get_class($this), "KERNELS",array('tabs')); if (!check_command($command)){ $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command, diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 734a84598..ae31c93c0 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -68,7 +68,7 @@ class workgeneric extends plugin function workgeneric (&$config, $dn= NULL, $parent= NULL) { - $tmp = search_config($config->data,"faiManagement","CLASS"); + $tmp= $config->search("faiManagement", "CLASS"); if(!empty($tmp)){ $this->fai_activated = TRUE; } @@ -181,7 +181,7 @@ class workgeneric extends plugin } if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate"))){ - $cmd= search_config($this->config->data['TABS'], "workgeneric", "ACTIONCMD"); + $cmd= $this->config->search("workgeneric", "ACTIONCMD",array('tabs')); if ($cmd == ""){ print_red(_("No ACTIONCMD definition found in your gosa.conf")); } else { diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 06eb66380..3f6c1c1c7 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -61,7 +61,7 @@ class workstartup extends plugin function workstartup (&$config, $dn= NULL, $parent= NULL) { /* Check if FAI is active */ - $tmp = search_config($config->data,"faiManagement","CLASS"); + $tmp= $config->search("faiManagement", "CLASS"); if(!empty($tmp)){ $this->fai_activated = TRUE; }else{ @@ -341,7 +341,7 @@ class workstartup extends plugin /* Get list of boot kernels */ if (isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS"); + $command= $this->config->search(get_class($this), "KERNELS",array('tabs')); if (!check_command($command)){ $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command, @@ -1151,7 +1151,7 @@ class workstartup extends plugin function GetHookElements() { $ret = array(); - $cmd= search_config($this->config->data['TABS'], "servrepository", "REPOSITORY_HOOK"); + $cmd= $this->config->search("servrepository", "REPOSITORY_HOOK",array('tabs')); if(!empty($cmd)){ $res = shell_exec($cmd); $res2 = trim($res); -- 2.30.2