summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_aliases_import.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-07-13 10:53:03 +0545
committerPhil Davis <phil.davis@inf.org>2015-07-13 10:53:03 +0545
commit5eabad3db3cd1f39596f2e682167e1ea2e81326e (patch)
tree8db96352c776c0e452a01a2a66ec13b1bdeeabe3 /usr/local/www/firewall_aliases_import.php
parentfd29caa1c8bc3aa547c50e4842aecd7314cc8d89 (diff)
downloadpfsense-5eabad3db3cd1f39596f2e682167e1ea2e81326e.zip
pfsense-5eabad3db3cd1f39596f2e682167e1ea2e81326e.tar.gz
Cancel button after input error
If there is an input error then the edit page is redrawn showing the input errors. The HTTP_REFERER becomes the current page, rather than the true original referer. Then if you click Cancel the current page is just redrawn. This change makes the code remember the original referer, so if the user enters some invalid data, presses Save, reads the input error messages then presses Cancel they are taken back out to the original page - the same as if Cancel was used before Save.
Diffstat (limited to 'usr/local/www/firewall_aliases_import.php')
-rwxr-xr-xusr/local/www/firewall_aliases_import.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php
index 09a2b79..b7250a9 100755
--- a/usr/local/www/firewall_aliases_import.php
+++ b/usr/local/www/firewall_aliases_import.php
@@ -49,7 +49,11 @@ require("shaper.inc");
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Bulk import"));
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+}
// Add all Load balance names to reserved_keywords
if (is_array($config['load_balancer']['lbpool'])) {
@@ -220,6 +224,7 @@ include("head.inc");
<td width="78%">
<input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
OpenPOWER on IntegriCloud