Code

Updated ACL checks for server/serverService
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Sep 2008 09:29:58 +0000 (09:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Sep 2008 09:29:58 +0000 (09:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12495 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_divListSystem.inc
gosa-plugins/systems/admin/systems/class_divListSystemService.inc
gosa-plugins/systems/admin/systems/class_serverService.inc

index 26dd857b6bc3905c2ca150c8f0f4285ea74def26..0251feb5559954f29493ced66affae7cfa16600f 100644 (file)
@@ -183,7 +183,7 @@ class divListSystem extends MultiSelectWindow
       $s.= "...|<img src='plugins/systems/images/select_workstation.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Workstation")."|"."newsystem_workstation|\n";
     }
-    if(class_available("servtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/servgeneric"))){
+    if(class_available("servtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){
       $s.= "...|<img src='plugins/systems/images/select_server.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Server")."|"."newsystem_server|\n";
     }
index 77e592603321a2076880cf508f492a2a9c8b3794..140e728e02ca9e501668727712f24ff5354571e4 100644 (file)
@@ -102,16 +102,15 @@ class divListSystemService extends MultiSelectWindow
         default: $str= "<img src='plugins/users/images/select_user.png' alt='".$entry['Status']."' title='"._("User status")." : ".$entry['Status']."'>";
       }
 
-      /* Get acls */
-      $acl = $ui->get_permissions($this->parent->dn,"server/".$name);
-      if(preg_match("/w/i",$acl) && !preg_match("/r/i",$acl)){
-        continue;
-      }
-  
       $WasAccount = $this->parent->plugins[$name] -> initially_was_account;    
   
       $plug = $_GET['plug'];
-      $link = "<a href='?plug=".$plug."&amp;act=open&amp;id=".$name."'>".$entry['Message']."</a>";
+
+      if($entry['AllowEdit']){
+        $link = "<a href='?plug=".$plug."&amp;act=open&amp;id=".$name."'>".$entry['Message']."</a>";
+      }else{
+        $link = $entry['Message'];
+      }
 
       $field1 = array("string" => $str ,"attach" => "style='width:20px;'");
       $field2 = array("string" => $link);
@@ -137,7 +136,7 @@ class divListSystemService extends MultiSelectWindow
       }
 
       /* Check if edit is enabled and allowed for current service */
-      if($entry['AllowEdit'] && preg_match("/(r|w)/i",$acl)){
+      if($entry['AllowEdit']){
         $actions .= "&nbsp;<input type='image' name='EditSingleService_".$name."' src='images/lists/edit.png'
                             title='"._("Edit service")."'>";
       }else{
@@ -145,7 +144,7 @@ class divListSystemService extends MultiSelectWindow
       }
 
       /* Check if remove is enabled and allowed for current service */
-      if($entry['AllowRemove'] && preg_match("/d/i",$acl)){
+      if($entry['AllowRemove']){
         $actions .= "&nbsp;<input type='image' name='RemoveSingleService_".$name."' src='images/lists/trash.png'
                             title='"._("Remove service")."'>";
       }else{
index bf6113792aecb7e76405f3e7c952b8847e830127..4bd58ed1894d29ca7ff73227e0b95b6f0595615e 100644 (file)
@@ -192,9 +192,11 @@ class ServerService extends plugin
     /* Edit a service and make a backup from all attributes, 
        to be able to restore old values after aborting dialog */ 
     if($s_action == "EditSingleService"){
-      $this->backup   = get_object_vars($this->plugins[$s_entry]);
-      $this->dialog   = $this->plugins[$s_entry];
-      $this->current  = $s_entry;
+      if($this->plugins[$s_entry]->acl_is_readable("")){
+        $this->backup   = get_object_vars($this->plugins[$s_entry]);
+        $this->dialog   = $this->plugins[$s_entry];
+        $this->current  = $s_entry;
+      }
     }