From 6a37d263f2c076be5f9c96e4fb7cc417d33c1740 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Dec 2006 10:42:10 +0000 Subject: [PATCH] Fixed fax report / blocklist acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5305 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_blocklistManagement.inc | 12 ++++----- .../blocklists/class_divListBlocklists.inc | 25 +++++++++++-------- plugins/gofax/blocklists/generic.tpl | 6 ++--- plugins/gofax/faxreports/class_faxreport.inc | 9 ++++--- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index c5b08286b..5c81d030a 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -255,7 +255,7 @@ class blocklist extends plugin $dn = "cn=dummy,ou=gofax,ou=systems,".$this->base; } - $this->set_acl_category("gofax"); + $this->set_acl_category("gofaxlist"); $this->set_acl_base($dn); @@ -397,11 +397,11 @@ class blocklist extends plugin /* Create filter */ if ($ShowSendBocklists){ $filter = "(&(objectClass=goFaxSBlock)(|(cn=".$Regex.")(goFaxSBlocklist=".$Regex.")))"; - $res= get_list($filter, "gofax", $base,array("*"), $Flags); + $res= get_list($filter, "gofaxlist", $base,array("*"), $Flags); } if ($ShowReceiveBlocklists){ $filter2= "(&(objectClass=goFaxRBlock)(|(cn=".$Regex.")(goFaxRBlocklist=".$Regex.")))"; - $res2= get_list($filter2, "gofax", $base,array("*"), $Flags); + $res2= get_list($filter2, "gofaxlist", $base,array("*"), $Flags); } $this->blocklists = array_merge($res,$res2); @@ -410,7 +410,7 @@ class blocklist extends plugin $tmp=array(); foreach($this->blocklists as $tkey => $val ){ - $acl = $this->ui ->get_permissions($base,"gofax/blocklist"); + $acl = $this->ui ->get_permissions($base,"gofaxlist/blocklist"); if(preg_match("/r/",$acl)){ $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; } @@ -579,13 +579,13 @@ class blocklist extends plugin { return (array( "plShortName" => _("Fax"), - "plDescription" => _("Fax Blocklists"), + "plDescription" => _("Fax blocklists"), "plSelfModify" => FALSE, "plDepends" => array(), "plPriority" => 0, "plSection" => array("administration" => _("FAX Blocklists")), - "plCategory" => array("gofax" => array("description" => _("Fax"), + "plCategory" => array("gofaxlist" => array("description" => _("Fax blocklists"), "objectClass" => array("goFaxRBlock","goFaxSBlock"))), "plProvidedAcls" => array( "cn" => _("Name"), diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index ecf2fdbd1..3ff00fa8a 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -22,7 +22,7 @@ class divListBlocklist extends MultiSelectWindow function divListBlocklist ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config, "Blocklists", "gofax"); + MultiSelectWindow::MultiSelectWindow($config, "Blocklists", "gofaxlist"); $this->parent = $parent; $this->ui = get_userinfo(); @@ -63,6 +63,7 @@ class divListBlocklist extends MultiSelectWindow $this->AddRegex ("Regex", _("Regular expression for matching list names"),"*" , true); } + function GenHeader() { /* Prepare departments, @@ -72,19 +73,15 @@ class divListBlocklist extends MultiSelectWindow /* Get all departments within this subtree */ $base = $this->config->current['BASE']; - $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); /* Load possible departments */ $ui= get_userinfo(); - $tdeps= $ui->get_module_departments("gofax"); - + $tdeps= $ui->get_module_departments("gofaxlist"); $ids = $this->config->idepartments; - foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ - $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; @@ -94,8 +91,10 @@ class divListBlocklist extends MultiSelectWindow } } - $ui = get_userinfo(); - $acl = $ui->get_permissions($this->selectedBase,"gofax/blocklist"); + /* Get acls */ + $ui = get_userinfo(); + $acl = $ui->get_permissions($this->selectedBase,"gofaxlist/blocklist"); + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"gofaxlist"); /* NEW LIST MANAGMENT */ $listhead = "
". @@ -108,14 +107,20 @@ class divListBlocklist extends MultiSelectWindow "  ". "  "; - $listhead .= $this->get_snapshot_header($this->selectedBase); + /* Add snaphot icons, if allowed */ + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $listhead .= $this->get_snapshot_header($this->selectedBase); + } + + /* Add create icon if allowed */ if(preg_match("/c/",$acl)){ $listhead .= "  ". " "; } + /* Append department selector */ $listhead .= " "._("Base")." ". "  ". @@ -146,7 +151,7 @@ class divListBlocklist extends MultiSelectWindow $ui = get_userinfo(); foreach($list as $key => $val){ - $acl = $ui->get_permissions($val['dn'],"gofax/blocklist"); + $acl = $ui->get_permissions($val['dn'],"gofaxlist/blocklist"); if(!preg_match("/r/",$acl)){ continue; } diff --git a/plugins/gofax/blocklists/generic.tpl b/plugins/gofax/blocklists/generic.tpl index 7c3f1158a..888339abe 100644 --- a/plugins/gofax/blocklists/generic.tpl +++ b/plugins/gofax/blocklists/generic.tpl @@ -74,13 +74,13 @@ {/render}
{render acl=$goFaxBlocklistACL} -   +   {/render} {render acl=$goFaxBlocklistACL} -   +   {/render} {render acl=$goFaxBlocklistACL} - + {/render} diff --git a/plugins/gofax/faxreports/class_faxreport.inc b/plugins/gofax/faxreports/class_faxreport.inc index bed39e0ca..4b892b5d5 100644 --- a/plugins/gofax/faxreports/class_faxreport.inc +++ b/plugins/gofax/faxreports/class_faxreport.inc @@ -164,7 +164,7 @@ class faxreport extends plugin $fax_uids = array_flip($this->fax_users); $uid = $line['uid']; $dn = $fax_uids[$uid]; - $acls = $this->ui->get_permissions($dn,"gofax/faxreport"); + $acls = $this->ui->get_permissions($dn,"faxreport/faxreport"); if(!preg_match("/r/",$acls)){ print_red (_("You have no permission to retrieve informations about this fax id!")); return($smarty->fetch(get_template_path('contents.tpl', TRUE))); @@ -177,7 +177,7 @@ class faxreport extends plugin $final="fax_$vname"; if($vname != "uid"){ - $v_acl = $this->ui->get_permissions($dn,"gofax/faxreport",preg_replace("/_/","",$vname)); + $v_acl = $this->ui->get_permissions($dn,"faxreport/faxreport",preg_replace("/_/","",$vname)); }else{ $v_acl = "r"; } @@ -298,7 +298,7 @@ class faxreport extends plugin /* Hide restricted attributes */ foreach(array("pages","receiverid","senderid","status","queuingtime","detailedView") as $attr){ $var = $attr."ACL"; - $$var = $this->ui->get_permissions($dn,"gofax/faxreport",$attr); + $$var = $this->ui->get_permissions($dn,"faxreport/faxreport",$attr); } /* Restricted attributes will not be displayed, this will be displayed instead */ @@ -473,7 +473,8 @@ class faxreport extends plugin "plDepends" => array(), "plPriority" => 1, // Position in tabs "plSection" => array("administration"), // This belongs to personal - "plCategory" => array("gofax"), + "plCategory" => array("faxreport" => array("description" => _("Fax reports"), + "objectClass" => array())), "plOptions" => array(), "plProvidedAcls" => array( -- 2.30.2