From 8049cae72f14d9509e3e87b01620f380d2b30888 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Oct 2006 04:25:39 +0000 Subject: [PATCH] Acls for blocklist management git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4929 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_divListBlocklists.inc | 42 +++++++++++++++---- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index bf03065b1..ecf2fdbd1 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -94,6 +94,8 @@ class divListBlocklist extends MultiSelectWindow } } + $ui = get_userinfo(); + $acl = $ui->get_permissions($this->selectedBase,"gofax/blocklist"); /* NEW LIST MANAGMENT */ $listhead = "
". @@ -107,10 +109,14 @@ class divListBlocklist extends MultiSelectWindow title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ". "  "; $listhead .= $this->get_snapshot_header($this->selectedBase); - $listhead .= "  ". - " ". - " "._("Base")." ". + + if(preg_match("/c/",$acl)){ + $listhead .= "  ". + " "; + } + + $listhead .= " "._("Base")." ". "  ". "
"; @@ -137,14 +143,34 @@ class divListBlocklist extends MultiSelectWindow } /* Append to list */ + $ui = get_userinfo(); foreach($list as $key => $val){ - + + $acl = $ui->get_permissions($val['dn'],"gofax/blocklist"); + if(!preg_match("/r/",$acl)){ + continue; + } + + /* Edit link ; requires read access */ $action= ""; - $action.= $this->GetSnapShotActions($val['dn']); - $action.= ""; + + /* Create snapshot ; requires write access && create access */ + if(preg_match("/w/",$acl) && preg_match("/c/",$acl)){ + $action.= $this->GetSnapShotActions($val['dn']); + } + + /* Delete entry ; requires remove access */ + if(preg_match("/d/",$acl)){ + $action.= ""; + } + // Generate Array to Add - $display= "[".$val["cn"][0]."]"; + if(isset($val["description"][0])){ + $display= $val["cn"][0]." [".$val["description"][0]."]"; + }else{ + $display= $val["cn"][0]; + } $field1 = array("string" => sprintf($blockimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"); $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"); -- 2.30.2