From a9b6f4a2075def82ed7230ae89e6a7cd02a837c0 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 24 Mar 2010 10:10:26 +0000 Subject: [PATCH] Updated blocklist ACLs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17045 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_blocklistGeneric.inc | 21 ++++++++++++++++--- .../gofax/gofax/blocklists/generic.tpl | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc index 6c6cd0057..5d6b5ddf7 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc @@ -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")) )); } diff --git a/gosa-plugins/gofax/gofax/blocklists/generic.tpl b/gosa-plugins/gofax/gofax/blocklists/generic.tpl index 9357886e2..218d96c8c 100644 --- a/gosa-plugins/gofax/gofax/blocklists/generic.tpl +++ b/gosa-plugins/gofax/gofax/blocklists/generic.tpl @@ -59,6 +59,7 @@
+

{t}Blocked numbers{/t}

{render acl=$goFaxBlocklistACL}