From 22fec7728d59c5c6d0516914b14c99a2eadadb43 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 8 Jan 2016 18:39:07 +0545 Subject: firewall_shaper_vinterface display savemsg according to severity --- src/usr/local/www/firewall_shaper_vinterface.php | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/firewall_shaper_vinterface.php b/src/usr/local/www/firewall_shaper_vinterface.php index 91f830a..ef0ddae 100644 --- a/src/usr/local/www/firewall_shaper_vinterface.php +++ b/src/usr/local/www/firewall_shaper_vinterface.php @@ -170,19 +170,21 @@ if ($_GET) { if (write_config()) { $retval = 0; $retval = filter_configure(); - $savemsg = get_std_save_message($retval); - if (stristr($retval, "error") != true) { - $savemsg = get_std_save_message($retval); + if (stristr($retval, "error") != true) { + $savemsg = get_std_save_message($retval); + $class = 'success'; + } else { + $savemsg = $retval; + $class = 'danger'; + } + } else { - $savemsg = $retval; + $savemsg = gettext("Unable to write config.xml (Access Denied?)"); + $class = 'danger'; } - } else { - $savemsg = gettext("Unable to write config.xml (Access Denied?)"); - } - - $dfltmsg = true; + $dfltmsg = true; break; case "add": @@ -305,12 +307,13 @@ if ($_POST) { $retval = 0; $retval = filter_configure(); - $savemsg = get_std_save_message($retval); if (stristr($retval, "error") != true) { $savemsg = get_std_save_message($retval); + $class = 'success'; } else { $savemsg = $retval; + $class = 'danger'; } /* XXX: TODO Make dummynet pretty graphs */ @@ -401,7 +404,7 @@ if ($input_errors) { } if ($savemsg) { - print_info_box($savemsg, 'success'); + print_info_box($savemsg, $class); } if (is_subsystem_dirty('shaper')) { -- cgit v1.1