Code

Fixed fax report / blocklist acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Dec 2006 10:42:10 +0000 (10:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Dec 2006 10:42:10 +0000 (10:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5305 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofax/blocklists/generic.tpl
plugins/gofax/faxreports/class_faxreport.inc

index c5b08286bb9a660da5f8f7155157428fb24fe4a8..5c81d030ad0de3e8943dd0e89345b4afbab98acb 100644 (file)
@@ -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"),
index ecf2fdbd107d74ffceeb87ed2b7a7f4baebc0aee..3ff00fa8aa2508b73f21a3ad388179222db1cbf2 100755 (executable)
@@ -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.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
@@ -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 = "<div style='background:#F0F0F9;padding:5px;'>".
@@ -108,14 +107,20 @@ class divListBlocklist extends MultiSelectWindow
       " <input class='center' type='image' src='images/list_reload.png' align='middle' 
           title='"._("Reload list")."' name='submit_department' alt='".      _("Submit")."'>&nbsp;".
           " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    $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 .= " <input class='center' type='image' align='middle' src='images/list_new_blocklist.png' ".
         "  title='"._("Create new blocklist")."' alt='"._("New Blocklist")."' name='user_new'>&nbsp;".
         " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>";
     }
   
+    /* Append department selector */
     $listhead .= "&nbsp;"._("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
       " <input class='center' type='image' src='images/list_submit.png' align='middle' 
           title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
@@ -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;
       }  
index 7c3f1158abdd3c4731aa17cb86e62534d78ed3a3..888339abe55150849e4d9e002084994ad7a8aa71 100644 (file)
 {/render}
      <br>
 {render acl=$goFaxBlocklistACL}
-     <input id="number" name="number" size=25 maxlength=60 {$goFaxBlocklistACL}>&nbsp;
+     <input id="number" name="number" size=25 maxlength=60 >&nbsp;
 {/render}
 {render acl=$goFaxBlocklistACL}
-     <input type=submit value="{t}Add{/t}" {$goFaxBlocklistACL} name="add_number">&nbsp;
+     <input type=submit value="{t}Add{/t}" name="add_number">&nbsp;
 {/render}
 {render acl=$goFaxBlocklistACL}
-     <input type=submit value="{t}Delete{/t}" {$goFaxBlocklistACL} name="delete_number">
+     <input type=submit value="{t}Delete{/t}" name="delete_number">
 {/render}
    </td>
   <td style="border-left:1px solid #A0A0A0">
index bed39e0caee5c4b3a6e02449e6121d1f4a7bf4bb..4b892b5d5fcb5507a2da161115eedcde7e761d80 100644 (file)
@@ -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(