Code

Updated class sudo
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 15:00:51 +0000 (15:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 15:00:51 +0000 (15:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16710 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc

index 8cd30842ae43c948d23fa6a9bf8666371af38474..79454223966f1c28b3865a75e16716e5fc03e813 100644 (file)
@@ -277,7 +277,7 @@ class sudo extends plugin
     foreach($_POST as $name => $value){
       if(preg_match("/^neg_/",$name)){
         $attr = preg_replace("/^neg_([^_]*)_.*$/","\\1",$name);
-        $value= preg_replace("/^neg_[^_]*_([0-9]*)_.*$/","\\1",$name);
+        $value= preg_replace("/^neg_[^_]*_([0-9]*)$/","\\1",$name);
  
         if($this->acl_is_writeable($attr)){
           $attrs = $this->$attr;
@@ -300,8 +300,8 @@ class sudo extends plugin
      *********************/ 
     foreach($_POST as $name => $value){
       if(preg_match("/^del_/",$name)){
-        $attr = preg_replace("/^del_([^_]*)_.*$/","\\1",$name);
-        $value= preg_replace("/^del_[^_]*_([0-9]*)_.*$/","\\1",$name);
+        $attr = preg_replace("/^del_([^_]*).*$/","\\1",$name);
+        $value= preg_replace("/^del_[^_]*_([0-9]*)$/","\\1",$name);
         if($this->acl_is_writeable($attr)){
           $attrs = $this->$attr;
           if(isset( $attrs[$value])){
@@ -395,9 +395,9 @@ class sudo extends plugin
 
     /* Fill divlists
      */
-    $neg_img= "<img src='plugins/sudo/images/negate.png' alt='!' class='center'>"; 
-    $option = "<input type='image' src='plugins/sudo/images/negate.png'     name='neg_%ATTR%_%KEY%' class='center'>"; 
-    $option.= "<input type='image' src='images/lists/trash.png'  name='del_%ATTR%_%KEY%' class='center'>"; 
+    $neg_img= image('plugins/sudo/images/negate.png','','!');
+    $option = image('plugins/sudo/images/negate.png','neg_%ATTR%_%KEY%');
+    $option.= image('images/lists/trash.png', 'del_%ATTR%_%KEY%');
     foreach(array("sudoCommand","sudoHost","sudoRunAs") as $attr){
       if($this->acl_is_readable($attr)){
         foreach($this->$attr as $key => $entry){
@@ -418,8 +418,8 @@ class sudo extends plugin
     }
 
     foreach(array("sudoUser") as $attr){
-      $img1 = "<img src='plugins/users/images/select_user.png'   alt='"._("User")."' class='center'>";
-      $img2 = "<img src='plugins/groups/images/select_group.png' alt='"._("Group")."' class='center'>";
+      $img1 = image('plugins/users/images/select_user.png','',_("User"));
+      $img2 = image('plugins/groups/images/select_group.png','',_("Group"));
       if($this->acl_is_readable($attr)){
         foreach($this->$attr as $key => $entry){
           $neg = "";