summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateway_groups.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-30 18:15:53 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-30 18:15:53 +0545
commite0c7b2feb9ccabdb54d885679666d7cdb90d9ccf (patch)
treef3b7f7842ae1befe81fede536a44c4959d5178f6 /usr/local/www/system_gateway_groups.php
parent5dcec9f242a94894086dd425ecf9d2f00ccdebd5 (diff)
downloadpfsense-e0c7b2feb9ccabdb54d885679666d7cdb90d9ccf.zip
pfsense-e0c7b2feb9ccabdb54d885679666d7cdb90d9ccf.tar.gz
Code style system g
Diffstat (limited to 'usr/local/www/system_gateway_groups.php')
-rw-r--r--usr/local/www/system_gateway_groups.php202
1 files changed, 114 insertions, 88 deletions
diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php
index 5de3930..aeb0bad 100644
--- a/usr/local/www/system_gateway_groups.php
+++ b/usr/local/www/system_gateway_groups.php
@@ -46,8 +46,9 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("openvpn.inc");
-if (!is_array($config['gateways']['gateway_group']))
+if (!is_array($config['gateways']['gateway_group'])) {
$config['gateways']['gateway_group'] = array();
+}
$a_gateway_groups = &$config['gateways']['gateway_group'];
$a_gateways = &$config['gateways']['gateway_item'];
@@ -68,8 +69,9 @@ if ($_POST) {
setup_gateways_monitor();
$savemsg = get_std_save_message($retval);
- if ($retval == 0)
+ if ($retval == 0) {
clear_subsystem_dirty('staticroutes');
+ }
foreach ($a_gateway_groups as $gateway_group) {
$gw_subsystem = 'gwgroup.' . $gateway_group['name'];
@@ -85,8 +87,9 @@ if ($_GET['act'] == "del") {
if ($a_gateway_groups[$_GET['id']]) {
$changedesc .= gettext("removed gateway group") . " {$_GET['id']}";
foreach ($config['filter']['rule'] as $idx => $rule) {
- if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name'])
+ if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name']) {
unset($config['filter']['rule'][$idx]['gateway']);
+ }
}
unset($a_gateway_groups[$_GET['id']]);
write_config($changedesc);
@@ -96,7 +99,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("System"),gettext("Gateway Groups"));
+$pgtitle = array(gettext("System"), gettext("Gateway Groups"));
$shortcut_section = "gateway-groups";
include("head.inc");
@@ -111,9 +114,9 @@ include("head.inc");
<?php if (is_subsystem_dirty('staticroutes')): ?><br/>
<?php print_info_box_np(sprintf(gettext("The gateway configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br />"));?><br /><br />
<?php endif; ?>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system groups">
- <tr>
- <td>
+<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system groups">
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[0] = array(gettext("Gateways"), false, "system_gateways.php");
@@ -121,89 +124,112 @@ include("head.inc");
$tab_array[2] = array(gettext("Groups"), true, "system_gateway_groups.php");
display_top_tabs($tab_array);
?>
-</td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
- <thead>
- <tr>
- <td width="15%" class="listhdrr"><?=gettext("Group Name");?></td>
- <td width="15%" class="listhdrr"><?=gettext("Gateways");?></td>
- <td width="20%" class="listhdrr"><?=gettext("Priority");?></td>
- <td width="30%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="icons">
- <tr>
- <td width="17"></td>
- <td><a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </thead>
- <tfoot>
- <tr><td class="list" colspan="4"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="edit">
- <tr>
- <td width="17"></td>
- <td><a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </tfoot>
- <tbody>
- <?php $i = 0; foreach ($a_gateway_groups as $gateway_group): ?>
- <tr>
- <td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
- <?php
- echo $gateway_group['name'];
- ?>
- </td>
- <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
- <?php
- foreach($gateway_group['item'] as $item) {
- $itemsplit = explode("|", $item);
- echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n";
- }
- ?>
- </td>
- <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
- <?php
- foreach($gateway_group['item'] as $item) {
- $itemsplit = explode("|", $item);
- echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n";
- }
- ?>
- </td>
- <td class="listbg" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($gateway_group['descr']);?>&nbsp;
- </td>
- <td valign="middle" class="list nowrap">
- <table border="0" cellspacing="0" cellpadding="1" summary="edit">
- <tr>
- <td><a href="system_gateway_groups_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- <td><a href="system_gateway_groups.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway group?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
- </tr>
- <tr>
- <td width="17"></td>
- <td><a href="system_gateway_groups_edit.php?dup=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="duplicate" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr style="display:none;"><td></td></tr>
- </tbody>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+ <thead>
+ <tr>
+ <td width="15%" class="listhdrr"><?=gettext("Group Name");?></td>
+ <td width="15%" class="listhdrr"><?=gettext("Gateways");?></td>
+ <td width="20%" class="listhdrr"><?=gettext("Priority");?></td>
+ <td width="30%" class="listhdr"><?=gettext("Description");?></td>
+ <td width="10%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="icons">
+ <tr>
+ <td width="17"></td>
+ <td>
+ <a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td class="list" colspan="4"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="edit">
+ <tr>
+ <td width="17"></td>
+ <td>
+ <a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="edit" /></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tfoot>
+ <tbody>
+<?php
+ $i = 0;
+ foreach ($a_gateway_groups as $gateway_group):
+?>
+ <tr>
+ <td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
+ <?php
+ echo $gateway_group['name'];
+ ?>
+ </td>
+ <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
+ <?php
+ foreach ($gateway_group['item'] as $item) {
+ $itemsplit = explode("|", $item);
+ echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n";
+ }
+ ?>
+ </td>
+ <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
+ <?php
+ foreach ($gateway_group['item'] as $item) {
+ $itemsplit = explode("|", $item);
+ echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n";
+ }
+ ?>
+ </td>
+ <td class="listbg" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
+ <?=htmlspecialchars($gateway_group['descr']);?>&nbsp;
+ </td>
+ <td valign="middle" class="list nowrap">
+ <table border="0" cellspacing="0" cellpadding="1" summary="edit">
+ <tr>
+ <td>
+ <a href="system_gateway_groups_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
+ </td>
+ <td>
+ <a href="system_gateway_groups.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway group?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a>
+ </td>
+ </tr>
+ <tr>
+ <td width="17"></td>
+ <td>
+ <a href="system_gateway_groups_edit.php?dup=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="duplicate" /></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<?php
+ $i++;
+ endforeach;
+?>
+ <tr style="display:none;">
+ <td></td>
+ </tr>
+ </tbody>
</table>
</div>
- </td>
- </tr>
- </table>
- </form>
- <p><b><?=gettext("Note:");?></b> <?=gettext("Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, or policy-based routing. Without rules directing traffic into the Gateway Groups, they will not be used.");?></p>
+ </td>
+ </tr>
+</table>
+</form>
+<p>
+ <b><?=gettext("Note:");?></b>
+ <?=gettext("Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, or policy-based routing. Without rules directing traffic into the Gateway Groups, they will not be used.");?>
+</p>
<?php include("fend.inc"); ?>
</body>
</html>
OpenPOWER on IntegriCloud