diff options
author | Phil Davis <phil.davis@inf.org> | 2016-07-07 16:09:48 +0930 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-07-07 20:51:51 -0400 |
commit | 3db367fb8fcc18efdbe7848730c641541a207515 (patch) | |
tree | c75ecd5aca3844e8a69958261974e7ae212b23db /src/usr/local | |
parent | 2a8849119c7c48976161faeaedc477c347e9b724 (diff) | |
download | pfsense-3db367fb8fcc18efdbe7848730c641541a207515.zip pfsense-3db367fb8fcc18efdbe7848730c641541a207515.tar.gz |
Show "cannot delete alias" message as error
If I try to delete an alias that is in use, the "cannot delete alias" message was being displayed as the "success" color.
(cherry picked from commit 04b571e836077c436d109d982be5a8e710ff8aab)
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/firewall_aliases.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/usr/local/www/firewall_aliases.php b/src/usr/local/www/firewall_aliases.php index f5afe68..b6be2ff 100644 --- a/src/usr/local/www/firewall_aliases.php +++ b/src/usr/local/www/firewall_aliases.php @@ -85,8 +85,10 @@ if ($_POST) { if (stristr($retval, "error") <> true) { $savemsg = get_std_save_message($retval); + $class = "success"; } else { $savemsg = $retval; + $class = "danger"; } if ($retval == 0) { clear_subsystem_dirty('aliases'); @@ -131,6 +133,7 @@ if ($_GET['act'] == "del") { find_alias_reference(array('staticroutes', 'route'), array('network'), $alias_name, $is_alias_referenced, $referenced_by); if ($is_alias_referenced == true) { $savemsg = sprintf(gettext("Cannot delete alias. Currently in use by %s."), htmlspecialchars($referenced_by)); + $class = "danger"; } else { if (preg_match("/urltable/i", $a_aliases[$_GET['id']]['type'])) { // this is a URL table type alias, delete its file as well @@ -204,7 +207,7 @@ $shortcut_section = "aliases"; include("head.inc"); if ($savemsg) { - print_info_box($savemsg, 'success'); + print_info_box($savemsg, $class); } if (is_subsystem_dirty('aliases')) { |