All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require("guiconfig.inc"); require("unbound.inc"); if (!is_array($config['installedpackages']['unboundacls']['config'])) $config['installedpackages']['unboundacls']['config'] = array(); $a_acls = &$config['installedpackages']['unboundacls']['config']; $id = $_GET['id']; if (isset($_POST['aclid'])) $id = $_POST['aclid']; $act = $_GET['act']; if (isset($_POST['act'])) $act = $_POST['act']; if ($act == "del") { if (!$a_acls[$id]) { pfSenseHeader("unbound_acls.php"); exit; } unset($a_acls[$id]); write_config(); unbound_reconfigure(); $savemsg = gettext("Access List successfully deleted")."
"; } if ($act == "new") { $id = unbound_get_next_id(); } if ($act == "edit") { if (isset($id) && $a_acls[$id]) { $pconfig = $a_acls[$id]; $networkacl = $a_acls[$id]['row']; } } if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation - only allow 50 entries in a single ACL*/ for($x=0; $x<50; $x++) { if(isset($pconfig["acl_network{$x}"])) { $networkacl[$x] = array(); $networkacl[$x]['acl_network'] = $pconfig["acl_network{$x}"]; $networkacl[$x]['mask'] = $pconfig["mask{$x}"]; $networkacl[$x]['description'] = $pconfig["description{$x}"]; if (!is_ipaddr($networkacl[$x]['acl_network'])) $input_errors[] = gettext("You must enter a valid network IP address for {$networkacl[$x]['acl_network']}."); if (is_ipaddrv4($networkacl[$x]['acl_network'])) { if (!is_subnet($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) $input_errors[] = gettext("You must enter a valid IPv4 netmask for {$networkacl[$x]['acl_network']}/{$networkacl[$x]['mask']}."); } else if (function_exists("is_ipaddrv6")) { if (!is_ipaddrv6($networkacl[$x]['acl_network'])) $input_errors[] = gettext("You must enter a valid IPv6 address for {$networkacl[$x]['acl_network']}."); else if (!is_subnetv6($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) $input_errors[] = gettext("You must enter a valid IPv6 netmask for {$networkacl[$x]['acl_network']}/{$networkacl[$x]['mask']}."); } else $input_errors[] = gettext("You must enter a valid IPv4 address for {$networkacl[$x]['acl_network']}."); } } if (!$input_errors) { if(!$a_acls[$id]) $a_acls[$id]['aclid'] = $id; if (isset($id) && $a_acls[$id]) { $a_acls[$id]['aclid'] = $pconfig['aclid']; $a_acls[$id]['aclname'] = $pconfig['aclname']; $a_acls[$id]['aclaction'] = $pconfig['aclaction']; $a_acls[$id]['description'] = $pconfig['description']; $a_acls[$id]['row'] = array(); foreach ($networkacl as $acl) $a_acls[$id]['row'][] = $acl; write_config(); unbound_reconfigure(); } header("Location: unbound_acls.php"); exit; } } $pgtitle = "Services: Unbound DNS Forwarder: Access Lists"; include("head.inc"); ?>



Deny: This actions stops queries from hosts within the netblock defined below.");?>
Refuse: This actions also stops queries from hosts within the netblock defined below, but sends back DNS rcode REFUSED error message back tot eh client.");?>
Allow: This actions allows queries from hosts within the netblock defined below.");?>
Allow Snoop: This actions allows recursive and nonrecursive access from hosts within the netblock defined below. Used for cache snooping and ideally should only be configured for your administrative host.");?>
" />

 
   
  "> " onclick="history.back()">
" width="17" height="17" border="0">   ')"> " width="17" height="17" border="0">
" width="17" height="17" border="0">

?>