Code

Updated blocklist ACLs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Mar 2010 10:10:26 +0000 (10:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Mar 2010 10:10:26 +0000 (10:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17045 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc
gosa-plugins/gofax/gofax/blocklists/generic.tpl

index 6c6cd0057b740e913c732cac66273335b097bddc..5d6b5ddf7df1e78c93c7fc9096a3177ae1a14abd 100644 (file)
@@ -101,7 +101,10 @@ class blocklistGeneric extends plugin
     /* Handle interactions: add */
     if (isset($_POST['add_number']) && $_POST['number'] != ""){
       if (tests::is_phone_nr($_POST['number']) || preg_match ("/^[\/0-9 ()\^\.\$+*-]+$/",$_POST['number'])){
-        $this->addNumber ($_POST['number']);
+        $acl =  ($this->type == 1) ? "goFaxSBlocklist" : "goFaxRBlocklist";
+        if($this->acl_is_writeabel($acl)){
+          $this->addNumber ($_POST['number']);
+        }
       } else {
         msg_dialog::display(_("Error"), msgPool::invalid(_("Phone number")), ERROR_DIALOG);
       }
@@ -114,7 +117,11 @@ class blocklistGeneric extends plugin
 
     /* Handle interactions: delete */
     if (isset($_POST['delete_number']) && isset($_POST['numbers']) && count($_POST['numbers']) > 0){
-      $this->delNumber ($_POST['numbers']);
+
+      $acl = ($this->type == 1) ? "goFaxSBlocklist" : "goFaxRBlocklist";
+      if($this->acl_is_writeabel($acl)){
+        $this->delNumber ($_POST['numbers']);
+      }
     }
 
 
@@ -131,6 +138,13 @@ class blocklistGeneric extends plugin
     foreach($tmp['plProvidedAcls'] as $name => $translation){
       $smarty->assign($name."ACL",$this->getacl($name));
     }
+    
+    if($this->type == 1){
+      $smarty->assign("goFaxBlocklistACL", $this->getacl('goFaxSBlocklist'));
+    }else{
+      $smarty->assign("goFaxBlocklistACL", $this->getacl('goFaxRBlocklist'));
+    }
+
     $smarty->assign("goFaxBlocklist",$this->goFaxBlocklist);
     $smarty->assign("cnACL",$this->getacl("cn",$this->readonly));
     $smarty->assign("typeACL",$this->getacl("type",$this->readonly));
@@ -369,7 +383,8 @@ class blocklistGeneric extends plugin
             "cn"              => _("Name"),
             "description"     => _("Description"),
             "base"            => _("Base"),
-            "goFaxBlocklist"  => _("Blocklist"),
+            "goFaxSBlocklist"  => _("Send blocklist entries"),
+            "goFaxRBlocklist"  => _("Receive blocklist entries"),
             "type"            => _("Blocklist type"))
           ));
   }
index 9357886e2b9cc8aa08ee649f46c0ac8b662c7444..218d96c8c0ca9fd2a627d10d641866a9d1819687 100644 (file)
@@ -59,6 +59,7 @@
 <table summary="" style="width:100%">
  <tr>
    <td style="width:50%;">
+
      <h3>{t}Blocked numbers{/t}</h3>
 {render acl=$goFaxBlocklistACL}
      <select style="width:100%; height:200px;" name="numbers[]" size=15 multiple>