Commit e78874a7 authored by Franco Fichtner's avatar Franco Fichtner

firewall: apply whitespace cleanups

parent 30ed9e9f
...@@ -161,28 +161,28 @@ include("head.inc"); ...@@ -161,28 +161,28 @@ include("head.inc");
$main_buttons = array( $main_buttons = array(
array('href'=>'firewall_aliases_edit.php?tab='.$tab, 'label'=>gettext("Add a new alias")), array('href'=>'firewall_aliases_edit.php?tab='.$tab, 'label'=>gettext("Add a new alias")),
array('href'=>'firewall_aliases_import.php', 'label'=>gettext("Bulk import aliases from list")), array('href'=>'firewall_aliases_import.php', 'label'=>gettext("Bulk import aliases from list")),
); );
?> ?>
<body> <body>
<?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 if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('aliases')): ?><p> <?php if (is_subsystem_dirty('aliases')): ?><p>
<?php print_info_box_np(gettext("The alias list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));?> <?php print_info_box_np(gettext("The alias list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));?>
<?php endif; ?> <?php endif; ?>
<?php pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases/pre_table"); ?> <?php pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases/pre_table"); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[] = array(gettext("IP"),($tab=="ip" ? true : ($tab=="host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip"); $tab_array[] = array(gettext("IP"),($tab=="ip" ? true : ($tab=="host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip");
$tab_array[] = array(gettext("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port"); $tab_array[] = array(gettext("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port");
...@@ -190,14 +190,14 @@ $main_buttons = array( ...@@ -190,14 +190,14 @@ $main_buttons = array(
$tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all"); $tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_aliases.php" method="post" name="iform" id="iform"> <form action="firewall_aliases.php" method="post" name="iform" id="iform">
<input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>" /> <input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>" />
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -205,7 +205,7 @@ $main_buttons = array( ...@@ -205,7 +205,7 @@ $main_buttons = array(
<td width="43%" class="listhdrr"><?=gettext("Values"); ?></td> <td width="43%" class="listhdrr"><?=gettext("Values"); ?></td>
<td width="30%" class="listhdr"><?=gettext("Description"); ?></td> <td width="30%" class="listhdr"><?=gettext("Description"); ?></td>
<td width="7%" class="list"> <td width="7%" class="list">
</td> </td>
</tr> </tr>
<?php <?php
...@@ -267,9 +267,9 @@ $main_buttons = array( ...@@ -267,9 +267,9 @@ $main_buttons = array(
<tr> <tr>
<td valign="middle"> <td valign="middle">
<a href="firewall_aliases_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit" title="<?=gettext("Edit alias")." ".$alias['name'];?>"></span></a> <a href="firewall_aliases_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit" title="<?=gettext("Edit alias")." ".$alias['name'];?>"></span></a>
<a href="firewall_aliases.php?act=del&amp;tab=<?=$tab;?>&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><span class="glyphicon glyphicon-remove"></span></a> <a href="firewall_aliases.php?act=del&amp;tab=<?=$tab;?>&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -278,7 +278,7 @@ $main_buttons = array( ...@@ -278,7 +278,7 @@ $main_buttons = array(
<?php <?php
} // if ($show_alias) } // if ($show_alias)
} // foreach } // foreach
?> ?>
</table> </table>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
...@@ -290,4 +290,4 @@ $main_buttons = array( ...@@ -290,4 +290,4 @@ $main_buttons = array(
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -624,26 +624,26 @@ EOD; ...@@ -624,26 +624,26 @@ EOD;
<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 pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases_edit/pre_input_errors"); ?> <?php pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases_edit/pre_input_errors"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<div id="inputerrors"></div> <div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Alias Edit");?></h3> <h3><?=gettext("Alias Edit");?></h3>
</header> </header>
<div class="content-box-main"> <div class="content-box-main">
<form action="firewall_aliases_edit.php" method="post" name="iform" id="iform"> <form action="firewall_aliases_edit.php" method="post" name="iform" id="iform">
<?php <?php
if (empty($tab)) { if (empty($tab)) {
if (preg_match("/url/i", $pconfig['type'])) if (preg_match("/url/i", $pconfig['type']))
$tab = 'url'; $tab = 'url';
...@@ -655,7 +655,7 @@ EOD; ...@@ -655,7 +655,7 @@ EOD;
?> ?>
<input name="tab" type="hidden" id="tab" value="<?=htmlspecialchars($tab);?>" /> <input name="tab" type="hidden" id="tab" value="<?=htmlspecialchars($tab);?>" />
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -713,7 +713,7 @@ EOD; ...@@ -713,7 +713,7 @@ EOD;
<td><div id="twocolumn">CIDR</div></td> <td><div id="twocolumn">CIDR</div></td>
<td><div id="threecolumn"><?=gettext("Description"); ?></div></td> <td><div id="threecolumn"><?=gettext("Description"); ?></div></td>
</tr> </tr>
<?php <?php
$counter = 0; $counter = 0;
if ($pconfig['address'] <> ""): if ($pconfig['address'] <> ""):
...@@ -748,7 +748,7 @@ EOD; ...@@ -748,7 +748,7 @@ EOD;
</tr> </tr>
<?php <?php
$counter++; $counter++;
endwhile; endwhile;
endif; endif;
?> ?>
...@@ -770,14 +770,14 @@ EOD; ...@@ -770,14 +770,14 @@ EOD;
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
...@@ -801,4 +801,4 @@ EOD; ...@@ -801,4 +801,4 @@ EOD;
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -162,25 +162,25 @@ include("head.inc"); ...@@ -162,25 +162,25 @@ include("head.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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<div id="inputerrors"></div> <div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Alias Import");?></h3> <h3><?=gettext("Alias Import");?></h3>
</header> </header>
<div class="content-box-main"> <div class="content-box-main">
<form action="firewall_aliases_import.php" method="post" name="iform" id="iform"> <form action="firewall_aliases_import.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -230,9 +230,9 @@ include("head.inc"); ...@@ -230,9 +230,9 @@ include("head.inc");
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
...@@ -240,4 +240,4 @@ include("head.inc"); ...@@ -240,4 +240,4 @@ include("head.inc");
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
This diff is collapsed.
...@@ -154,13 +154,13 @@ $main_buttons = array( ...@@ -154,13 +154,13 @@ $main_buttons = array(
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript" src="/javascript/row_toggle.js"></script> <script type="text/javascript" src="/javascript/row_toggle.js"></script>
<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 ($savemsg) if ($savemsg)
print_info_box($savemsg); print_info_box($savemsg);
...@@ -169,9 +169,9 @@ $main_buttons = array( ...@@ -169,9 +169,9 @@ $main_buttons = array(
"<br />" . "<br />" .
gettext("You must apply the changes in order for them to take effect.")); gettext("You must apply the changes in order for them to take effect."));
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php"); $tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php");
...@@ -180,16 +180,16 @@ $main_buttons = array( ...@@ -180,16 +180,16 @@ $main_buttons = array(
$tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php"); $tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_nat_1to1.php" method="post" name="iform" id="iform"> <form action="firewall_nat_1to1.php" method="post" name="iform" id="iform">
<input type="hidden" id="id" name="id" value="<?php echo htmlspecialchars($id); ?>" /> <input type="hidden" id="id" name="id" value="<?php echo htmlspecialchars($id); ?>" />
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<thead> <thead>
<tr id="frheader"> <tr id="frheader">
<th width="3%" class="list">&nbsp;</th> <th width="3%" class="list">&nbsp;</th>
<th width="3%" class="list">&nbsp;</th> <th width="3%" class="list">&nbsp;</th>
...@@ -200,8 +200,8 @@ $main_buttons = array( ...@@ -200,8 +200,8 @@ $main_buttons = array(
<th class="listhdr"><?=gettext("Description"); ?></th> <th class="listhdr"><?=gettext("Description"); ?></th>
<th class="list"></th> <th class="list"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$textse = ""; $textse = "";
$i = 0; $i = 0;
...@@ -223,12 +223,12 @@ $main_buttons = array( ...@@ -223,12 +223,12 @@ $main_buttons = array(
</td> </td>
<td class="listlr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';"> <td class="listlr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
<?php <?php
if (!$natent['interface']) if (!$natent['interface'])
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan")); echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
else else
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])); echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
?> ?>
</td> </td>
<td class="listr" id="frd<?=$i;?>" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';"> <td class="listr" id="frd<?=$i;?>" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
...@@ -257,7 +257,7 @@ $main_buttons = array( ...@@ -257,7 +257,7 @@ $main_buttons = array(
<button name="move_<?=$i;?>_x" <button name="move_<?=$i;?>_x"
title="<?=gettext("move selected rules before this rule");?>" title="<?=gettext("move selected rules before this rule");?>"
type="submit" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-arrow-left"></span></button> type="submit" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-arrow-left"></span></button>
<a href="firewall_nat_1to1_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <a href="firewall_nat_1to1_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="firewall_nat_1to1.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a> <a href="firewall_nat_1to1.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
<a href="firewall_nat_1to1_edit.php?dup=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a> <a href="firewall_nat_1to1_edit.php?dup=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a>
...@@ -270,7 +270,7 @@ $main_buttons = array( ...@@ -270,7 +270,7 @@ $main_buttons = array(
<tr> <tr>
<td class="list" colspan="7"></td> <td class="list" colspan="7"></td>
<td class="list nowrap" valign="middle"> <td class="list nowrap" valign="middle">
<?php <?php
if ($i == 0): if ($i == 0):
?> ?>
...@@ -282,9 +282,9 @@ $main_buttons = array( ...@@ -282,9 +282,9 @@ $main_buttons = array(
<?php <?php
endif; endif;
?> ?>
<a href="firewall_nat_1to1_edit.php" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a> <a href="firewall_nat_1to1_edit.php" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a>
<?php <?php
if ($i == 0): if ($i == 0):
?> ?>
...@@ -312,7 +312,7 @@ $main_buttons = array( ...@@ -312,7 +312,7 @@ $main_buttons = array(
</span></p> </span></p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</form> </form>
...@@ -322,4 +322,4 @@ $main_buttons = array( ...@@ -322,4 +322,4 @@ $main_buttons = array(
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -229,7 +229,7 @@ include("head.inc"); ...@@ -229,7 +229,7 @@ include("head.inc");
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript" src="/javascript/suggestions.js"></script> <script type="text/javascript" src="/javascript/suggestions.js"></script>
<script type="text/javascript" src="/javascript/autosuggest.js"></script> <script type="text/javascript" src="/javascript/autosuggest.js"></script>
<script type="text/javascript"> <script type="text/javascript">
...@@ -276,22 +276,22 @@ include("head.inc"); ...@@ -276,22 +276,22 @@ include("head.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 ($input_errors) if ($input_errors)
print_input_errors($input_errors); print_input_errors($input_errors);
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform"> <form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td>
</tr> </tr>
...@@ -311,27 +311,27 @@ include("head.inc"); ...@@ -311,27 +311,27 @@ include("head.inc");
foreach ($ifdisp as $if => $ifdesc) foreach ($ifdisp as $if => $ifdesc)
if(have_ruleint_access($if)) if(have_ruleint_access($if))
$interfaces[$if] = $ifdesc; $interfaces[$if] = $ifdesc;
if ($config['l2tp']['mode'] == "server") if ($config['l2tp']['mode'] == "server")
if(have_ruleint_access("l2tp")) if(have_ruleint_access("l2tp"))
$interfaces['l2tp'] = "L2TP VPN"; $interfaces['l2tp'] = "L2TP VPN";
if ($config['pptpd']['mode'] == "server") if ($config['pptpd']['mode'] == "server")
if(have_ruleint_access("pptp")) if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN"; $interfaces['pptp'] = "PPTP VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN"; $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */ /* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
if(have_ruleint_access("enc0")) if(have_ruleint_access("enc0"))
$interfaces["enc0"] = "IPsec"; $interfaces["enc0"] = "IPsec";
/* add openvpn/tun interfaces */ /* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
$interfaces["openvpn"] = "OpenVPN"; $interfaces["openvpn"] = "OpenVPN";
foreach ($interfaces as $iface => $ifacename): foreach ($interfaces as $iface => $ifacename):
?> ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
...@@ -418,7 +418,7 @@ include("head.inc"); ...@@ -418,7 +418,7 @@ include("head.inc");
<?php <?php
for ($i = 31; $i > 0; $i--): for ($i = 31; $i > 0; $i--):
?> ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option> <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
<?php <?php
endfor; endfor;
?> ?>
...@@ -475,7 +475,7 @@ include("head.inc"); ...@@ -475,7 +475,7 @@ include("head.inc");
</option> </option>
<?php <?php
endif; endif;
foreach ($ifdisp as $if => $ifdesc): foreach ($ifdisp as $if => $ifdesc):
if(have_ruleint_access($if)): if(have_ruleint_access($if)):
?> ?>
...@@ -553,9 +553,9 @@ include("head.inc"); ...@@ -553,9 +553,9 @@ include("head.inc");
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
...@@ -572,4 +572,4 @@ include("head.inc"); ...@@ -572,4 +572,4 @@ include("head.inc");
var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -247,7 +247,7 @@ if ($_POST) { ...@@ -247,7 +247,7 @@ if ($_POST) {
} }
/* if user enters an alias and selects "network" then disallow. */ /* if user enters an alias and selects "network" then disallow. */
if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) ) if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) )
|| ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) { || ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) {
$input_errors[] = gettext("You must specify single host or alias for alias entries."); $input_errors[] = gettext("You must specify single host or alias for alias entries.");
} }
...@@ -310,7 +310,7 @@ if ($_POST) { ...@@ -310,7 +310,7 @@ if ($_POST) {
} }
} }
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation"); pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation");
if (!$input_errors) { if (!$input_errors) {
...@@ -429,7 +429,7 @@ if ($_POST) { ...@@ -429,7 +429,7 @@ if ($_POST) {
$natent['updated'] = make_config_revision_entry(); $natent['updated'] = make_config_revision_entry();
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config"); pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config");
// Update the NAT entry now // Update the NAT entry now
...@@ -461,25 +461,25 @@ include("head.inc"); ...@@ -461,25 +461,25 @@ include("head.inc");
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script src="/javascript/chosen/chosen.jquery.js" type="text/javascript"></script> <script src="/javascript/chosen/chosen.jquery.js" type="text/javascript"></script>
<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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form action="firewall_nat_edit.php" method="post" name="iform" id="iform"> <form action="firewall_nat_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
...@@ -487,7 +487,7 @@ include("head.inc"); ...@@ -487,7 +487,7 @@ include("head.inc");
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Redirect entry"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Redirect entry"); ?></td>
</tr> </tr>
<?php <?php
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphpearly"); pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphpearly");
?> ?>
<tr> <tr>
...@@ -511,34 +511,34 @@ include("head.inc"); ...@@ -511,34 +511,34 @@ include("head.inc");
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<select name="interface" class="formselect" onchange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();"> <select name="interface" class="formselect" onchange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
<?php <?php
$iflist = get_configured_interface_with_descr(false, true); $iflist = get_configured_interface_with_descr(false, true);
// Allow extending of the firewall edit interfaces // Allow extending of the firewall edit interfaces
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit"); pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
foreach ($iflist as $if => $ifdesc) foreach ($iflist as $if => $ifdesc)
if(have_ruleint_access($if)) if(have_ruleint_access($if))
$interfaces[$if] = $ifdesc; $interfaces[$if] = $ifdesc;
if ($config['l2tp']['mode'] == "server") if ($config['l2tp']['mode'] == "server")
if(have_ruleint_access("l2tp")) if(have_ruleint_access("l2tp"))
$interfaces['l2tp'] = "L2TP VPN"; $interfaces['l2tp'] = "L2TP VPN";
if ($config['pptpd']['mode'] == "server") if ($config['pptpd']['mode'] == "server")
if(have_ruleint_access("pptp")) if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN"; $interfaces['pptp'] = "PPTP VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN"; $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */ /* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
if(have_ruleint_access("enc0")) if(have_ruleint_access("enc0"))
$interfaces["enc0"] = "IPsec"; $interfaces["enc0"] = "IPsec";
/* add openvpn/tun interfaces */ /* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
$interfaces["openvpn"] = "OpenVPN"; $interfaces["openvpn"] = "OpenVPN";
foreach ($interfaces as $iface => $ifacename): ?> foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
<?=htmlspecialchars($ifacename);?> <?=htmlspecialchars($ifacename);?>
...@@ -601,7 +601,7 @@ include("head.inc"); ...@@ -601,7 +601,7 @@ include("head.inc");
<?=$ifdesc?> <?=gettext("address");?> <?=$ifdesc?> <?=gettext("address");?>
</option> </option>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</td> </td>
</tr> </tr>
...@@ -612,7 +612,7 @@ include("head.inc"); ...@@ -612,7 +612,7 @@ include("head.inc");
<select name="srcmask" class="formselect" id="srcmask"> <select name="srcmask" class="formselect" id="srcmask">
<?php for ($i = 31; $i > 0; $i--): ?> <?php for ($i = 31; $i > 0; $i--): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option> <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
<?php endfor; ?> <?php endfor; ?>
</select> </select>
</td> </td>
</tr> </tr>
...@@ -629,9 +629,9 @@ include("head.inc"); ...@@ -629,9 +629,9 @@ include("head.inc");
<select name="srcbeginport" class="formselect" onchange="src_rep_change();ext_change()"> <select name="srcbeginport" class="formselect" onchange="src_rep_change();ext_change()">
<option value="">(<?=gettext("other"); ?>)</option> <option value="">(<?=gettext("other"); ?>)</option>
<option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected=\"selected\""; $bfound = 1; } ?>><?=gettext("any"); ?></option> <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected=\"selected\""; $bfound = 1; } ?>><?=gettext("any"); ?></option>
<?php foreach ($wkports as $wkport => $wkportdesc): ?> <?php foreach ($wkports as $wkport => $wkportdesc): ?>
<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected=\"selected\""; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected=\"selected\""; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<input autocomplete='off' class="formfldalias" name="srcbeginport_cust" id="srcbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcbeginport']) echo htmlspecialchars($pconfig['srcbeginport']); ?>" /> <input autocomplete='off' class="formfldalias" name="srcbeginport_cust" id="srcbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcbeginport']) echo htmlspecialchars($pconfig['srcbeginport']); ?>" />
</td> </td>
...@@ -683,16 +683,16 @@ include("head.inc"); ...@@ -683,16 +683,16 @@ include("head.inc");
<?php if(have_ruleint_access("l2tp")): ?> <?php if(have_ruleint_access("l2tp")): ?>
<option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option> <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
<?php endif; ?> <?php endif; ?>
<?php foreach ($ifdisp as $if => $ifdesc): ?> <?php foreach ($ifdisp as $if => $ifdesc): ?>
<?php if(have_ruleint_access($if)): ?> <?php if(have_ruleint_access($if)): ?>
<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("net"); ?></option> <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("net"); ?></option>
<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected=\"selected\""; } ?>> <option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected=\"selected\""; } ?>>
<?=$ifdesc;?> <?=gettext("address");?> <?=$ifdesc;?> <?=gettext("address");?>
</option> </option>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php if (is_array($config['virtualip']['vip'])): <?php if (is_array($config['virtualip']['vip'])):
foreach ($config['virtualip']['vip'] as $sn): foreach ($config['virtualip']['vip'] as $sn):
if (isset($sn['noexpand'])) if (isset($sn['noexpand']))
...@@ -741,10 +741,10 @@ include("head.inc"); ...@@ -741,10 +741,10 @@ include("head.inc");
<td> <td>
<select name="dstbeginport" id="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()"> <select name="dstbeginport" id="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()">
<option value="">(<?=gettext("other"); ?>)</option> <option value="">(<?=gettext("other"); ?>)</option>
<?php $bfound = 0; <?php $bfound = 0;
foreach ($wkports as $wkport => $wkportdesc): ?> foreach ($wkports as $wkport => $wkportdesc): ?>
<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected=\"selected\""; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected=\"selected\""; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<input autocomplete='off' class="formfldalias" name="dstbeginport_cust" id="dstbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstbeginport']) echo htmlspecialchars($pconfig['dstbeginport']); ?>" /> <input autocomplete='off' class="formfldalias" name="dstbeginport_cust" id="dstbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstbeginport']) echo htmlspecialchars($pconfig['dstbeginport']); ?>" />
</td> </td>
...@@ -757,7 +757,7 @@ include("head.inc"); ...@@ -757,7 +757,7 @@ include("head.inc");
<?php $bfound = 0; <?php $bfound = 0;
foreach ($wkports as $wkport => $wkportdesc): ?> foreach ($wkports as $wkport => $wkportdesc): ?>
<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected=\"selected\""; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected=\"selected\""; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<input autocomplete='off' class="formfldalias" name="dstendport_cust" id="dstendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstendport']) echo htmlspecialchars($pconfig['dstendport']); ?>" /> <input autocomplete='off' class="formfldalias" name="dstendport_cust" id="dstendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstendport']) echo htmlspecialchars($pconfig['dstendport']); ?>" />
</td> </td>
...@@ -844,7 +844,7 @@ include("head.inc"); ...@@ -844,7 +844,7 @@ include("head.inc");
$linkedrule = "<br /><a href=\"firewall_rules_edit.php?id={$filter_id}\">" . gettext("View the filter rule") . "</a><br />"; $linkedrule = "<br /><a href=\"firewall_rules_edit.php?id={$filter_id}\">" . gettext("View the filter rule") . "</a><br />";
} }
echo ">". htmlspecialchars('Rule ' . $filter_rule['descr']) . "</option>\n"; echo ">". htmlspecialchars('Rule ' . $filter_rule['descr']) . "</option>\n";
} }
} }
} }
...@@ -870,7 +870,7 @@ include("head.inc"); ...@@ -870,7 +870,7 @@ include("head.inc");
</td> </td>
</tr><?php endif; ?> </tr><?php endif; ?>
<?php <?php
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate"); pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate");
?> ?>
<?php <?php
...@@ -954,4 +954,4 @@ include("head.inc"); ...@@ -954,4 +954,4 @@ include("head.inc");
var oTextbox8 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray)); var oTextbox8 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray));
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -86,20 +86,20 @@ $main_buttons = array( ...@@ -86,20 +86,20 @@ $main_buttons = array(
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript" src="/javascript/row_toggle.js"></script> <script type="text/javascript" src="/javascript/row_toggle.js"></script>
<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 if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('natconf')): ?> <?php if (is_subsystem_dirty('natconf')): ?>
<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /> <?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php"); $tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php");
...@@ -108,30 +108,30 @@ $main_buttons = array( ...@@ -108,30 +108,30 @@ $main_buttons = array(
$tab_array[] = array(gettext("NPt"), true, "firewall_nat_npt.php"); $tab_array[] = array(gettext("NPt"), true, "firewall_nat_npt.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_nat_npt.php" method="post" name="iform" id="iform"> <form action="firewall_nat_npt.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<thead> <thead>
<tr> <tr>
<th width="10%" class="listhdrr"><?=gettext("Interface"); ?></th> <th width="10%" class="listhdrr"><?=gettext("Interface"); ?></th>
<th width="20%" class="listhdrr"><?=gettext("External Prefix"); ?></th> <th width="20%" class="listhdrr"><?=gettext("External Prefix"); ?></th>
<th width="15%" class="listhdrr"><?=gettext("Internal prefix"); ?></th> <th width="15%" class="listhdrr"><?=gettext("Internal prefix"); ?></th>
<th width="30%" class="listhdr"><?=gettext("Description"); ?></th> <th width="30%" class="listhdr"><?=gettext("Description"); ?></th>
<th class="list"></th> <th class="list"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$textse = "</span>"; $textse = "</span>";
$i = 0; foreach ($a_npt as $natent): $i = 0; foreach ($a_npt as $natent):
if (isset($natent['disabled'])) if (isset($natent['disabled']))
$textss = "<span class=\"gray\">"; $textss = "<span class=\"gray\">";
else else
...@@ -147,17 +147,17 @@ $main_buttons = array( ...@@ -147,17 +147,17 @@ $main_buttons = array(
echo $textse; echo $textse;
?> ?>
</td> </td>
<?php <?php
$source_net = pprint_address($natent['source']); $source_net = pprint_address($natent['source']);
$source_cidr = strstr($source_net, '/'); $source_cidr = strstr($source_net, '/');
$destination_net = pprint_address($natent['destination']); $destination_net = pprint_address($natent['destination']);
$destination_cidr = strstr($destination_net, '/'); $destination_cidr = strstr($destination_net, '/');
?> ?>
<td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';">
<?php echo $textss . $destination_net . $textse; ?> <?php echo $textss . $destination_net . $textse; ?>
</td> </td>
<td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';">
<?php echo $textss . $source_net . $textse; ?> <?php echo $textss . $source_net . $textse; ?>
</td> </td>
<td class="listbg" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> <td class="listbg" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';">
<?=$textss;?> <?=$textss;?>
...@@ -169,15 +169,15 @@ $main_buttons = array( ...@@ -169,15 +169,15 @@ $main_buttons = array(
</td> </td>
</tr> </tr>
<?php $i++; endforeach; ?> <?php $i++; endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
<?php <?php
/* $Id$ */ /* $Id$ */
/* /*
firewall_nat_npt_edit.php firewall_nat_npt_edit.php
part of pfSense (https://www.pfsense.org) part of pfSense (https://www.pfsense.org)
Copyright (C) 2011 Seth Mos <seth.mos@dds.nl>. Copyright (C) 2011 Seth Mos <seth.mos@dds.nl>.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
...@@ -98,7 +98,7 @@ if (isset($id) && $a_npt[$id]) { ...@@ -98,7 +98,7 @@ if (isset($id) && $a_npt[$id]) {
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
...@@ -109,7 +109,7 @@ if ($_POST) { ...@@ -109,7 +109,7 @@ if ($_POST) {
$reqdfieldsn[] = gettext("Source prefix"); $reqdfieldsn[] = gettext("Source prefix");
$reqdfields[] = "dst"; $reqdfields[] = "dst";
$reqdfieldsn[] = gettext("Destination prefix"); $reqdfieldsn[] = gettext("Destination prefix");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (!$input_errors) { if (!$input_errors) {
...@@ -157,23 +157,23 @@ include("head.inc"); ...@@ -157,23 +157,23 @@ include("head.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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form action="firewall_nat_npt_edit.php" method="post" name="iform" id="iform"> <form action="firewall_nat_npt_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT NPt entry"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT NPt entry"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
...@@ -190,29 +190,29 @@ include("head.inc"); ...@@ -190,29 +190,29 @@ include("head.inc");
foreach ($ifdisp as $if => $ifdesc) foreach ($ifdisp as $if => $ifdesc)
if(have_ruleint_access($if)) if(have_ruleint_access($if))
$interfaces[$if] = $ifdesc; $interfaces[$if] = $ifdesc;
if ($config['l2tp']['mode'] == "server") if ($config['l2tp']['mode'] == "server")
if(have_ruleint_access("l2tp")) if(have_ruleint_access("l2tp"))
$interfaces['l2tp'] = "L2TP VPN"; $interfaces['l2tp'] = "L2TP VPN";
if ($config['pptpd']['mode'] == "server") if ($config['pptpd']['mode'] == "server")
if(have_ruleint_access("pptp")) if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN"; $interfaces['pptp'] = "PPTP VPN";
if ($config['pppoe']['mode'] == "server") if ($config['pppoe']['mode'] == "server")
if(have_ruleint_access("pppoe")) if(have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN"; $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */ /* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])) if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
if(have_ruleint_access("enc0")) if(have_ruleint_access("enc0"))
$interfaces["enc0"] = "IPsec"; $interfaces["enc0"] = "IPsec";
/* add openvpn/tun interfaces */ /* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
$interfaces["openvpn"] = "OpenVPN"; $interfaces["openvpn"] = "OpenVPN";
foreach ($interfaces as $iface => $ifacename): foreach ($interfaces as $iface => $ifacename):
?> ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
<?=htmlspecialchars($ifacename);?> <?=htmlspecialchars($ifacename);?>
...@@ -245,8 +245,8 @@ include("head.inc"); ...@@ -245,8 +245,8 @@ include("head.inc");
</tr> </tr>
</table> </table>
<br /> <br />
<span class="vexpl"><?=gettext("Enter the internal (LAN) ULA IPv6 Prefix for the Network Prefix translation. The prefix size specified for the internal IPv6 prefix will be applied to the <span class="vexpl"><?=gettext("Enter the internal (LAN) ULA IPv6 Prefix for the Network Prefix translation. The prefix size specified for the internal IPv6 prefix will be applied to the
external prefix."); external prefix.");
?></span> ?></span>
</td> </td>
</tr> </tr>
...@@ -278,16 +278,16 @@ include("head.inc"); ...@@ -278,16 +278,16 @@ include("head.inc");
<span class="vexpl"><?=gettext("Enter the Global Unicast routable IPv6 prefix here"); ?><br /></span> <span class="vexpl"><?=gettext("Enter the Global Unicast routable IPv6 prefix here"); ?><br /></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<br /> <span class="vexpl"><?=gettext("You may enter a description here " . <br /> <span class="vexpl"><?=gettext("You may enter a description here " .
"for your reference (not parsed)."); ?></span></td> "for your reference (not parsed)."); ?></span></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <td width="78%">
<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='<?=$referer;?>'" />
<?php if (isset($id) && $a_npt[$id]): ?> <?php if (isset($id) && $a_npt[$id]): ?>
...@@ -296,12 +296,12 @@ include("head.inc"); ...@@ -296,12 +296,12 @@ include("head.inc");
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
This diff is collapsed.
...@@ -248,7 +248,7 @@ if ($_POST) { ...@@ -248,7 +248,7 @@ if ($_POST) {
} }
} }
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/input_validation"); pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/input_validation");
if (!$input_errors) { if (!$input_errors) {
...@@ -268,7 +268,7 @@ if ($_POST) { ...@@ -268,7 +268,7 @@ if ($_POST) {
} else { } else {
unset($natent['staticnatport']); unset($natent['staticnatport']);
} }
if(isset($_POST['disabled'])) { if(isset($_POST['disabled'])) {
$natent['disabled'] = true; $natent['disabled'] = true;
} else { } else {
...@@ -293,7 +293,7 @@ if ($_POST) { ...@@ -293,7 +293,7 @@ if ($_POST) {
$natent['destination']['address'] = $ext; $natent['destination']['address'] = $ext;
} }
if($_POST['natport'] != "" && $protocol_uses_ports && !isset($_POST['nonat'])) { if($_POST['natport'] != "" && $protocol_uses_ports && !isset($_POST['nonat'])) {
$natent['natport'] = $_POST['natport']; $natent['natport'] = $_POST['natport'];
} else { } else {
unset($natent['natport']); unset($natent['natport']);
} }
...@@ -318,7 +318,7 @@ if ($_POST) { ...@@ -318,7 +318,7 @@ if ($_POST) {
$natent['updated'] = make_config_revision_entry(); $natent['updated'] = make_config_revision_entry();
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/pre_write_config"); pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/pre_write_config");
if (isset($id) && $a_out[$id]) { if (isset($id) && $a_out[$id]) {
...@@ -443,24 +443,24 @@ function poolopts_change() { ...@@ -443,24 +443,24 @@ function poolopts_change() {
<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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form action="firewall_nat_out_edit.php" method="post" name="iform" id="iform"> <form action="firewall_nat_out_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Advanced Outbound NAT entry");?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Advanced Outbound NAT entry");?></td>
</tr> </tr>
<?php <?php
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphpearly"); pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphpearly");
?> ?>
<tr> <tr>
...@@ -488,27 +488,27 @@ function poolopts_change() { ...@@ -488,27 +488,27 @@ function poolopts_change() {
foreach ($iflist as $if => $ifdesc) foreach ($iflist as $if => $ifdesc)
if(have_ruleint_access($if)) if(have_ruleint_access($if))
$interfaces[$if] = $ifdesc; $interfaces[$if] = $ifdesc;
if ($config['l2tp']['mode'] == "server") if ($config['l2tp']['mode'] == "server")
if(have_ruleint_access("l2tp")) if(have_ruleint_access("l2tp"))
$interfaces['l2tp'] = "L2TP VPN"; $interfaces['l2tp'] = "L2TP VPN";
if ($config['pptpd']['mode'] == "server") if ($config['pptpd']['mode'] == "server")
if(have_ruleint_access("pptp")) if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN"; $interfaces['pptp'] = "PPTP VPN";
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$interfaces['pppoe'] = "PPPoE VPN"; $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */ /* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
if(have_ruleint_access("enc0")) if(have_ruleint_access("enc0"))
$interfaces["enc0"] = "IPsec"; $interfaces["enc0"] = "IPsec";
/* add openvpn/tun interfaces */ /* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
$interfaces["openvpn"] = "OpenVPN"; $interfaces["openvpn"] = "OpenVPN";
foreach ($interfaces as $iface => $ifacename): foreach ($interfaces as $iface => $ifacename):
?> ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
...@@ -700,7 +700,7 @@ function poolopts_change() { ...@@ -700,7 +700,7 @@ function poolopts_change() {
</select> </select>
</td> </td>
</tr> </tr>
<tr id="target_network"> <tr id="target_network">
<td><?=gettext("Other Subnet:");?>&nbsp;&nbsp;</td> <td><?=gettext("Other Subnet:");?>&nbsp;&nbsp;</td>
<td> <td>
...@@ -716,7 +716,7 @@ function poolopts_change() { ...@@ -716,7 +716,7 @@ function poolopts_change() {
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
...@@ -821,7 +821,7 @@ function poolopts_change() { ...@@ -821,7 +821,7 @@ function poolopts_change() {
</tr> </tr>
<?php <?php
endif; endif;
if ($has_updated_time): if ($has_updated_time):
?> ?>
<tr> <tr>
...@@ -833,7 +833,7 @@ function poolopts_change() { ...@@ -833,7 +833,7 @@ function poolopts_change() {
<?php <?php
endif; endif;
endif; endif;
// Allow extending of the firewall edit page and include custom input validation // Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/htmlphplate"); pfSense_handle_custom_code("/usr/local/pkg/firewall_aon/htmlphplate");
?> ?>
<tr> <tr>
...@@ -852,16 +852,16 @@ function poolopts_change() { ...@@ -852,16 +852,16 @@ function poolopts_change() {
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
sourcesel_change(); sourcesel_change();
...@@ -880,4 +880,4 @@ function poolopts_change() { ...@@ -880,4 +880,4 @@ function poolopts_change() {
var oTextbox4 = new AutoSuggestControl(document.getElementById("dstport"), new StateSuggestions(customarray)); var oTextbox4 = new AutoSuggestControl(document.getElementById("dstport"), new StateSuggestions(customarray));
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -96,34 +96,34 @@ $main_buttons = array( ...@@ -96,34 +96,34 @@ $main_buttons = array(
<?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 if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<div class="content-box-main "> <div class="content-box-main ">
<form action="firewall_schedule.php" method="post" name="iform" id="iform"> <form action="firewall_schedule.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<thead> <thead>
<tr> <tr>
<td width="25%" class="listhdrr"><?=gettext("Name");?></td> <td width="25%" class="listhdrr"><?=gettext("Name");?></td>
<td width="35%" class="listhdrr"><?=gettext("Time Range(s)");?></td> <td width="35%" class="listhdrr"><?=gettext("Time Range(s)");?></td>
<td width="35%" class="listhdr"><?=gettext("Description");?></td> <td width="35%" class="listhdr"><?=gettext("Description");?></td>
<td width="5%" class="list sort_ignore"> <td width="5%" class="list sort_ignore">
</td> </td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php $i = 0; foreach ($a_schedules as $schedule): ?> <?php $i = 0; foreach ($a_schedules as $schedule): ?>
<tr> <tr>
<td class="listlr" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';"> <td class="listlr" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';">
...@@ -131,14 +131,14 @@ $main_buttons = array( ...@@ -131,14 +131,14 @@ $main_buttons = array(
<?php <?php
$schedstatus = filter_get_time_based_rule_status($schedule); $schedstatus = filter_get_time_based_rule_status($schedule);
if ($schedstatus) { ?> if ($schedstatus) { ?>
&nbsp;<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_frmfld_time.png" title="<?=gettext("Schedule is currently active");?>" width="17" height="17" border="0" alt="schedule" /> &nbsp;<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_frmfld_time.png" title="<?=gettext("Schedule is currently active");?>" width="17" height="17" border="0" alt="schedule" />
<?php } ?> <?php } ?>
</td> </td>
<td class="listlr" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';"> <td class="listlr" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';">
<table width="98%" border="0" cellpadding="0" cellspacing="0" summary="schedule"> <table width="98%" border="0" cellpadding="0" cellspacing="0" summary="schedule">
<?php <?php
foreach($schedule['timerange'] as $timerange) { foreach($schedule['timerange'] as $timerange) {
$tempFriendlyTime = ""; $tempFriendlyTime = "";
$tempID = ""; $tempID = "";
...@@ -146,14 +146,14 @@ $main_buttons = array( ...@@ -146,14 +146,14 @@ $main_buttons = array(
if ($timerange){ if ($timerange){
$dayFriendly = ""; $dayFriendly = "";
$tempFriendlyTime = ""; $tempFriendlyTime = "";
//get hours //get hours
$temptimerange = $timerange['hour']; $temptimerange = $timerange['hour'];
$temptimeseparator = strrpos($temptimerange, "-"); $temptimeseparator = strrpos($temptimerange, "-");
$starttime = substr ($temptimerange, 0, $temptimeseparator); $starttime = substr ($temptimerange, 0, $temptimeseparator);
$stoptime = substr ($temptimerange, $temptimeseparator+1); $stoptime = substr ($temptimerange, $temptimeseparator+1);
if ($timerange['month']){ if ($timerange['month']){
$tempmontharray = explode(",", $timerange['month']); $tempmontharray = explode(",", $timerange['month']);
$tempdayarray = explode(",",$timerange['day']); $tempdayarray = explode(",",$timerange['day']);
...@@ -163,14 +163,14 @@ $main_buttons = array( ...@@ -163,14 +163,14 @@ $main_buttons = array(
foreach ($tempmontharray as $monthtmp){ foreach ($tempmontharray as $monthtmp){
$month = $tempmontharray[$arraycounter]; $month = $tempmontharray[$arraycounter];
$day = $tempdayarray[$arraycounter]; $day = $tempdayarray[$arraycounter];
if (!$firstDayFound) if (!$firstDayFound)
{ {
$firstDay = $day; $firstDay = $day;
$firstmonth = $month; $firstmonth = $month;
$firstDayFound = true; $firstDayFound = true;
} }
$currentDay = $day; $currentDay = $day;
$nextDay = $tempdayarray[$arraycounter+1]; $nextDay = $tempdayarray[$arraycounter+1];
$currentDay++; $currentDay++;
...@@ -225,15 +225,15 @@ $main_buttons = array( ...@@ -225,15 +225,15 @@ $main_buttons = array(
} }
$timeFriendly = $starttime . "-" . $stoptime; $timeFriendly = $starttime . "-" . $stoptime;
$description = $timerange['rangedescr']; $description = $timerange['rangedescr'];
?><tr><td><?=$dayFriendly;?></td><td><?=$timeFriendly;?></td><td><?=$description;?></td></tr><?php ?><tr><td><?=$dayFriendly;?></td><td><?=$timeFriendly;?></td><td><?=$description;?></td></tr><?php
} }
}//end for?></table> }//end for?></table>
</td> </td>
<td class="listbg" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';"> <td class="listbg" ondblclick="document.location='firewall_schedule_edit.php?id=<?=$i;?>';">
<?=htmlspecialchars($schedule['descr']);?>&nbsp; <?=htmlspecialchars($schedule['descr']);?>&nbsp;
</td> </td>
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<table border="0" cellspacing="0" cellpadding="1" summary="buttons"> <table border="0" cellspacing="0" cellpadding="1" summary="buttons">
<tr> <tr>
<td valign="middle"><a href="firewall_schedule_edit.php?id=<?=$i;?>" title="<?=gettext("edit alias");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a></td> <td valign="middle"><a href="firewall_schedule_edit.php?id=<?=$i;?>" title="<?=gettext("edit alias");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a></td>
...@@ -243,17 +243,17 @@ $main_buttons = array( ...@@ -243,17 +243,17 @@ $main_buttons = array(
</td> </td>
</tr> </tr>
<?php $i++; endforeach; ?> <?php $i++; endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<p><span class="vexpl"><span class="text-danger"><strong><?=gettext("Note:");?><br /></strong></span><?=gettext("Schedules act as placeholders for time ranges to be used in Firewall Rules.");?></span></p> <p><span class="vexpl"><span class="text-danger"><strong><?=gettext("Note:");?><br /></strong></span><?=gettext("Schedules act as placeholders for time ranges to be used in Firewall Rules.");?></span></p>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
This diff is collapsed.
...@@ -56,14 +56,14 @@ $shortcut_section = "trafficshaper"; ...@@ -56,14 +56,14 @@ $shortcut_section = "trafficshaper";
$shaperIFlist = get_configured_interface_with_descr(); $shaperIFlist = get_configured_interface_with_descr();
read_altq_config(); read_altq_config();
/* /*
* The whole logic in these code maybe can be specified. * The whole logic in these code maybe can be specified.
* If you find a better way contact me :). * If you find a better way contact me :).
*/ */
if ($_GET) { if ($_GET) {
if ($_GET['queue']) if ($_GET['queue'])
$qname = trim($_GET['queue']); $qname = trim($_GET['queue']);
if ($_GET['interface']) if ($_GET['interface'])
$interface = htmlspecialchars(trim($_GET['interface'])); $interface = htmlspecialchars(trim($_GET['interface']));
if ($_GET['action']) if ($_GET['action'])
...@@ -71,7 +71,7 @@ if ($_GET) { ...@@ -71,7 +71,7 @@ if ($_GET) {
} }
if ($_POST) { if ($_POST) {
if ($_POST['name']) if ($_POST['name'])
$qname = htmlspecialchars(trim($_POST['name'])); $qname = htmlspecialchars(trim($_POST['name']));
if ($_POST['interface']) if ($_POST['interface'])
$interface = htmlspecialchars(trim($_POST['interface'])); $interface = htmlspecialchars(trim($_POST['interface']));
if ($_POST['parentqueue']) if ($_POST['parentqueue'])
...@@ -137,26 +137,26 @@ if ($_GET) { ...@@ -137,26 +137,26 @@ if ($_GET) {
/* XXX: Find better way because we shouldn't know about this */ /* XXX: Find better way because we shouldn't know about this */
if ($altq) { if ($altq) {
switch ($altq->GetScheduler()) { switch ($altq->GetScheduler()) {
case "PRIQ": case "PRIQ":
$q = new priq_queue(); $q = new priq_queue();
break; break;
case "FAIRQ": case "FAIRQ":
$q = new fairq_queue(); $q = new fairq_queue();
break; break;
case "HFSC": case "HFSC":
$q = new hfsc_queue(); $q = new hfsc_queue();
break; break;
case "CBQ": case "CBQ":
$q = new cbq_queue(); $q = new cbq_queue();
break; break;
default: default:
/* XXX: Happens when sched==NONE?! */ /* XXX: Happens when sched==NONE?! */
$q = new altq_root_queue(); $q = new altq_root_queue();
break; break;
} }
} else if ($addnewaltq) { } else if ($addnewaltq) {
$q = new altq_root_queue(); $q = new altq_root_queue();
} else } else
$input_errors[] = gettext("Could not create new queue/discipline!"); $input_errors[] = gettext("Could not create new queue/discipline!");
if ($q) { if ($q) {
...@@ -170,7 +170,7 @@ if ($_GET) { ...@@ -170,7 +170,7 @@ if ($_GET) {
} }
break; break;
case "show": case "show":
if ($queue) if ($queue)
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
else else
$input_errors[] = gettext("Queue not found!"); $input_errors[] = gettext("Queue not found!");
...@@ -204,7 +204,7 @@ if ($_GET) { ...@@ -204,7 +204,7 @@ if ($_GET) {
if ($addnewaltq) { if ($addnewaltq) {
$altq =& new altq_root_queue(); $altq =& new altq_root_queue();
$altq->SetInterface($interface); $altq->SetInterface($interface);
switch ($altq->GetBwscale()) { switch ($altq->GetBwscale()) {
case "Mb": case "Mb":
$factor = 1000 * 1000; $factor = 1000 * 1000;
...@@ -222,14 +222,14 @@ if ($_GET) { ...@@ -222,14 +222,14 @@ if ($_GET) {
default: /* XXX assume Kb by default. */ default: /* XXX assume Kb by default. */
$factor = 1000; $factor = 1000;
break; break;
} }
$altq->SetAvailableBandwidth($altq->GetBandwidth() * $factor); $altq->SetAvailableBandwidth($altq->GetBandwidth() * $factor);
$altq->ReadConfig($_POST); $altq->ReadConfig($_POST);
$altq->validate_input($_POST, $input_errors); $altq->validate_input($_POST, $input_errors);
if (!$input_errors) { if (!$input_errors) {
unset($tmppath); unset($tmppath);
$tmppath[] = $altq->GetInterface(); $tmppath[] = $altq->GetInterface();
$altq->SetLink($tmppath); $altq->SetLink($tmppath);
$altq->wconfig(); $altq->wconfig();
if (write_config()) if (write_config())
mark_subsystem_dirty('shaper'); mark_subsystem_dirty('shaper');
...@@ -251,9 +251,9 @@ if ($_GET) { ...@@ -251,9 +251,9 @@ if ($_GET) {
$can_enable = true; $can_enable = true;
if ($tmp->CanHaveChildren() && $can_enable) { if ($tmp->CanHaveChildren() && $can_enable) {
if ($tmp->GetDefault() <> "") if ($tmp->GetDefault() <> "")
$can_add = false; $can_add = false;
else else
$can_add = true; $can_add = true;
} else } else
$can_add = false; $can_add = false;
if (write_config()) if (write_config())
...@@ -266,7 +266,7 @@ if ($_GET) { ...@@ -266,7 +266,7 @@ if ($_GET) {
$can_add = true; $can_add = true;
} }
read_altq_config(); read_altq_config();
$output_form .= $tmp->build_form(); $output_form .= $tmp->build_form();
} else } else
$input_errors[] = gettext("Could not add new queue."); $input_errors[] = gettext("Could not add new queue.");
} else if ($_POST['apply']) { } else if ($_POST['apply']) {
...@@ -275,19 +275,19 @@ if ($_GET) { ...@@ -275,19 +275,19 @@ if ($_GET) {
$retval = 0; $retval = 0;
$retval = filter_configure(); $retval = filter_configure();
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
else else
$savemsg = $retval; $savemsg = $retval;
/* reset rrd queues */ /* reset rrd queues */
system("rm -f /var/db/rrd/*queuedrops.rrd"); system("rm -f /var/db/rrd/*queuedrops.rrd");
system("rm -f /var/db/rrd/*queues.rrd"); system("rm -f /var/db/rrd/*queues.rrd");
enable_rrd_graphing(); enable_rrd_graphing();
clear_subsystem_dirty('shaper'); clear_subsystem_dirty('shaper');
if ($queue) { if ($queue) {
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
$dontshow = false; $dontshow = false;
...@@ -305,7 +305,7 @@ if ($_GET) { ...@@ -305,7 +305,7 @@ if ($_GET) {
if (write_config()) if (write_config())
mark_subsystem_dirty('shaper'); mark_subsystem_dirty('shaper');
$dontshow = false; $dontshow = false;
} }
read_altq_config(); read_altq_config();
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
} else { } else {
...@@ -323,7 +323,7 @@ if ($queue) { ...@@ -323,7 +323,7 @@ if ($queue) {
$can_enable = true; $can_enable = true;
else else
$can_enable = false; $can_enable = false;
if ($queue->CanHaveChildren() && $can_enable) { if ($queue->CanHaveChildren() && $can_enable) {
if ($altq->GetQname() <> $queue->GetQname() && $queue->GetDefault() <> "") if ($altq->GetQname() <> $queue->GetQname() && $queue->GetDefault() <> "")
$can_add = false; $can_add = false;
else else
...@@ -350,7 +350,7 @@ $output_form .= "</td><td valign=\"middle\" class=\"vncellreq\" width=\"78%\"><b ...@@ -350,7 +350,7 @@ $output_form .= "</td><td valign=\"middle\" class=\"vncellreq\" width=\"78%\"><b
$output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"btn btn-primary\" />"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"btn btn-primary\" />";
if ($can_add || $addnewaltq) { if ($can_add || $addnewaltq) {
$output_form .= "<a href=\"firewall_shaper.php?interface="; $output_form .= "<a href=\"firewall_shaper.php?interface=";
$output_form .= $interface; $output_form .= $interface;
if ($queue) { if ($queue) {
$output_form .= "&amp;queue=" . $queue->GetQname(); $output_form .= "&amp;queue=" . $queue->GetQname();
} }
...@@ -373,7 +373,7 @@ $output_form .= "</a>"; ...@@ -373,7 +373,7 @@ $output_form .= "</a>";
$output_form .= "<br /></td></tr>"; $output_form .= "<br /></td></tr>";
$output_form .= "</table>"; $output_form .= "</table>";
} }
else else
$output_form .= "</table>"; $output_form .= "</table>";
$output = "<table summary=\"output form\">"; $output = "<table summary=\"output form\">";
...@@ -393,27 +393,27 @@ if ($queue) ...@@ -393,27 +393,27 @@ if ($queue)
echo $queue->build_javascript(); echo $queue->build_javascript();
echo $newjavascript; echo $newjavascript;
include("fbegin.inc"); 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">
<div id="inputerrors"></div> <div id="inputerrors"></div>
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?> <?php if (is_subsystem_dirty('shaper')): ?>
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br /> <?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[0] = array(gettext("By Interface"), true, "firewall_shaper.php"); $tab_array[0] = array(gettext("By Interface"), true, "firewall_shaper.php");
$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
...@@ -422,15 +422,15 @@ include("fbegin.inc"); ...@@ -422,15 +422,15 @@ include("fbegin.inc");
$tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_shaper.php" method="post" name="iform" id="iform"> <form action="firewall_shaper.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<?php if (count($altq_list_queues) > 0): ?> <?php if (count($altq_list_queues) > 0): ?>
<tr class="tabcont"><td width="25%" align="left"> <tr class="tabcont"><td width="25%" align="left">
...@@ -442,16 +442,16 @@ include("fbegin.inc"); ...@@ -442,16 +442,16 @@ include("fbegin.inc");
<tr> <tr>
<td width="25%" valign="top" align="left" style="vertical-align:top"> <td width="25%" valign="top" align="left" style="vertical-align:top">
<?php <?php
echo $tree; echo $tree;
?> ?>
</td> </td>
<td width="75%" valign="top" align="center"> <td width="75%" valign="top" align="center">
<div id="shaperarea" style="position:relative"> <div id="shaperarea" style="position:relative">
<?php <?php
echo $output; echo $output;
?> ?>
</div> </div>
</td></tr> </td></tr>
</table> </table>
</div> </div>
...@@ -461,5 +461,5 @@ include("fbegin.inc"); ...@@ -461,5 +461,5 @@ include("fbegin.inc");
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -391,31 +391,31 @@ function removeRow(tbl,row) { ...@@ -391,31 +391,31 @@ function removeRow(tbl,row) {
<body> <body>
<? <?
$main_buttons = array( $main_buttons = array(
array('label'=>gettext("Create new l7 rules group"), 'href'=>'firewall_shaper_layer7.php?action=add'), array('label'=>gettext("Create new l7 rules group"), 'href'=>'firewall_shaper_layer7.php?action=add'),
); );
include("fbegin.inc"); 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">
<div id="inputerrors"></div> <div id="inputerrors"></div>
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?><p> <?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p> <?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p>
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
...@@ -424,34 +424,34 @@ include("fbegin.inc"); ...@@ -424,34 +424,34 @@ include("fbegin.inc");
$tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_shaper_layer7.php" method="post" name="iform" id="iform"> <form action="firewall_shaper_layer7.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<?php if (count($layer7_rules_list) > 0): ?> <?php if (count($layer7_rules_list) > 0): ?>
<tr class="tabcont"><td width="25%" align="left"> <tr class="tabcont"><td width="25%" align="left">
</td><td width="75%"> </td></tr> </td><td width="75%"> </td></tr>
<?php endif; ?> <?php endif; ?>
<tr> <tr>
<td width="25%" valign="top" align="left"> <td width="25%" valign="top" align="left">
<?php <?php
echo $tree; echo $tree;
?> ?>
</td> </td>
<td width="75%" valign="top" align="center"> <td width="75%" valign="top" align="center">
<div id="shaperarea" style="position:relative"> <div id="shaperarea" style="position:relative">
<?php <?php
echo $output; echo $output;
?> ?>
<!-- Layer 7 rules form --> <!-- Layer 7 rules form -->
<?php if($show_proto_form): ?> <?php if($show_proto_form): ?>
<tr><td width="22%" valign="top" class="vncellreq"> <tr><td width="22%" valign="top" class="vncellreq">
...@@ -459,11 +459,11 @@ include("fbegin.inc"); ...@@ -459,11 +459,11 @@ include("fbegin.inc");
<?=gettext("Rule(s)"); ?> <?=gettext("Rule(s)"); ?>
</div> </div>
</td> </td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table width="236" id="maintable" summary="main table"> <table width="236" id="maintable" summary="main table">
<tbody> <tbody>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<div style="font-size: 8pt; padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066;" <div style="font-size: 8pt; padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066;"
...@@ -472,7 +472,7 @@ include("fbegin.inc"); ...@@ -472,7 +472,7 @@ include("fbegin.inc");
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<div style="font-size: 8pt; padding:5px;" <div style="font-size: 8pt; padding:5px;"
...@@ -480,14 +480,14 @@ include("fbegin.inc"); ...@@ -480,14 +480,14 @@ include("fbegin.inc");
<?=gettext("Protocol"); ?> <?=gettext("Protocol"); ?>
</div> </div>
</td> </td>
<td> <td>
<div style="font-size: 8pt; padding:5px;" <div style="font-size: 8pt; padding:5px;"
id="twocolumn"> id="twocolumn">
<?=gettext("Structure"); ?> <?=gettext("Structure"); ?>
</div> </div>
</td> </td>
<td> <td>
<div style="font-size: 8pt; padding:5px;" <div style="font-size: 8pt; padding:5px;"
id="threecolumn"> id="threecolumn">
...@@ -556,29 +556,29 @@ include("fbegin.inc"); ...@@ -556,29 +556,29 @@ include("fbegin.inc");
<a onclick="removeRow('maintable',this.parentNode.parentNode); return false;" href="#" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a> <a onclick="removeRow('maintable',this.parentNode.parentNode); return false;" href="#" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
<?php <?php
} //end foreach } //end foreach
} //end if } //end if
?> ?>
</tbody> </tbody>
</table> </table>
<a onclick="javascript:addRow('maintable'); return false;" href="#" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a><br/><br/> <a onclick="javascript:addRow('maintable'); return false;" href="#" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></a><br/><br/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top"> <td width="22%" valign="top">
&nbsp; &nbsp;
</td> </td>
<td width="78%"> <td width="78%">
<input id="submit" name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input id="submit" name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<a href="firewall_shaper_layer7.php"> <a href="firewall_shaper_layer7.php">
<input id="cancelbutton" name="cancelbutton" type="button" class="btn btn-default" value="<?=gettext("Cancel"); ?>" /> <input id="cancelbutton" name="cancelbutton" type="button" class="btn btn-default" value="<?=gettext("Cancel"); ?>" />
<?php if($container): ?> <?php if($container): ?>
<input id="delete" type="submit" class="formbtn" name="delete" value="<?=gettext("Delete"); ?>" /> <input id="delete" type="submit" class="formbtn" name="delete" value="<?=gettext("Delete"); ?>" />
<?php endif ?> <?php endif ?>
...@@ -597,4 +597,4 @@ include("fbegin.inc"); ...@@ -597,4 +597,4 @@ include("fbegin.inc");
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -54,7 +54,7 @@ $shaperIFlist = get_configured_interface_with_descr(); ...@@ -54,7 +54,7 @@ $shaperIFlist = get_configured_interface_with_descr();
read_altq_config(); read_altq_config();
$qlist =& get_unique_queue_list(); $qlist =& get_unique_queue_list();
if (!is_array($qlist)) if (!is_array($qlist))
$qlist = array(); $qlist = array();
$tree = "<ul class=\"tree\" >"; $tree = "<ul class=\"tree\" >";
...@@ -62,14 +62,14 @@ foreach ($qlist as $queue => $qkey) { ...@@ -62,14 +62,14 @@ foreach ($qlist as $queue => $qkey) {
$tree .= "<li><a href=\"firewall_shaper_queues.php?queue={$queue}&amp;action=show\" >"; $tree .= "<li><a href=\"firewall_shaper_queues.php?queue={$queue}&amp;action=show\" >";
if (isset($shaperIFlist[$queue])) if (isset($shaperIFlist[$queue]))
$tree .= $shaperIFlist[$queue] . "</a></li>"; $tree .= $shaperIFlist[$queue] . "</a></li>";
else else
$tree .= $queue . "</a></li>"; $tree .= $queue . "</a></li>";
} }
$tree .= "</ul>"; $tree .= "</ul>";
if ($_GET) { if ($_GET) {
if ($_GET['queue']) if ($_GET['queue'])
$qname = htmlspecialchars(trim($_GET['queue'])); $qname = htmlspecialchars(trim($_GET['queue']));
if ($_GET['interface']) if ($_GET['interface'])
$interface = htmlspecialchars(trim($_GET['interface'])); $interface = htmlspecialchars(trim($_GET['interface']));
if ($_GET['action']) if ($_GET['action'])
...@@ -80,7 +80,7 @@ if ($_GET) { ...@@ -80,7 +80,7 @@ if ($_GET) {
$altq =& $altq_list_queues[$interface]; $altq =& $altq_list_queues[$interface];
$qtmp =& $altq->find_queue("", $qname); $qtmp =& $altq->find_queue("", $qname);
if ($qtmp) { if ($qtmp) {
$qtmp->delete_queue(); $qtmp->delete_queue();
if (write_config()) if (write_config())
mark_subsystem_dirty('shaper'); mark_subsystem_dirty('shaper');
} }
...@@ -88,7 +88,7 @@ if ($_GET) { ...@@ -88,7 +88,7 @@ if ($_GET) {
exit; exit;
break; break;
case "add": case "add":
/* /*
* XXX: WARNING: This returns the first it finds. * XXX: WARNING: This returns the first it finds.
* Maybe the user expects something else?! * Maybe the user expects something else?!
*/ */
...@@ -102,7 +102,7 @@ if ($_GET) { ...@@ -102,7 +102,7 @@ if ($_GET) {
$config['shaper']['queue'][] = $copycfg; $config['shaper']['queue'][] = $copycfg;
} else if ($aq) { } else if ($aq) {
$tmp1 =& $qtmp->find_parentqueue($interface, $qname); $tmp1 =& $qtmp->find_parentqueue($interface, $qname);
if ($tmp1) if ($tmp1)
$tmp =& $aq->find_queue($interface, $tmp1->GetQname()); $tmp =& $aq->find_queue($interface, $tmp1->GetQname());
if ($tmp) if ($tmp)
...@@ -161,7 +161,7 @@ if ($_POST['apply']) { ...@@ -161,7 +161,7 @@ if ($_POST['apply']) {
else else
$savemsg = $retval; $savemsg = $retval;
/* reset rrd queues */ /* reset rrd queues */
system("rm -f /var/db/rrd/*queuedrops.rrd"); system("rm -f /var/db/rrd/*queuedrops.rrd");
system("rm -f /var/db/rrd/*queues.rrd"); system("rm -f /var/db/rrd/*queues.rrd");
enable_rrd_graphing(); enable_rrd_graphing();
...@@ -183,21 +183,21 @@ include("head.inc"); ...@@ -183,21 +183,21 @@ include("head.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">
<div id="inputerrors"></div> <div id="inputerrors"></div>
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?><p> <?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p> <?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br /></p>
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
$tab_array[1] = array(gettext("By Queue"), true, "firewall_shaper_queues.php"); $tab_array[1] = array(gettext("By Queue"), true, "firewall_shaper_queues.php");
...@@ -206,13 +206,13 @@ include("head.inc"); ...@@ -206,13 +206,13 @@ include("head.inc");
$tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_shaper_queues.php" method="post" name="iform" id="iform"> <form action="firewall_shaper_queues.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -220,14 +220,14 @@ include("head.inc"); ...@@ -220,14 +220,14 @@ include("head.inc");
<?php echo $tree; ?> <?php echo $tree; ?>
</td> </td>
<td width="70%" valign="top" align="center"> <td width="70%" valign="top" align="center">
<?php <?php
if ($qname) if ($qname)
echo "<p class=\"pgtitle\">" . $qname . "</p><br />"; echo "<p class=\"pgtitle\">" . $qname . "</p><br />";
echo "<table align=\"center\" class=\"tabcont\" width=\"80%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\" summary=\"output form\">"; echo "<table align=\"center\" class=\"tabcont\" width=\"80%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\" summary=\"output form\">";
echo $output; echo $output;
echo "<tr><td>&nbsp;</td></tr>"; echo "<tr><td>&nbsp;</td></tr>";
echo "</table>"; echo "</table>";
?> ?>
</td></tr> </td></tr>
</table><!-- table:main area --> </table><!-- table:main area -->
</div><!-- div:main area --> </div><!-- div:main area -->
...@@ -237,6 +237,6 @@ include("head.inc"); ...@@ -237,6 +237,6 @@ include("head.inc");
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?>
\ No newline at end of file <?php include("foot.inc"); ?>
...@@ -54,14 +54,14 @@ $pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Limiter ...@@ -54,14 +54,14 @@ $pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Limiter
$shortcut_section = "trafficshaper-limiters"; $shortcut_section = "trafficshaper-limiters";
read_dummynet_config(); read_dummynet_config();
/* /*
* The whole logic in these code maybe can be specified. * The whole logic in these code maybe can be specified.
* If you find a better way contact me :). * If you find a better way contact me :).
*/ */
if ($_GET) { if ($_GET) {
if ($_GET['queue']) if ($_GET['queue'])
$qname = htmlspecialchars(trim($_GET['queue'])); $qname = htmlspecialchars(trim($_GET['queue']));
if ($_GET['pipe']) if ($_GET['pipe'])
$pipe = htmlspecialchars(trim($_GET['pipe'])); $pipe = htmlspecialchars(trim($_GET['pipe']));
if ($_GET['action']) if ($_GET['action'])
...@@ -69,11 +69,11 @@ if ($_GET) { ...@@ -69,11 +69,11 @@ if ($_GET) {
} }
if ($_POST) { if ($_POST) {
if ($_POST['name']) if ($_POST['name'])
$qname = htmlspecialchars(trim($_POST['name'])); $qname = htmlspecialchars(trim($_POST['name']));
else if ($_POST['newname']) else if ($_POST['newname'])
$qname = htmlspecialchars(trim($_POST['newname'])); $qname = htmlspecialchars(trim($_POST['newname']));
if ($_POST['pipe']) if ($_POST['pipe'])
$pipe = htmlspecialchars(trim($_POST['pipe'])); $pipe = htmlspecialchars(trim($_POST['pipe']));
else else
$pipe = htmlspecialchars(trim($qname)); $pipe = htmlspecialchars(trim($qname));
if ($_POST['parentqueue']) if ($_POST['parentqueue'])
...@@ -155,7 +155,7 @@ if ($_GET) { ...@@ -155,7 +155,7 @@ if ($_GET) {
} else if ($addnewpipe) { } else if ($addnewpipe) {
$q = new dnpipe_class(); $q = new dnpipe_class();
$q->SetQname($pipe); $q->SetQname($pipe);
} else } else
$input_errors[] = gettext("Could not create new queue/discipline!"); $input_errors[] = gettext("Could not create new queue/discipline!");
if ($q) { if ($q) {
...@@ -166,7 +166,7 @@ if ($_GET) { ...@@ -166,7 +166,7 @@ if ($_GET) {
} }
break; break;
case "show": case "show":
if ($queue) if ($queue)
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
else else
$input_errors[] = gettext("Queue not found!"); $input_errors[] = gettext("Queue not found!");
...@@ -204,7 +204,7 @@ if ($_GET) { ...@@ -204,7 +204,7 @@ if ($_GET) {
$input_errors[] = gettext("You cannot name a child queue with the same name as a parent limiter"); $input_errors[] = gettext("You cannot name a child queue with the same name as a parent limiter");
else { else {
$dnpipe =& new dnpipe_class(); $dnpipe =& new dnpipe_class();
$dnpipe->ReadConfig($_POST); $dnpipe->ReadConfig($_POST);
$dnpipe->validate_input($_POST, $input_errors); $dnpipe->validate_input($_POST, $input_errors);
if (!$input_errors) { if (!$input_errors) {
...@@ -212,7 +212,7 @@ if ($_GET) { ...@@ -212,7 +212,7 @@ if ($_GET) {
$dnpipe->SetNumber($number); $dnpipe->SetNumber($number);
unset($tmppath); unset($tmppath);
$tmppath[] = $dnpipe->GetQname(); $tmppath[] = $dnpipe->GetQname();
$dnpipe->SetLink($tmppath); $dnpipe->SetLink($tmppath);
$dnpipe->wconfig(); $dnpipe->wconfig();
if (write_config()) if (write_config())
mark_subsystem_dirty('shaper'); mark_subsystem_dirty('shaper');
...@@ -250,17 +250,17 @@ if ($_GET) { ...@@ -250,17 +250,17 @@ if ($_GET) {
$retval = 0; $retval = 0;
$retval = filter_configure(); $retval = filter_configure();
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
if (stristr($retval, "error") <> true) if (stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
else else
$savemsg = $retval; $savemsg = $retval;
/* XXX: TODO Make dummynet pretty graphs */ /* XXX: TODO Make dummynet pretty graphs */
// enable_rrd_graphing(); // enable_rrd_graphing();
clear_subsystem_dirty('shaper'); clear_subsystem_dirty('shaper');
if ($queue) { if ($queue) {
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
$dontshow = false; $dontshow = false;
...@@ -278,7 +278,7 @@ if ($_GET) { ...@@ -278,7 +278,7 @@ if ($_GET) {
if (write_config()) if (write_config())
mark_subsystem_dirty('shaper'); mark_subsystem_dirty('shaper');
$dontshow = false; $dontshow = false;
} }
read_dummynet_config(); read_dummynet_config();
$output_form .= $queue->build_form(); $output_form .= $queue->build_form();
} else { } else {
...@@ -295,8 +295,8 @@ if ($queue) { ...@@ -295,8 +295,8 @@ if ($queue) {
$can_enable = true; $can_enable = true;
else else
$can_enable = false; $can_enable = false;
if ($queue->CanHaveChildren()) { if ($queue->CanHaveChildren()) {
$can_add = true; $can_add = true;
} else } else
$can_add = false; $can_add = false;
} }
...@@ -318,7 +318,7 @@ $output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">"; ...@@ -318,7 +318,7 @@ $output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">";
$output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"btn btn-primary\" />"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"btn btn-primary\" />";
if ($can_add || $addnewaltq) { if ($can_add || $addnewaltq) {
$output_form .= "<a href=\"firewall_shaper_vinterface.php?pipe="; $output_form .= "<a href=\"firewall_shaper_vinterface.php?pipe=";
$output_form .= $pipe; $output_form .= $pipe;
if ($queue) { if ($queue) {
$output_form .= "&amp;queue=" . $queue->GetQname(); $output_form .= "&amp;queue=" . $queue->GetQname();
} }
...@@ -337,11 +337,11 @@ if ($queue) ...@@ -337,11 +337,11 @@ if ($queue)
$output_form .= " value=\"" . gettext("Delete this queue") ."\" />"; $output_form .= " value=\"" . gettext("Delete this queue") ."\" />";
else else
$output_form .= " value=\"" . gettext("Delete Limiter") ."\" />"; $output_form .= " value=\"" . gettext("Delete Limiter") ."\" />";
$output_form .= "</a>"; $output_form .= "</a>";
$output_form .= "</td></tr>"; $output_form .= "</td></tr>";
$output_form .= "</table>"; $output_form .= "</table>";
} }
else else
$output_form .= "</table>"; $output_form .= "</table>";
$output = "<table summary=\"output form\">"; $output = "<table summary=\"output form\">";
...@@ -372,33 +372,33 @@ if ($queue) ...@@ -372,33 +372,33 @@ if ($queue)
echo $queue->build_javascript(); echo $queue->build_javascript();
else else
echo $newjavascript; echo $newjavascript;
$main_buttons = array( $main_buttons = array(
array('label'=>gettext("Create new limiter"), 'href'=>'firewall_shaper_vinterface.php?pipe=new&amp;action=add'), array('label'=>gettext("Create new limiter"), 'href'=>'firewall_shaper_vinterface.php?pipe=new&amp;action=add'),
); );
include("fbegin.inc");
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">
<div id="inputerrors"></div> <div id="inputerrors"></div>
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?><p> <?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br /></p> <?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br /></p>
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
...@@ -407,13 +407,13 @@ include("fbegin.inc"); ...@@ -407,13 +407,13 @@ include("fbegin.inc");
$tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_shaper_vinterface.php" method="post" name="iform" id="iform"> <form action="firewall_shaper_vinterface.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<?php if (count($dummynet_pipe_list) > 0): ?> <?php if (count($dummynet_pipe_list) > 0): ?>
...@@ -423,17 +423,17 @@ include("fbegin.inc"); ...@@ -423,17 +423,17 @@ include("fbegin.inc");
<tr> <tr>
<td width="25%" valign="top" align="left"> <td width="25%" valign="top" align="left">
<?php <?php
echo $tree; echo $tree;
?> ?>
</td> </td>
<td width="75%" valign="top" align="center"> <td width="75%" valign="top" align="center">
<div id="shaperarea" style="position:relative"> <div id="shaperarea" style="position:relative">
<?php <?php
echo $output; echo $output;
?> ?>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -444,16 +444,16 @@ include("fbegin.inc"); ...@@ -444,16 +444,16 @@ include("fbegin.inc");
</div> </div>
</div> </div>
</section> </section>
<script type='text/javascript'> <script type='text/javascript'>
//<![CDATA[ //<![CDATA[
<?php <?php
$totalrows = 0; $totalrows = 0;
if (is_array($config['dnshaper']) && is_array($config['dnshaper']['queue'])) if (is_array($config['dnshaper']) && is_array($config['dnshaper']['queue']))
$totalrows = count($config['dnshaper']['queue']); $totalrows = count($config['dnshaper']['queue']);
echo "totalrows = {$totalrows}"; echo "totalrows = {$totalrows}";
?> ?>
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -88,19 +88,19 @@ include("head.inc"); ...@@ -88,19 +88,19 @@ include("head.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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('shaper')): ?><p> <?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br /></p> <?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));?><br /></p>
<?php endif; ?> <?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
$tab_array = array(); $tab_array = array();
$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
...@@ -109,22 +109,22 @@ include("head.inc"); ...@@ -109,22 +109,22 @@ include("head.inc");
$tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php"); $tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_shaper_wizards.php" method="post" name="iform" id="iform"> <form action="firewall_shaper_wizards.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<thead> <thead>
<tr> <tr>
<td class="listhdrr" width="25%"><?=gettext("Wizard function");?></td> <td class="listhdrr" width="25%"><?=gettext("Wizard function");?></td>
<td class="listhdrr" width="75%"><?=gettext("Wizard Link");?></td> <td class="listhdrr" width="75%"><?=gettext("Wizard Link");?></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach ($wizards as $key => $wizard): foreach ($wizards as $key => $wizard):
?> ?>
...@@ -151,5 +151,5 @@ include("head.inc"); ...@@ -151,5 +151,5 @@ include("head.inc");
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -68,21 +68,21 @@ if ($_POST) { ...@@ -68,21 +68,21 @@ if ($_POST) {
if (!empty($ovip)) if (!empty($ovip))
interface_vip_bring_down($ovip); interface_vip_bring_down($ovip);
if ($a_vip[$vid]) { if ($a_vip[$vid]) {
switch ($a_vip[$vid]['mode']) { switch ($a_vip[$vid]['mode']) {
case "ipalias": case "ipalias":
interface_ipalias_configure($a_vip[$vid]); interface_ipalias_configure($a_vip[$vid]);
break; break;
case "proxyarp": case "proxyarp":
interface_proxyarp_configure($a_vip[$vid]['interface']); interface_proxyarp_configure($a_vip[$vid]['interface']);
break; break;
case "carp": case "carp":
interface_carp_configure($a_vip[$vid]); interface_carp_configure($a_vip[$vid]);
break;
default:
break; break;
default:
break;
} }
} }
} }
@unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply"); @unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply");
} }
$retval = 0; $retval = 0;
...@@ -147,7 +147,7 @@ if ($_GET['act'] == "del") { ...@@ -147,7 +147,7 @@ if ($_GET['act'] == "del") {
if ($subnet == $if_subnet) if ($subnet == $if_subnet)
$found_if = true; $found_if = true;
$vipiface = $a_vip[$_GET['id']]['interface']; $vipiface = $a_vip[$_GET['id']]['interface'];
foreach ($a_vip as $vip_id => $vip) { foreach ($a_vip as $vip_id => $vip) {
if ($vip_id == $_GET['id']) if ($vip_id == $_GET['id'])
...@@ -163,7 +163,7 @@ if ($_GET['act'] == "del") { ...@@ -163,7 +163,7 @@ if ($_GET['act'] == "del") {
if ($found_carp === true && $found_other_alias === false && $found_if === false) if ($found_carp === true && $found_other_alias === false && $found_if === false)
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}."; $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}.";
} }
if (!$input_errors) { if (!$input_errors) {
if (!session_id()) if (!session_id())
session_start(); session_start();
...@@ -197,7 +197,7 @@ $pgtitle = array(gettext("Firewall"),gettext("Virtual IP Addresses")); ...@@ -197,7 +197,7 @@ $pgtitle = array(gettext("Firewall"),gettext("Virtual IP Addresses"));
include("head.inc"); include("head.inc");
$main_buttons = array( $main_buttons = array(
array('href'=>'firewall_virtual_ip_edit.php', 'label'=>'Add'), array('href'=>'firewall_virtual_ip_edit.php', 'label'=>'Add'),
); );
?> ?>
...@@ -205,41 +205,41 @@ $main_buttons = array( ...@@ -205,41 +205,41 @@ $main_buttons = array(
<?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 ($input_errors) if ($input_errors)
print_input_errors($input_errors); print_input_errors($input_errors);
else else
if ($savemsg) if ($savemsg)
print_info_box($savemsg); print_info_box($savemsg);
else else
if (is_subsystem_dirty('vip')) if (is_subsystem_dirty('vip'))
print_info_box_np(gettext("The VIP configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect.")); print_info_box_np(gettext("The VIP configuration has been changed.")."<br />".gettext("You must apply the changes in order for them to take effect."));
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<?php <?php
/* active tabs */ /* active tabs */
$tab_array = array(); $tab_array = array();
$tab_array[] = array(gettext("Virtual IPs"), true, "firewall_virtual_ip.php"); $tab_array[] = array(gettext("Virtual IPs"), true, "firewall_virtual_ip.php");
$tab_array[] = array(gettext("CARP Settings"), false, "system_hasync.php"); $tab_array[] = array(gettext("CARP Settings"), false, "system_hasync.php");
display_top_tabs($tab_array); display_top_tabs($tab_array);
?> ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form action="firewall_virtual_ip.php" method="post" name="iform" id="iform"> <form action="firewall_virtual_ip.php" method="post" name="iform" id="iform">
<input type="hidden" id="id" name="id" value="<?php echo htmlspecialchars($id); ?>" /> <input type="hidden" id="id" name="id" value="<?php echo htmlspecialchars($id); ?>" />
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<thead> <thead>
<tr> <tr>
<td width="30%" class="listhdrr"><?=gettext("Virtual IP address");?></td> <td width="30%" class="listhdrr"><?=gettext("Virtual IP address");?></td>
<td width="10%" class="listhdrr"><?=gettext("Interface");?></td> <td width="10%" class="listhdrr"><?=gettext("Interface");?></td>
...@@ -247,8 +247,8 @@ $main_buttons = array( ...@@ -247,8 +247,8 @@ $main_buttons = array(
<td width="40%" class="listhdr"><?=gettext("Description");?></td> <td width="40%" class="listhdr"><?=gettext("Description");?></td>
<td width="10%" class="list"></td> <td width="10%" class="list"></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$interfaces = get_configured_interface_with_descr(false, true); $interfaces = get_configured_interface_with_descr(false, true);
$interfaces['lo0'] = "Localhost"; $interfaces['lo0'] = "Localhost";
...@@ -280,7 +280,7 @@ $main_buttons = array( ...@@ -280,7 +280,7 @@ $main_buttons = array(
<tr> <tr>
<td valign="middle"> <td valign="middle">
<a href="firewall_virtual_ip_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit" title="<?=gettext("Edit");?>"></span></a> <a href="firewall_virtual_ip_edit.php?id=<?=$i;?>" class="btn btn-default"><span class="glyphicon glyphicon-edit" title="<?=gettext("Edit");?>"></span></a>
<a href="firewall_virtual_ip.php?act=del&amp;tab=<?=$tab;?>&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><span class="glyphicon glyphicon-remove"></span></a> <a href="firewall_virtual_ip.php?act=del&amp;tab=<?=$tab;?>&amp;id=<?=$i;?>" class="btn btn-default" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
...@@ -289,7 +289,7 @@ $main_buttons = array( ...@@ -289,7 +289,7 @@ $main_buttons = array(
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php $i++; endforeach; ?> <?php $i++; endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
...@@ -303,5 +303,5 @@ $main_buttons = array( ...@@ -303,5 +303,5 @@ $main_buttons = array(
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -74,7 +74,7 @@ function find_last_used_vhid() { ...@@ -74,7 +74,7 @@ function find_last_used_vhid() {
global $config, $g; global $config, $g;
$vhid = 0; $vhid = 0;
foreach($config['virtualip']['vip'] as $vip) { foreach($config['virtualip']['vip'] as $vip) {
if($vip['vhid'] > $vhid) if($vip['vhid'] > $vhid)
$vhid = $vip['vhid']; $vhid = $vip['vhid'];
} }
return $vhid; return $vhid;
...@@ -263,7 +263,7 @@ include("head.inc"); ...@@ -263,7 +263,7 @@ include("head.inc");
<body> <body>
<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script> <script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript"> <script type="text/javascript">
...@@ -287,15 +287,15 @@ function enable_change() { ...@@ -287,15 +287,15 @@ function enable_change() {
var carpnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>"); var carpnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
var proxyarpnote = document.createTextNode("<?=gettext("This is a CIDR block of proxy ARP addresses.");?>"); var proxyarpnote = document.createTextNode("<?=gettext("This is a CIDR block of proxy ARP addresses.");?>");
var ipaliasnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>"); var ipaliasnote = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
$mode = get_radio_value(document.iform.mode); $mode = get_radio_value(document.iform.mode);
document.iform.password.disabled = $mode != "carp"; document.iform.password.disabled = $mode != "carp";
document.iform.vhid.disabled = $mode != "carp"; document.iform.vhid.disabled = $mode != "carp";
document.iform.advskew.disabled = $mode != "carp"; document.iform.advskew.disabled = $mode != "carp";
document.iform.advbase.disabled = $mode != "carp"; document.iform.advbase.disabled = $mode != "carp";
document.iform.type.disabled = $mode in {"carp":1,"ipalias":1}; document.iform.type.disabled = $mode in {"carp":1,"ipalias":1};
if ($mode in {"carp":1,"ipalias":1}) if ($mode in {"carp":1,"ipalias":1})
document.iform.type.selectedIndex = 0;// single-adress document.iform.type.selectedIndex = 0;// single-adress
switch($mode) switch($mode)
...@@ -346,29 +346,29 @@ function typesel_change() { ...@@ -346,29 +346,29 @@ function typesel_change() {
</script> </script>
<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 if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) print_input_errors($input_errors); ?>
<div id="inputerrors"></div> <div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Edit Virtual IP");?></h3> <h3><?=gettext("Edit Virtual IP");?></h3>
</header> </header>
<div class="content-box-main"> <div class="content-box-main">
<form action="firewall_virtual_ip_edit.php" method="post" name="iform" id="iform"> <form action="firewall_virtual_ip_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Type");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Type");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="mode" type="radio" onclick="enable_change()" value="ipalias" <input name="mode" type="radio" onclick="enable_change()" value="ipalias"
<?php if ($pconfig['mode'] == "ipalias") echo "checked=\"checked\"";?> /> <?=gettext("IP Alias");?> <?php if ($pconfig['mode'] == "ipalias") echo "checked=\"checked\"";?> /> <?=gettext("IP Alias");?>
...@@ -384,7 +384,7 @@ function typesel_change() { ...@@ -384,7 +384,7 @@ function typesel_change() {
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<select name="interface" class="form-control"> <select name="interface" class="form-control">
<?php <?php
$interfaces = get_configured_interface_with_descr(false, true); $interfaces = get_configured_interface_with_descr(false, true);
$interfaces['lo0'] = "Localhost"; $interfaces['lo0'] = "Localhost";
foreach ($interfaces as $iface => $ifacename): ?> foreach ($interfaces as $iface => $ifacename): ?>
...@@ -420,13 +420,13 @@ function typesel_change() { ...@@ -420,13 +420,13 @@ function typesel_change() {
</option> </option>
<?php endfor; ?> <?php endfor; ?>
</select> <i id="typenote"></i> </select> <i id="typenote"></i>
</td> </td>
</tr> </tr>
<tr id="noexpandrow"> <tr id="noexpandrow">
<td><?=gettext("Expansion:");?>&nbsp;&nbsp;</td> <td><?=gettext("Expansion:");?>&nbsp;&nbsp;</td>
<td><input name="noexpand" type="checkbox" class="form-control unknown" id="noexpand" <?php echo (isset($pconfig['noexpand'])) ? "checked=\"checked\"" : "" ; ?> /> <td><input name="noexpand" type="checkbox" class="form-control unknown" id="noexpand" <?php echo (isset($pconfig['noexpand'])) ? "checked=\"checked\"" : "" ; ?> />
Disable expansion of this entry into IPs on NAT lists (e.g. 192.168.1.0/24 expands to 256 entries.) Disable expansion of this entry into IPs on NAT lists (e.g. 192.168.1.0/24 expands to 256 entries.)
</td> </td>
</tr> </tr>
<?php <?php
/* /*
...@@ -437,7 +437,7 @@ function typesel_change() { ...@@ -437,7 +437,7 @@ function typesel_change() {
<input name="range_to" type="text" class="form-control unknown" id="range_to" size="28" value="<?=htmlspecialchars($pconfig['range']['to']);?>" /> <input name="range_to" type="text" class="form-control unknown" id="range_to" size="28" value="<?=htmlspecialchars($pconfig['range']['to']);?>" />
</td> </td>
</tr> </tr>
*/ */
?> ?>
</table> </table>
</td> </td>
...@@ -465,18 +465,18 @@ function typesel_change() { ...@@ -465,18 +465,18 @@ function typesel_change() {
<td class="vtable"> <td class="vtable">
Base: <select id='advbase' name='advbase'> Base: <select id='advbase' name='advbase'>
<?php for ($i = 1; $i <= 254; $i++): ?> <?php for ($i = 1; $i <= 254; $i++): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['advbase']) echo "selected=\"selected\""; ?>> <option value="<?=$i;?>" <?php if ($i == $pconfig['advbase']) echo "selected=\"selected\""; ?>>
<?=$i;?> <?=$i;?>
</option> </option>
<?php endfor; ?> <?php endfor; ?>
</select> </select>
Skew: <select id='advskew' name='advskew'> Skew: <select id='advskew' name='advskew'>
<?php for ($i = 0; $i <= 254; $i++): ?> <?php for ($i = 0; $i <= 254; $i++): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected=\"selected\""; ?>> <option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected=\"selected\""; ?>>
<?=$i;?> <?=$i;?>
</option> </option>
<?php endfor; ?> <?php endfor; ?>
</select> </select>
<br /><br /> <br /><br />
<?=gettext("The frequency that this machine will advertise. 0 means usually master. Otherwise the lowest combination of both values in the cluster determines the master.");?> <?=gettext("The frequency that this machine will advertise. 0 means usually master. Otherwise the lowest combination of both values in the cluster determines the master.");?>
</td> </td>
...@@ -501,16 +501,16 @@ function typesel_change() { ...@@ -501,16 +501,16 @@ function typesel_change() {
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<p class="vexpl"> <p class="vexpl">
<span class="text-danger"> <span class="text-danger">
<strong><?=gettext("Note:");?><br /></strong> <strong><?=gettext("Note:");?><br /></strong>
</span> </span>
<?=gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc. Use a CARP or IP Alias type address for these cases.");?> <?=gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc. Use a CARP or IP Alias type address for these cases.");?>
<br /><br /><?=gettext("For more information on CARP and the above values, visit the OpenBSD ");?><a href='http://www.openbsd.org/faq/pf/carp.html'> <?=gettext("CARP FAQ"); ?></a>. <br /><br /><?=gettext("For more information on CARP and the above values, visit the OpenBSD ");?><a href='http://www.openbsd.org/faq/pf/carp.html'> <?=gettext("CARP FAQ"); ?></a>.
</p> </p>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
...@@ -521,4 +521,4 @@ function typesel_change() { ...@@ -521,4 +521,4 @@ function typesel_change() {
enable_change(); enable_change();
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
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