diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-04-02 12:33:50 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-04-02 12:34:43 -0300 |
commit | ac7f1763e1712dd85335f09d0434444cee2a6683 (patch) | |
tree | 1783297632dbc286b067fd7e7ff47a92e9e3911b | |
parent | 9db1ff32c7005da50baf78e089608e7eb72eae9a (diff) | |
download | pfsense-ac7f1763e1712dd85335f09d0434444cee2a6683.zip pfsense-ac7f1763e1712dd85335f09d0434444cee2a6683.tar.gz |
Return to correct tab after save or delete an alias
-rwxr-xr-x | usr/local/www/firewall_aliases.php | 10 | ||||
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 18 |
2 files changed, 19 insertions, 9 deletions
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index 878a002..e5de4b6 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -50,10 +50,9 @@ if (!is_array($config['aliases']['alias'])) $config['aliases']['alias'] = array(); $a_aliases = &$config['aliases']['alias']; -if ($_POST) { +$tab = ($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab'])); - if($_POST['tab']) - $tab = $_POST['tab']; +if ($_POST) { if ($_POST['apply']) { $retval = 0; @@ -111,7 +110,7 @@ if ($_GET['act'] == "del") { filter_configure(); mark_subsystem_dirty('aliases'); } - header("Location: firewall_aliases.php"); + header("Location: firewall_aliases.php?tab=" . $tab); exit; } } @@ -171,7 +170,6 @@ include("head.inc"); <tr> <td class="tabnavtbl"> <?php - $tab=($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab'])); $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("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port"); @@ -256,7 +254,7 @@ include("head.inc"); <table border="0" cellspacing="0" cellpadding="1"> <tr> <td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=dom_title(gettext("Edit alias")." {$alias['name']}");?>></a></td> - <td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" 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)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=dom_title(gettext("Delete alias")." {$alias['name']}");?>></a></td> + <td><a href="firewall_aliases.php?act=del&tab=<?=$tab;?>&id=<?=$i;?>" 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)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=dom_title(gettext("Delete alias")." {$alias['name']}");?>></a></td> </tr> </table> </td> diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index f439648..97b9e28 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -62,6 +62,8 @@ if (!is_array($config['aliases']['alias'])) $config['aliases']['alias'] = array(); $a_aliases = &$config['aliases']['alias']; +$tab = $_REQUEST['tab']; + if($_POST) $origname = $_POST['origname']; @@ -364,8 +366,8 @@ if ($_POST) { if (write_config()) mark_subsystem_dirty('aliases'); - if($_POST['tab']) - header("Location: firewall_aliases.php?tab=" . htmlspecialchars ($_POST['tab'])); + if(!empty($tab)) + header("Location: firewall_aliases.php?tab=" . htmlspecialchars ($tab)); else header("Location: firewall_aliases.php"); exit; @@ -583,7 +585,17 @@ EOD; <div id="inputerrors"></div> <form action="firewall_aliases_edit.php" method="post" name="iform" id="iform"> -<input name="tab" type="hidden" id="tab" value="<?=htmlspecialchars($pconfig['type']);?>" /> +<?php +if (empty($tab)) { + if ($pconfig['type'] == 'urltable') + $tab = 'url'; + else if ($pconfig['type'] == 'host') + $tab = 'ip'; + else + $tab = $pconfig['type']; +} +?> +<input name="tab" type="hidden" id="tab" value="<?=htmlspecialchars($tab);?>" /> <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td colspan="2" valign="top" class="listtopic"><?=gettext("Alias Edit"); ?></td> |