From 44c423566b6eff18ec43ee77edddb94e3a3aa858 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 3 Jan 2017 10:50:22 +0545 Subject: Report problems applying changes 1) Strictly keep track of the accumulating $retval from calls to various functions that apply changes. 2) Use new function print_apply_result_box() to print a suitable message in a suitable severity based on $retval --- src/usr/local/www/vpn_ipsec_settings.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/usr/local/www/vpn_ipsec_settings.php') diff --git a/src/usr/local/www/vpn_ipsec_settings.php b/src/usr/local/www/vpn_ipsec_settings.php index 4360837..3bcfa1d 100644 --- a/src/usr/local/www/vpn_ipsec_settings.php +++ b/src/usr/local/www/vpn_ipsec_settings.php @@ -172,15 +172,9 @@ if ($_POST) { write_config(); + $changes_applied = true; $retval = 0; - $retval = filter_configure(); - if (stristr($retval, "error") <> true) { - $savemsg = get_std_save_message(gettext($retval)); - $class = 'success'; - } else { - $savemsg = gettext($retval); - $class = 'warning'; - } + $retval |= filter_configure(); vpn_ipsec_configure($needsrestart); @@ -220,8 +214,8 @@ function maxmss_checked(obj) { Date: Tue, 3 Jan 2017 14:05:26 +0545 Subject: vpn_ipsec_settings - do not redirect on save When the user presses save, and there are no input errors, the data is saved - good. But the page redirects away to itself, which is not necessary. It is preventing the "saved successfully" message from being seen. --- src/usr/local/www/vpn_ipsec_settings.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/usr/local/www/vpn_ipsec_settings.php') diff --git a/src/usr/local/www/vpn_ipsec_settings.php b/src/usr/local/www/vpn_ipsec_settings.php index 3bcfa1d..fa24a53 100644 --- a/src/usr/local/www/vpn_ipsec_settings.php +++ b/src/usr/local/www/vpn_ipsec_settings.php @@ -177,9 +177,6 @@ if ($_POST) { $retval |= filter_configure(); vpn_ipsec_configure($needsrestart); - - header("Location: vpn_ipsec_settings.php"); - return; } // The logic value sent by $POST for autoexcludelanaddress is opposite to -- cgit v1.1