Commit 5400549c authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor services_unbound_acls.php, add automatically generated...

(legacy) refactor services_unbound_acls.php, add automatically generated acl's. closes https://github.com/opnsense/core/issues/563
parent 55188651
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2011 Warren Baker <warren@decoy.co.za> Copyright (C) 2011 Warren Baker <warren@decoy.co.za>
All rights reserved. All rights reserved.
...@@ -34,319 +34,376 @@ require_once("pfsense-utils.inc"); ...@@ -34,319 +34,376 @@ require_once("pfsense-utils.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
function unbound_acl_id_used($id) {
global $config;
if (isset($config['unbound']['acls'])) if (empty($config['unbound']['acls']) || !is_array($config['unbound']['acls'])) {
foreach($config['unbound']['acls'] as & $acls)
if ($id == $acls['aclid'])
return true;
return false;
}
function unbound_get_next_id() {
$aclid = 0;
while(unbound_acl_id_used($aclid))
$aclid++;
return $aclid;
}
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound_acls.php');
if (empty($config['unbound']['acls']) || !is_array($config['unbound']['acls']))
$config['unbound']['acls'] = array(); $config['unbound']['acls'] = array();
}
$a_acls = &$config['unbound']['acls']; $a_acls = &$config['unbound']['acls'];
$id = $_GET['id'];
if (isset($_POST['aclid']))
$id = $_POST['aclid'];
$act = $_GET['act']; if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($_POST['act'])) if (isset($_GET['id']) && !empty($a_acls[$_GET['id']])) {
$id = $_GET['id'];
}
if (!empty($_GET['act'])) {
$act = $_GET['act'];
} else {
$act = null;
}
$pconfig = array();
$pconfig['aclname'] = isset($id) && !empty($a_acls[$id]['aclname']) ? $a_acls[$id]['aclname'] : "";
$pconfig['aclaction'] = isset($id) && !empty($a_acls[$id]['aclaction']) ? $a_acls[$id]['aclaction'] : "";
$pconfig['description'] = isset($id) && !empty($a_acls[$id]['description']) ? $a_acls[$id]['description'] : "";
$pconfig['row'] = isset($id) && !empty($a_acls[$id]['row']) ? $a_acls[$id]['row'] : array();
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
$input_errors = array();
$pconfig = $_POST;
if (isset($_POST['id']) && !empty($a_acls[$_POST['id']])) {
$id = $_POST['id'];
}
if (!empty($_POST['act'])) {
$act = $_POST['act']; $act = $_POST['act'];
} else {
$act = null;
}
if ($act == "del") { if (!empty($pconfig['apply'])) {
if (!$a_acls[$id]) { services_unbound_configure();
clear_subsystem_dirty('unbound');
header("Location: services_unbound_acls.php"); header("Location: services_unbound_acls.php");
exit; exit;
} } elseif (!empty($act) && $act == "del") {
if (isset($id) && !empty($a_acls[$id])) {
unset($a_acls[$id]); unset($a_acls[$id]);
write_config(); write_config();
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
}
if ($act == "new") {
$id = unbound_get_next_id();
}
$networkacl = array();
if ($act == "edit") {
if (isset($id) && isset($a_acls[$id])) {
$pconfig = $a_acls[$id];
$networkacl = $a_acls[$id]['row'];
} }
} exit;
if ($_POST) {
$input_errors = array();
if ($_POST['apply']) {
$retval = services_unbound_configure();
$savemsg = get_std_save_message();
if ($retval == 0)
clear_subsystem_dirty('unbound');
} else { } else {
$pconfig = $_POST; // transform networks into row items
$pconfig['row'] = array();
// input validation - only allow 50 entries in a single ACL foreach ($pconfig['acl_networks_acl_network'] as $acl_network_idx => $acl_network) {
for($x=0; $x<50; $x++) { if (!empty($acl_network)) {
if (isset($pconfig["acl_network{$x}"])) { $pconfig['row'][] = array('acl_network' => $acl_network,
$networkacl[$x] = array(); 'mask' => $pconfig['acl_networks_mask'][$acl_network_idx],
$networkacl[$x]['acl_network'] = $pconfig["acl_network{$x}"]; 'description' => $pconfig['acl_networks_description'][$acl_network_idx]
$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_ipaddr($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']}.");
} else if (isset($networkacl[$x]))
unset($networkacl[$x]);
} }
if (!isset($input_errors) || count($input_errors) == 0) { // validate form data
if ($pconfig['Submit'] == gettext("Save")) { foreach ($pconfig['row'] as $row) {
if (!is_ipaddr($row['acl_network'])) {
$input_errors[] = gettext("You must enter a valid network IP address for {$row['acl_network']}.");
} elseif (!is_subnet($row['acl_network']."/".$row['mask'])) {
$input_errors[] = gettext("You must enter a valid netmask for {$row['acl_network']}/{$row['mask']}.");
}
}
// save form data
if (count($input_errors) == 0) {
$acl_entry = array(); $acl_entry = array();
$acl_entry['aclid'] = $pconfig['aclid'];
$acl_entry['aclname'] = $pconfig['aclname']; $acl_entry['aclname'] = $pconfig['aclname'];
$acl_entry['aclaction'] = $pconfig['aclaction']; $acl_entry['aclaction'] = $pconfig['aclaction'];
$acl_entry['description'] = $pconfig['description']; $acl_entry['description'] = $pconfig['description'];
$acl_entry['aclid'] = $pconfig['aclid']; $acl_entry['row'] = $pconfig['row'];
$acl_entry['row'] = array();
foreach ($networkacl as $acl)
$acl_entry['row'][] = $acl;
if (isset($id) && $a_acls[$id]) if (isset($id)) {
$a_acls[$id] = $acl_entry; $a_acls[$id] = $acl_entry;
else } else {
$a_acls[] = $acl_entry; $a_acls[] = $acl_entry;
}
mark_subsystem_dirty("unbound"); mark_subsystem_dirty("unbound");
write_config(); write_config();
header("Location: services_unbound_acls.php");
header("Location: /services_unbound_acls.php");
exit; exit;
} }
}
} }
} }
$service_hook = 'unbound'; //
// if ($act == "del") {
// if (!$a_acls[$id]) {
// header("Location: services_unbound_acls.php");
// exit;
// }
//
// unset($a_acls[$id]);
// write_config();
// mark_subsystem_dirty('unbound');
// }
//
// if ($act == "new") {
// $id = unbound_get_next_id();
// }
$service_hook = 'unbound';
legacy_html_escape_form_data($pconfig);
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
<script type="text/javascript" src="/javascript/row_helper.js"></script>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ $( document ).ready(function() {
rowname[0] = "acl_network"; /**
rowtype[0] = "textbox,ipv4v6"; * Aliases
rowsize[0] = "30"; */
function removeRow() {
rowname[1] = "mask"; if ( $('#acl_networks_table > tbody > tr').length == 1 ) {
rowtype[1] = "select,ipv4v6"; $('#acl_networks_table > tbody > tr:last > td > input').each(function(){
rowsize[1] = "1"; $(this).val("");
});
} else {
$(this).parent().parent().remove();
}
}
// add new detail record
$("#addNew").click(function(){
// copy last row and reset values
$('#acl_networks_table > tbody').append('<tr>'+$('#acl_networks_table > tbody > tr:last').html()+'</tr>');
$('#acl_networks_table > tbody > tr:last > td > input').each(function(){
$(this).val("");
});
// link network / cidr
var item_cnt = $('#acl_networks_table > tbody > tr').length;
$('#acl_networks_table > tbody > tr:last > td:eq(1) > input').attr('id', 'acl_network_n'+item_cnt);
$('#acl_networks_table > tbody > tr:last > td:eq(2) > select').data('network-id', 'acl_network_n'+item_cnt);
$(".act-removerow").click(removeRow);
// hookin ipv4/v6 for new item
hook_ipv4v6('ipv4v6net', 'network-id');
});
$(".act-removerow").click(removeRow);
// hook in, ipv4/ipv6 selector events
hook_ipv4v6('ipv4v6net', 'network-id');
// delete ACL action
$(".act_delete_acl").click(function(event){
event.preventDefault();
var id = $(this).data("id");
// delete single
BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("DNS Resolver");?>",
message: "<?=gettext("Do you really want to delete this access list?"); ?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$.post(window.location, {act: 'del', id:id}, function(data) {
location.reload();
});
}
}]
});
});
rowname[2] = "description"; });
rowtype[2] = "textbox";
rowsize[2] = "40";
//]]>
</script> </script>
<?php include("fbegin.inc"); ?>
<?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors);
if (isset($input_errors) && count($input_errors) > 0) if (isset($savemsg)) print_info_box($savemsg);
print_input_errors($input_errors); if (is_subsystem_dirty("unbound")) print_info_box_apply(gettext("The configuration for the DNS Resolver, has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
if (isset($savemsg))
print_info_box($savemsg);
if (is_subsystem_dirty("unbound"))
print_info_box_apply(gettext("The settings for the DNS Resolver have changed. You must apply the configuration to take affect."));
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="services_unbound_acls.php" method="post" name="iform" id="iform"> <form method="post" name="iform" id="iform">
<?php if($act=="new" || $act=="edit"): ?> <?php
<input name="aclid" type="hidden" value="<?=$id;?>" /> if($act=="new" || $act=="edit"): ?>
<input name="id" type="hidden" value="<?=$id;?>" />
<input name="act" type="hidden" value="<?=$act;?>" /> <input name="act" type="hidden" value="<?=$act;?>" />
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<td colspan="2"><?=ucwords(sprintf(gettext("%s Access List"),$act));?></td> <td width="22%"><strong><?=ucwords(sprintf(gettext("%s Access List"),$act));?></strong></td>
<td width="78%" align="right">
<small><?=gettext("full help"); ?> </small>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%"><?=gettext("Access List name");?></td> <td><a id="help_for_aclname" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Access List name");?></td>
<td width="78%"> <td>
<input name="aclname" type="text" class="formfld" id="aclname" size="30" maxlength="30" value="<?=htmlspecialchars($pconfig['aclname']);?>" /> <input name="aclname" type="text" value="<?=$pconfig['aclname'];?>" />
<br /> <div class="hidden" for="help_for_aclname">
<span><?=gettext("Provide an Access List name.");?></span> <?=gettext("Provide an Access List name.");?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%"><?=gettext("Action");?></td> <td><a id="help_for_aclaction" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Action");?></td>
<td width="78%"> <td>
<select name="aclaction" class="selectpicker"> <select name="aclaction" class="selectpicker">
<?php $types = explode(",", "Allow,Deny,Refuse,Allow Snoop"); foreach ($types as $type): ?> <option value="allow" <?= $pconfig['aclaction'] == "allow" ? "selected=\"selected\"" : ""; ?>>
<option value="<?=strtolower($type);?>" <?php if (strtolower($type) == strtolower($pconfig['aclaction'])) echo "selected=\"selected\""; ?>> <?=gettext("Allow");?>
<?=htmlspecialchars($type);?> </option>
<option value="deny" <?= $pconfig['aclaction'] == "deny" ? "selected=\"selected\"" : ""; ?>>
<?=gettext("Deny");?>
</option>
<option value="refuse" <?= $pconfig['aclaction'] == "refuse" ? "selected=\"selected\"" : ""; ?>>
<?=gettext("Refuse");?>
</option>
<option value="allow snoop" <?= $pconfig['aclaction'] == "allow snoop" ? "selected=\"selected\"" : ""; ?>>
<?=gettext("Allow Snoop");?>
</option> </option>
<?php endforeach; ?>
</select> </select>
<br /> <div class="hidden" for="help_for_aclaction">
<span class="text-default">
<?=gettext("Choose what to do with DNS requests that match the criteria specified below.");?> <br /> <?=gettext("Choose what to do with DNS requests that match the criteria specified below.");?> <br />
<?=gettext("Deny: This action stops queries from hosts within the netblock defined below.")?> <br /> <?=gettext("Deny: This action stops queries from hosts within the netblock defined below.")?> <br />
<?=gettext("Refuse: This action also stops queries from hosts within the netblock defined below, but sends a DNS rcode REFUSED error message back to the client.")?> <br /> <?=gettext("Refuse: This action also stops queries from hosts within the netblock defined below, but sends a DNS rcode REFUSED error message back to the client.")?> <br />
<?=gettext("Allow: This action allows queries from hosts within the netblock defined below.")?> <br /> <?=gettext("Allow: This action allows queries from hosts within the netblock defined below.")?> <br />
<?=gettext("Allow Snoop: This action 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.")?> <br /> <?=gettext("Allow Snoop: This action 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.")?> <br />
</span> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%"><?=gettext("Networks");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Networks");?></td>
<td width="78%"> <td>
<table id="maintable" summary="networks" class="table table-striped"> <table class="table table-striped table-condensed" id="acl_networks_table">
<thead>
<tr> <tr>
<td><div id="onecolumn"><?=gettext("Network");?></div></td> <th></th>
<td><div id="twocolumn"><?=gettext("CIDR");?></div></td> <th><?=gettext("Network"); ?></th>
<td><div id="threecolumn"><?=gettext("Description");?></div></td> <th><?=gettext("CIDR"); ?></th>
<td></td> <th><?=gettext("Description");?></th>
</tr> </tr>
<?php $counter = 0; </thead>
if($networkacl) <tbody>
foreach($networkacl as $item): <?php
$network = $item['acl_network']; if (empty($pconfig['row'])) {
$cidr = $item['mask']; $acl_networks = array();
$description = $item['description']; $acl_networks[] = array('acl_network' => null, 'mask' => 32, 'description' => null);
?> } else {
$acl_networks = $pconfig['row'];
}
foreach($acl_networks as $item_idx => $item):?>
<tr> <tr>
<td> <td>
<input name="acl_network<?=$counter;?>" type="text" class="formfld unknown ipv4v6" id="acl_network<?=$counter;?>" size="30" value="<?=htmlspecialchars($network);?>" /> <div style="cursor:pointer;" class="act-removerow btn btn-default btn-xs" alt="remove"><span class="glyphicon glyphicon-minus"></span></div>
</td> </td>
<td> <td>
<select name="mask<?=$counter;?>" class="formselect ipv4v6" id="mask<?=$counter;?>"> <input name="acl_networks_acl_network[]" type="text" id="acl_network_<?=$item_idx;?>" value="<?=$item['acl_network'];?>" />
<?php
for ($i = 128; $i > 0; $i--) {
echo "<option value=\"$i\" ";
if ($i == $cidr) echo "selected=\"selected\"";
echo ">" . $i . "</option>";
}
?>
</select>
</td> </td>
<td> <td>
<input name="description<?=$counter;?>" type="text" class="formfld unknown" id="description<?=$counter;?>" size="40" value="<?=htmlspecialchars($description);?>" /> <select name="acl_networks_mask[]" data-network-id="acl_network_<?=$item_idx;?>" class="ipv4v6net" id="mask<?=$item_idx;?>">
<?php
for ($i = 128; $i > 0; $i--):?>
<option value="<?=$i;?>" <?= $item['mask'] == $i ? "selected=\"selected\"" : ""?>>
<?=$i;?>
</option>
<?php
endfor;?>
</select>
</td> </td>
<td> <td>
<a onclick="removeRow(this); return false;" href="#" class="btn btn-default btn-xs"><span class="fa fa-trash"></span></a> <input name="acl_networks_description[]" type="text" value="<?=$item['description'];?>" />
</td> </td>
</tr> </tr>
<?php $counter++; ?> <?php
<?php endforeach; ?> endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan="4">
<div id="addNew" style="cursor:pointer;" class="btn btn-default btn-xs" alt="add"><span class="glyphicon glyphicon-plus"></span></div>
</td>
</tr>
</tfoot>
</table> </table>
<a onclick="javascript:addRowTo('maintable', 'formfldalias'); return false;" href="#" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-plus"></span>
</a>
<script type="text/javascript">
//<![CDATA[
field_counter_js = 3;
rows = 1;
totalrows = <?php echo $counter; ?>;
loaded = <?php echo $counter; ?>;
//]]>
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top"><?=gettext("Description");?></td> <td><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description");?></td>
<td width="78%"> <td>
<input name="description" type="text" class="formfld unknown" id="description" size="52" maxlength="52" value="<?=htmlspecialchars($pconfig['description']);?>" /> <input name="description" type="text" value="<?=$pconfig['description'];?>" />
<br /> <div class="hidden" for="help_for_description">
<span><?=gettext("You may enter a description here for your reference.");?></span> <?=gettext("You may enter a description here for your reference.");?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%">&nbsp;</td> <td>&nbsp;</td>
<td width="78%"> <td>
&nbsp;<br />&nbsp; &nbsp;<br />&nbsp;
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" /> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound_acls.php');?>'" />
</td> </td>
</tr> </tr>
</table> </table>
</form>
<?php else: ?> <?php
else:?>
<form method="post" name="iform" id="iform">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<td width="25%" class="listhdrr"><?=gettext("Access List Name"); ?></td> <th colspan="4"><?=gettext("From General settings");?></th>
<td width="25%" class="listhdrr"><?=gettext("Action"); ?></td> </tr>
<td width="40%" class="listhdr"><?=gettext("Description"); ?></td> <tr>
<td width="10%" class="list"></td> <th><?=gettext("Access List Name"); ?></th>
<th><?=gettext("Action"); ?></th>
<th><?=gettext("Network"); ?></th>
<th><a href="services_unbound.php" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a></th>
</tr> </tr>
</thead> </thead>
<body>
<tfoot> <?php
// collect networks where automatic rules will be created for
if (!empty($config['unbound']['active_interface'])) {
$active_interfaces = array_flip(explode(",", $config['unbound']['active_interface']));
} else {
$active_interfaces = get_configured_interface_with_descr();
}
$automatic_allowed = array();
foreach($active_interfaces as $ubif => $ifdesc) {
$ifip = get_interface_ip($ubif);
if (!empty($ifip)) {
$subnet_bits = get_interface_subnet($ubif);
$subnet_ip = gen_subnet($ifip, $subnet_bits);
$automatic_allowed[] = "{$subnet_ip}/{$subnet_bits}";
}
$ifip = get_interface_ipv6($ubif);
if (!empty($ifip)) {
$subnet_bits = get_interface_subnetv6($ubif);
$subnet_ip = gen_subnetv6($ifip, $subnet_bits);
$automatic_allowed[] = "{$subnet_ip}/{$subnet_bits}";
}
}
foreach ($automatic_allowed as $network):?>
<tr> <tr>
<td colspan="3"></td> <td><?=gettext("Internal");?></td>
<td> <td><?=gettext("allow");?></td>
<a href="services_unbound_acls.php?act=new" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a> <td><?=$network;?></td>
</td> <td></td>
</tr> </tr>
<?php
endforeach;?>
</tbody>
</table>
</div>
</section>
<section class="col-xs-12">
<div class="tab-content content-box col-xs-12">
<table class="table table-striped">
<thead>
<tr> <tr>
<td colspan="4"> <th><?=gettext("Access List Name"); ?></th>
<p> <th><?=gettext("Action"); ?></th>
<?=gettext("Access Lists to control access to the DNS Resolver can be defined here.");?> <th><?=gettext("Description"); ?></th>
</p> <th></th>
</td>
</tr> </tr>
</tfoot> </thead>
<?php <?php
$i = 0; $i = 0;
foreach($a_acls as $acl): foreach($a_acls as $acl):?>
?> <tr>
<tr ondblclick="document.location='services_unbound_acls.php?act=edit&amp;id=<?=$i;?>'">
<td> <td>
<?=htmlspecialchars($acl['aclname']);?> <?=htmlspecialchars($acl['aclname']);?>
</td> </td>
...@@ -358,22 +415,34 @@ include("head.inc"); ...@@ -358,22 +415,34 @@ include("head.inc");
</td> </td>
<td> <td>
<a href="services_unbound_acls.php?act=edit&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <a href="services_unbound_acls.php?act=edit&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="services_unbound_acls.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this access list?"); ?>')" class="btn btn-default btn-xs"><span class="fa fa-trash text-muted"></span></a> <a href="#" data-id="<?=$i;?>" class="act_delete_acl"><button type="button" class="btn btn-xs btn-default"><span class="fa fa-trash text-muted"></span></button></a>
</td> </td>
</tr> </tr>
<?php <?php
$i++; $i++;
endforeach; endforeach;?>
?> <tfoot>
<tr style="display:none"><td></td></tr> <tr>
<td colspan="3"></td>
<td>
<a href="services_unbound_acls.php?act=new" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a>
</td>
</tr>
<tr>
<td colspan="4">
<p>
<?=gettext("Access Lists to control access to the DNS Resolver can be defined here.");?>
</p>
</td>
</tr>
</tfoot>
</table> </table>
<?php endif; ?> <?php
endif; ?>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment