From 7a844c43f3d650aa0a58effa0b57ed715a37a2ec Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 15 Jan 2007 08:16:36 +0000 Subject: [PATCH] Fixed module removement for terminals git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5562 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_terminalStartup.inc | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index c63edb99d..1ec97f962 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -24,7 +24,7 @@ class termstartup extends plugin /* attribute list for save action */ - var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters"); + var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters","gotoModules"); var $objectclasses= array("GOhard"); /* Helper */ @@ -38,13 +38,15 @@ class termstartup extends plugin /* Get arrays */ foreach (array("gotoModules") as $val){ - if (isset($this->attrs["$val"]["count"])){ - for ($i= 0; $i<$this->attrs["count"]; $i++){ - if (isset($this->attrs["$val"][$i])){ - array_push($this->$val, $this->attrs["$val"][$i]); + $tmp =array(); + if (isset($this->attrs[$val]["count"])){ + for ($i= 0; $i<$this->attrs[$val]["count"]; $i++){ + if (isset($this->attrs[$val][$i])){ + $tmp[] = $this->attrs["$val"][$i]; } } } + $this->$val = $tmp; sort ($this->$val); $this->$val= array_unique($this->$val); } @@ -182,7 +184,7 @@ class termstartup extends plugin /* Delete module */ if (isset ($_POST['delete_module'])){ if (count($_POST['modules_list']) && chkacl ($this->acl, "gotoModule") == ""){ - $this->del_list ($this->gotoModules, $_POST['modules_list']); + $this->gotoModules = $this->del_list($this->gotoModules, $_POST['modules_list']); } } @@ -379,8 +381,9 @@ class termstartup extends plugin if (isset ($this->$val) && count ($this->$val) != 0){ $this->attrs["$val"]= array_unique($this->$val); + }else{ + $this->attrs["$val"]=array(); } - if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array(); } /* Strip out 'default' values */ @@ -421,7 +424,7 @@ class termstartup extends plugin /* Delete value to array, check if unique */ - function del_list (&$array, $list) + function del_list ($array, $list) { $tmp= array(); foreach ($array as $mod){ @@ -429,7 +432,7 @@ class termstartup extends plugin $tmp[]= $mod; } } - $array= $tmp; + return($tmp); } /* Generate ListBox frindly output for the defined shares -- 2.30.2