From 08f7a2325bc930bd5c65c92c19cbb036b710e9a4 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Sep 2008 09:29:58 +0000 Subject: [PATCH] Updated ACL checks for server/serverService git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12495 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_divListSystem.inc | 2 +- .../systems/class_divListSystemService.inc | 17 ++++++++--------- .../admin/systems/class_serverService.inc | 8 +++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_divListSystem.inc b/gosa-plugins/systems/admin/systems/class_divListSystem.inc index 26dd857b6..0251feb55 100644 --- a/gosa-plugins/systems/admin/systems/class_divListSystem.inc +++ b/gosa-plugins/systems/admin/systems/class_divListSystem.inc @@ -183,7 +183,7 @@ class divListSystem extends MultiSelectWindow $s.= "...|". " "._("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.= "...|". " "._("Server")."|"."newsystem_server|\n"; } diff --git a/gosa-plugins/systems/admin/systems/class_divListSystemService.inc b/gosa-plugins/systems/admin/systems/class_divListSystemService.inc index 77e592603..140e728e0 100644 --- a/gosa-plugins/systems/admin/systems/class_divListSystemService.inc +++ b/gosa-plugins/systems/admin/systems/class_divListSystemService.inc @@ -102,16 +102,15 @@ class divListSystemService extends MultiSelectWindow default: $str= "".$entry["; } - /* 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 = "".$entry['Message'].""; + + if($entry['AllowEdit']){ + $link = "".$entry['Message'].""; + }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 .= " "; }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 .= " "; }else{ diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc index bf6113792..4bd58ed18 100644 --- a/gosa-plugins/systems/admin/systems/class_serverService.inc +++ b/gosa-plugins/systems/admin/systems/class_serverService.inc @@ -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; + } } -- 2.30.2