Commit 27a06305 authored by Franco Fichtner's avatar Franco Fichtner

system/gateway: style sweep

parent d32c7402
...@@ -50,11 +50,9 @@ $a_gateways = &$config['gateways']['gateway_item']; ...@@ -50,11 +50,9 @@ $a_gateways = &$config['gateways']['gateway_item'];
$changedesc = gettext("Gateway Groups") . ": "; $changedesc = gettext("Gateway Groups") . ": ";
if ($_POST) { if ($_POST) {
$pconfig = $_POST; $pconfig = $_POST;
if ($_POST['apply']) { if ($_POST['apply']) {
$retval = 0; $retval = 0;
$retval = system_routing_configure(); $retval = system_routing_configure();
...@@ -67,8 +65,9 @@ if ($_POST) { ...@@ -67,8 +65,9 @@ if ($_POST) {
setup_gateways_monitor(); setup_gateways_monitor();
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
if ($retval == 0) if ($retval == 0) {
clear_subsystem_dirty('staticroutes'); clear_subsystem_dirty('staticroutes');
}
foreach ($a_gateway_groups as $gateway_group) { foreach ($a_gateway_groups as $gateway_group) {
$gw_subsystem = 'gwgroup.' . $gateway_group['name']; $gw_subsystem = 'gwgroup.' . $gateway_group['name'];
...@@ -84,9 +83,10 @@ if ($_GET['act'] == "del") { ...@@ -84,9 +83,10 @@ if ($_GET['act'] == "del") {
if ($a_gateway_groups[$_GET['id']]) { if ($a_gateway_groups[$_GET['id']]) {
$changedesc .= gettext("removed gateway group") . " {$_GET['id']}"; $changedesc .= gettext("removed gateway group") . " {$_GET['id']}";
foreach ($config['filter']['rule'] as $idx => $rule) { 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($config['filter']['rule'][$idx]['gateway']);
} }
}
unset($a_gateway_groups[$_GET['id']]); unset($a_gateway_groups[$_GET['id']]);
write_config($changedesc); write_config($changedesc);
mark_subsystem_dirty('staticroutes'); mark_subsystem_dirty('staticroutes');
...@@ -114,10 +114,14 @@ $main_buttons = array( ...@@ -114,10 +114,14 @@ $main_buttons = array(
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) {
<?php if (is_subsystem_dirty('staticroutes')): ?><br/> print_info_box($savemsg);
} ?>
<?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 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; ?> <?php
endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -144,7 +148,8 @@ $main_buttons = array( ...@@ -144,7 +148,8 @@ $main_buttons = array(
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php $i = 0; foreach ($a_gateway_groups as $gateway_group): ?> <?php $i = 0; foreach ($a_gateway_groups as $gateway_group) :
?>
<tr> <tr>
<td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';"> <td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php <?php
...@@ -153,7 +158,7 @@ $main_buttons = array( ...@@ -153,7 +158,7 @@ $main_buttons = array(
</td> </td>
<td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';"> <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php <?php
foreach($gateway_group['item'] as $item) { foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item); $itemsplit = explode("|", $item);
echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n"; echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n";
} }
...@@ -161,7 +166,7 @@ $main_buttons = array( ...@@ -161,7 +166,7 @@ $main_buttons = array(
</td> </td>
<td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';"> <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php <?php
foreach($gateway_group['item'] as $item) { foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item); $itemsplit = explode("|", $item);
echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n"; echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n";
} }
...@@ -174,7 +179,8 @@ $main_buttons = array( ...@@ -174,7 +179,8 @@ $main_buttons = array(
<table border="0" cellspacing="0" cellpadding="1" summary="edit"> <table border="0" cellspacing="0" cellpadding="1" summary="edit">
<tr> <tr>
<td><a href="system_gateway_groups_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a></td> <td><a href="system_gateway_groups_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></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?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></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?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
<tr> <tr>
<td width="17"></td> <td width="17"></td>
...@@ -183,12 +189,15 @@ $main_buttons = array( ...@@ -183,12 +189,15 @@ $main_buttons = array(
</table> </table>
</td> </td>
</tr> </tr>
<?php $i++; endforeach; ?> <?php $i++;
endforeach; ?>
<tr style="display:none;"><td></td></tr> <tr style="display:none;"><td></td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<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> <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>
</form> </form>
</div> </div>
...@@ -199,4 +208,4 @@ $main_buttons = array( ...@@ -199,4 +208,4 @@ $main_buttons = array(
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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