From a1c81837c76e0bb958b88fa52d05fc674c47539a Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Apr 2008 07:47:09 +0000 Subject: [PATCH] Updated sudo -Fixed save & load of sudo options git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10269 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc | 5 +++-- gosa-plugins/sudo/admin/sudo/class_sudoOption.inc | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 02d83b68a..0544cf64d 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -392,8 +392,8 @@ class sudo extends plugin } foreach(array("sudoUser") as $attr){ - $img1 = ""._("User").""; - $img2 = ""._("Group").""; + $img1 = ""._("User").""; + $img2 = ""._("Group").""; if($this->acl_is_readable($attr)){ foreach($this->$attr as $key => $entry){ $neg = ""; @@ -519,6 +519,7 @@ class sudo extends plugin $this->attrs['sudoRunAs'] = array_values($this->attrs['sudoRunAs']); $this->attrs['sudoUser'] = array_values($this->attrs['sudoUser']); $this->attrs['sudoCommand'] = array_values($this->attrs['sudoCommand']); + $this->cleanup(); $ldap = $this->config->get_ldap_link(); diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc index 6b12f8130..a798d2ea9 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc @@ -173,9 +173,7 @@ class sudoOption extends plugin } /* Append values */ - if(!isset($this->sudoOption[$opt])){ - $this->sudoOption[$opt][] = $option; - } + $this->sudoOption[$opt][] = $option; } } } @@ -371,7 +369,7 @@ class sudoOption extends plugin Save LISTS ****/ if($type=="LISTS"){ - if(empty($value)){ + if($value == ""){ $option = $name; }else{ $option = $name."=".$value; @@ -395,7 +393,7 @@ class sudoOption extends plugin Save STRING / INTEGER ****/ if(in_array($type,array("STRING","INTEGER"))){ - if(!empty($value)){ + if($value != ""){ $option = $name."=".$value; }else{ $option = $name; @@ -414,7 +412,7 @@ class sudoOption extends plugin }elseif($value == "TRUE"){ $option = $name; }else{ - if(!empty($value)){ + if($value != ""){ $option = $name."=".$value; }else{ $option = $name; -- 2.30.2