summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-08-28 16:19:05 -0400
committerStephen Beaver <sbeaver@netgate.com>2015-08-28 16:19:05 -0400
commite2fce85bf3a822701bcf825273f28ebaa985f89b (patch)
tree7f1cd4163cbf4f8c0b3318b74b60b93c0124012d /src/usr/local
parent20414bbc651686228a72aed2616b3f83f00284a4 (diff)
downloadpfsense-e2fce85bf3a822701bcf825273f28ebaa985f89b.zip
pfsense-e2fce85bf3a822701bcf825273f28ebaa985f89b.tar.gz
Fixed display issue. Need to also fix config system
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/services_unbound_acls.php71
1 files changed, 22 insertions, 49 deletions
diff --git a/src/usr/local/www/services_unbound_acls.php b/src/usr/local/www/services_unbound_acls.php
index c0ca3b8..94e0b71 100644
--- a/src/usr/local/www/services_unbound_acls.php
+++ b/src/usr/local/www/services_unbound_acls.php
@@ -77,10 +77,13 @@ if ($act == "edit") {
$networkacl = $a_acls[$id]['row'];
}
}
-
+
+if(!is_array($networkacl))
+ $networkacl = array();
+
// Add a row to the networks table
-if($_GET && $_GET['addrow'])
- array_push($networkacl, array('acl_network' => '', 'mask' => '32', 'description' => ''));
+if($act == 'new')
+ $networkacl = array('0' => array('acl_network' => '', 'mask' => '', 'description' => ''));
if ($_POST) {
unset($input_errors);
@@ -221,70 +224,40 @@ if($act=="new" || $act=="edit") {
'Allow: Allow queries from hosts within the netblock defined below.' . '<br />' .
'Allow Snoop: Allow 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.');
+ $section->addInput(new Form_Input(
+ 'descr',
+ 'Description',
+ 'text',
+ $pconfig['descr']
+ ))->setHelp('You may enter a description here for your reference.');
+
$counter = 0;
$numrows = count($networkacl) - 1;
-
+
foreach($networkacl as $item) {
$network = $item['acl_network'];
$cidr = $item['mask'];
$description = $item['description'];
-
- $group = new Form_Group($counter == 0 ? 'Networks':null);
-
+
+ $group = new Form_Group('Networks');
+
$group->add(new Form_IpAddress(
'acl_network' . $counter,
null,
$network
- ))->setHelp(($counter == $numrows) ? 'Network':null);
-
- $group->add(new Form_Select(
- 'mask' . $counter,
- null,
- $cidr,
- array_combine(range(32, 1, -1), range(32, 1, -1))
- ))->setWidth(2)->setHelp(($counter == $numrows) ? 'Mask':null);
-
+ ))->addMask('mask' . $counter, $cidr)->setHelp(($counter == $numrows) ? 'Network':null);
+
$group->add(new Form_Input(
'description' . $counter,
- null,
+ 'something',
'text',
$description
- ))->setWidth(3)->setHelp(($counter == $numrows) ? 'Description':null);
-
- $btndlt = new Form_Button(
- 'dlt' . $counter,
- 'Delete'
- );
-
- $btndlt->removeClass('btn-primary')->addClass('btn-sm btn-danger');
-
- $group->add($btndlt);
+ )); //->setHelp(($counter == $numrows) ? 'Description':null);
+ $group->enableDuplication();
$section->add($group);
-
- $counter++;
}
- $btnadd = new Form_Button(
- 'btnadd',
- 'Add row',
- 'services_unbound_acls.php?act=' . $act . '&addrow=yes'
- );
-
- $btnadd->removeClass(btn-primary)->addClass('btn-sm btn-success');
-
- $section->addInput(new Form_StaticText(
- 'Add row',
- $btnadd
- ))->setHelp('Remember to save after each Add or Delete');
-
- $section->addInput(new Form_Input(
- 'descr',
- 'Description',
- 'text',
- $pconfig['descr']
- ))->setHelp('You may enter a description here for your reference.');
-
$form->add($section);
print($form);
}
OpenPOWER on IntegriCloud