summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authork-paulius <k.dash.paulius@gmail.com>2016-02-13 16:22:44 -0600
committerStephen Beaver <sbeaver@netgate.com>2016-02-14 15:09:54 -0500
commit7c945f74712d3c2ef8d1beee65b881cfcf80e6bd (patch)
tree1664e15a5b3e1202bf87ebcc62f538005d6f42c3 /src
parentb290833b28c3083a7cb5c8b3ec5060620274e2b9 (diff)
downloadpfsense-7c945f74712d3c2ef8d1beee65b881cfcf80e6bd.zip
pfsense-7c945f74712d3c2ef8d1beee65b881cfcf80e6bd.tar.gz
Use print_info_box() to generate alerts
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/gmirror.inc6
-rw-r--r--src/usr/local/www/diag_authentication.php2
-rwxr-xr-xsrc/usr/local/www/diag_dns.php4
-rwxr-xr-xsrc/usr/local/www/diag_dump_states.php2
-rw-r--r--src/usr/local/www/diag_dump_states_sources.php2
-rwxr-xr-xsrc/usr/local/www/diag_halt.php6
-rw-r--r--src/usr/local/www/diag_resetstate.php2
-rw-r--r--src/usr/local/www/diag_tables.php8
-rw-r--r--src/usr/local/www/diag_testport.php5
-rw-r--r--src/usr/local/www/exec.php4
-rw-r--r--src/usr/local/www/interfaces_assign.php5
-rw-r--r--src/usr/local/www/pkg_mgr_installed.php8
-rw-r--r--src/usr/local/www/services_dhcp_relay.php2
-rw-r--r--src/usr/local/www/services_dhcpv6_relay.php2
-rw-r--r--src/usr/local/www/status_dhcpv6_leases.php2
-rw-r--r--src/usr/local/www/status_interfaces.php17
-rw-r--r--src/usr/local/www/status_lb_vs.php2
-rw-r--r--src/usr/local/www/vpn_ipsec_keys.php7
-rw-r--r--src/usr/local/www/vpn_ipsec_keys_edit.php7
-rw-r--r--src/usr/local/www/widgets/widgets/installed_packages.widget.php6
20 files changed, 42 insertions, 57 deletions
diff --git a/src/etc/inc/gmirror.inc b/src/etc/inc/gmirror.inc
index bacd77f..a6e9d28 100644
--- a/src/etc/inc/gmirror.inc
+++ b/src/etc/inc/gmirror.inc
@@ -93,11 +93,7 @@ function gmirror_html_status() {
$mirrors = gmirror_get_status();
$output = "";
if (count($mirrors) < 1) {
-?>
-<div class="alert alert-warning" role="alert">
- <p>No Mirrors Found</p>
-</div>
-<?php
+ print_info_box(gettext("No Mirrors Found"), 'warning', false);
return;
}
diff --git a/src/usr/local/www/diag_authentication.php b/src/usr/local/www/diag_authentication.php
index 03164b3..66e4106 100644
--- a/src/usr/local/www/diag_authentication.php
+++ b/src/usr/local/www/diag_authentication.php
@@ -109,7 +109,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print('<div class="alert alert-success" role="alert">'. $savemsg.'</div>');
+ print_info_box($savemsg, 'success', false);
}
$form = new Form('Test');
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php
index 367d166..5be89d9 100755
--- a/src/usr/local/www/diag_dns.php
+++ b/src/usr/local/www/diag_dns.php
@@ -212,11 +212,11 @@ include("head.inc");
if ($input_errors) {
print_input_errors($input_errors);
} else if (!$resolved && $type) {
- print('<div class="alert alert-warning" role="alert">' . sprintf(gettext('Host "%s" could not be resolved'), $host) . '</div>');
+ print_info_box(sprintf(gettext('Host "%s" could not be resolved'), $host), 'warning', false);
}
if ($createdalias) {
- print('<div class="alert alert-success" role="alert">' . gettext("Alias was created/updated successfully") . '</div>');
+ print_info_box(gettext("Alias was created/updated successfully"), 'success', false);
}
$form = new Form('Lookup');
diff --git a/src/usr/local/www/diag_dump_states.php b/src/usr/local/www/diag_dump_states.php
index 0059663..073a067 100755
--- a/src/usr/local/www/diag_dump_states.php
+++ b/src/usr/local/www/diag_dump_states.php
@@ -294,7 +294,7 @@ if ($states == 0) {
$errmsg = gettext('No states were found');
}
- print('<p class="alert alert-warning">' . $errmsg . '</p>');
+ print_info_box($errmsg, 'warning', false);
}
include("foot.inc");
diff --git a/src/usr/local/www/diag_dump_states_sources.php b/src/usr/local/www/diag_dump_states_sources.php
index 63b0db7..4aab13d 100644
--- a/src/usr/local/www/diag_dump_states_sources.php
+++ b/src/usr/local/www/diag_dump_states_sources.php
@@ -190,7 +190,7 @@ if (count($sources) > 0) {
</div>
<?php
if ($row == 0) {
- print('<p class="alert alert-warning">' . gettext('No source tracking entries were found.') . '</p>');
+ print_info_box(gettext('No source tracking entries were found.'), 'warning', false);
}
include("foot.inc");
diff --git a/src/usr/local/www/diag_halt.php b/src/usr/local/www/diag_halt.php
index c2b5236..848d96b 100755
--- a/src/usr/local/www/diag_halt.php
+++ b/src/usr/local/www/diag_halt.php
@@ -81,11 +81,9 @@ include('head.inc');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
?>
<meta http-equiv="refresh" content="70;url=/">
- <div class="alert alert-success" role="alert">
- <?=gettext("The system is halting now. This may take one minute or so.")?>
- </div>
-
<?php
+ print_info_box(gettext("The system is halting now. This may take one minute or so."), 'success', false);
+
if (DEBUG) {
print(sprintf(gettext("Not actually halting (DEBUG is set true)%s"), "<br />"));
} else {
diff --git a/src/usr/local/www/diag_resetstate.php b/src/usr/local/www/diag_resetstate.php
index 8636dec..d8d5a7f 100644
--- a/src/usr/local/www/diag_resetstate.php
+++ b/src/usr/local/www/diag_resetstate.php
@@ -94,7 +94,7 @@ if ($input_errors) {
}
if ($savemsg) {
- print_info_box($savemsg, 'alert-success');
+ print_info_box($savemsg, 'success');
}
$statetablehelp = sprintf(gettext('Resetting the state tables will remove all entries from the corresponding tables. This means that all open connections ' .
diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php
index 00d0d88..d34d57c 100644
--- a/src/usr/local/www/diag_tables.php
+++ b/src/usr/local/www/diag_tables.php
@@ -241,10 +241,8 @@ events.push(function() {
</div>
</div>
-<?php if (empty($entries)): ?>
- <div class="alert alert-warning" role="alert"><?=gettext("No entries exist in this table")?></div>
-<?php endif ?>
-
<?php
-
+if (empty($entries)) {
+ print_info_box(gettext("No entries exist in this table"), 'warning', false);
+}
include("foot.inc");
diff --git a/src/usr/local/www/diag_testport.php b/src/usr/local/www/diag_testport.php
index ccdb41e..9ac7278 100644
--- a/src/usr/local/www/diag_testport.php
+++ b/src/usr/local/www/diag_testport.php
@@ -241,9 +241,8 @@ if ($input_errors) {
print ($alert_text . '</div>');
} else {
// First time, new page
- print('<div class="alert alert-warning" role="alert">' .
- gettext('This page allows you to perform a simple TCP connection test to determine if a host is up and accepting connections on a given port.') . " " .
- gettext('This test does not function for UDP since there is no way to reliably determine if a UDP port accepts connections in this manner.') . '</div>');
+ print_info_box(gettext('This page allows you to perform a simple TCP connection test to determine if a host is up and accepting connections on a given port.') . " " .
+ gettext('This test does not function for UDP since there is no way to reliably determine if a UDP port accepts connections in this manner.'), 'warning', false);
}
$form = new Form('Test');
diff --git a/src/usr/local/www/exec.php b/src/usr/local/www/exec.php
index b37c734..2e785f4 100644
--- a/src/usr/local/www/exec.php
+++ b/src/usr/local/www/exec.php
@@ -218,7 +218,7 @@ if (isBlank($_POST['txtRecallBuffer'])) {
<?php
if (isBlank($_POST['txtCommand']) && isBlank($_POST['txtPHPCommand']) && isBlank($ulmsg)) {
- print('<div class="alert alert-warning" role="alert">' . gettext("The capabilities offered here can be dangerous. No support is available. Use them at your own risk!") . '</div>');
+ print_info_box(gettext("The capabilities offered here can be dangerous. No support is available. Use them at your own risk!"), 'warning', false);
}
if (!isBlank($_POST['txtCommand'])):?>
@@ -269,7 +269,7 @@ if (!isBlank($_POST['txtCommand'])):?>
<?php
if ($ulmsg) {
- print('<div class="alert alert-success" role="alert">' . $ulmsg . '</div>');
+ print_info_box($ulmsg, 'success', false);
}
?>
<div class="panel panel-default">
diff --git a/src/usr/local/www/interfaces_assign.php b/src/usr/local/www/interfaces_assign.php
index 8ffff9a..cbc9fff 100644
--- a/src/usr/local/www/interfaces_assign.php
+++ b/src/usr/local/www/interfaces_assign.php
@@ -597,6 +597,9 @@ display_top_tabs($tab_array);
<button name="Submit" type="submit" class="btn btn-primary" value="<?=gettext('Save')?>"><?=gettext('Save')?></button>
</form>
<br />
-<p class="alert alert-info"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown.")?></p>
+
+<?php
+print_info_box(gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown."), 'info', false);
+?>
<?php include("foot.inc")?>
diff --git a/src/usr/local/www/pkg_mgr_installed.php b/src/usr/local/www/pkg_mgr_installed.php
index 93fd475..6804f67 100644
--- a/src/usr/local/www/pkg_mgr_installed.php
+++ b/src/usr/local/www/pkg_mgr_installed.php
@@ -89,11 +89,9 @@ foreach ($package_list as $pkg) {
$installed_packages[] = $pkg;
}
-if (empty($installed_packages)):?>
- <div class="alert alert-warning">
- <?=gettext("There are no packages currently installed.")?>
- </div>
-<?php else:?>
+if (empty($installed_packages)):
+ print_info_box(gettext("There are no packages currently installed."), 'warning', false);
+else:?>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Installed Packages')?></h2></div>
<div class="table-responsive">
diff --git a/src/usr/local/www/services_dhcp_relay.php b/src/usr/local/www/services_dhcp_relay.php
index ecb7186..acca7a9 100644
--- a/src/usr/local/www/services_dhcp_relay.php
+++ b/src/usr/local/www/services_dhcp_relay.php
@@ -156,7 +156,7 @@ $shortcut_section = "dhcp";
include("head.inc");
if ($dhcpd_enabled) {
- echo '<div class="alert alert-danger">' . gettext("DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface.") . '</div>';
+ print_info_box(gettext("DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface."), 'danger', false);
include("foot.inc");
exit;
}
diff --git a/src/usr/local/www/services_dhcpv6_relay.php b/src/usr/local/www/services_dhcpv6_relay.php
index 974644a..61cb193 100644
--- a/src/usr/local/www/services_dhcpv6_relay.php
+++ b/src/usr/local/www/services_dhcpv6_relay.php
@@ -154,7 +154,7 @@ $shortcut_section = "dhcp6";
include("head.inc");
if ($dhcpd_enabled) {
- echo '<div class="alert alert-danger">' . gettext("DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.") . '</div>';
+ print_info_box(gettext("DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface."), 'danger', false);
include("foot.inc");
exit;
}
diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php
index 45fc70a..24c00ba 100644
--- a/src/usr/local/www/status_dhcpv6_leases.php
+++ b/src/usr/local/www/status_dhcpv6_leases.php
@@ -439,7 +439,7 @@ if (count($pools) > 0) {
}
if (empty($leases)) {
- print '<div class="alert alert-warning" role="alert">' . gettext("No leases file found. Is the DHCP server active?") . '</div>';
+ print_info_box(gettext("No leases file found. Is the DHCP server active?"), 'warning', false);
}
?>
diff --git a/src/usr/local/www/status_interfaces.php b/src/usr/local/www/status_interfaces.php
index 3d19bac..227933b 100644
--- a/src/usr/local/www/status_interfaces.php
+++ b/src/usr/local/www/status_interfaces.php
@@ -207,14 +207,11 @@ foreach ($ifdescrs as $ifdescr => $ifname):
<?php
endforeach;
-?>
-
-<div class="alert alert-warning" role="alert">
- <?=gettext("Using dial-on-demand will bring the connection up again if any packet ".
- "triggers it. To substantiate this point: disconnecting manually ".
- "will <strong>not</strong> prevent dial-on-demand from making connections ".
- "to the outside! Don't use dial-on-demand if you want to make sure that the line ".
- "is kept disconnected.");?>
-</div>
-<?php include("foot.inc"); ?>
+print_info_box(gettext("Using dial-on-demand will bring the connection up again if any packet ".
+ "triggers it. To substantiate this point: disconnecting manually ".
+ "will <strong>not</strong> prevent dial-on-demand from making connections ".
+ "to the outside! Don't use dial-on-demand if you want to make sure that the line ".
+ "is kept disconnected."), 'warning', false);
+include("foot.inc");
+?>
diff --git a/src/usr/local/www/status_lb_vs.php b/src/usr/local/www/status_lb_vs.php
index e86293a..6951861 100644
--- a/src/usr/local/www/status_lb_vs.php
+++ b/src/usr/local/www/status_lb_vs.php
@@ -91,7 +91,7 @@ $tab_array[] = array(gettext("Virtual Servers"), true, "status_lb_vs.php");
display_top_tabs($tab_array);
if (empty($a_vs)) {
- print('<div class="alert alert-danger">' . gettext("No load balancers have been configured!") . '</div>');
+ print_info_box(gettext("No load balancers have been configured!"), 'danger', false);
} else {
?>
<div class="table-responsive"></div>
diff --git a/src/usr/local/www/vpn_ipsec_keys.php b/src/usr/local/www/vpn_ipsec_keys.php
index 2161831..00834c9 100644
--- a/src/usr/local/www/vpn_ipsec_keys.php
+++ b/src/usr/local/www/vpn_ipsec_keys.php
@@ -202,9 +202,8 @@ if (is_subsystem_dirty('ipsec')) {
</a>
</nav>
-<div class="alert alert-info">
- <strong><?=gettext("Note"); ?>:</strong>
- <?=gettext(" PSK for any user can be set by using an identifier of any")?>
-</div>
+<?php
+print_info_box(gettext("PSK for any user can be set by using an identifier of any."), 'info', false);
+?>
<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/vpn_ipsec_keys_edit.php b/src/usr/local/www/vpn_ipsec_keys_edit.php
index e9e4229..0bb99b9 100644
--- a/src/usr/local/www/vpn_ipsec_keys_edit.php
+++ b/src/usr/local/www/vpn_ipsec_keys_edit.php
@@ -203,9 +203,8 @@ print $form;
?>
-<div class="alert alert-info">
- <strong><?=gettext("Note"); ?>:</strong><br />
- <?=gettext("PSK for any user can be set by using an identifier of any")?>
-</div>
+<?php
+print_info_box(gettext("PSK for any user can be set by using an identifier of any."), 'info', false);
+?>
<?php include("foot.inc"); ?>
diff --git a/src/usr/local/www/widgets/widgets/installed_packages.widget.php b/src/usr/local/www/widgets/widgets/installed_packages.widget.php
index dca7c0d..d1948a9 100644
--- a/src/usr/local/www/widgets/widgets/installed_packages.widget.php
+++ b/src/usr/local/www/widgets/widgets/installed_packages.widget.php
@@ -73,10 +73,8 @@ if ($_REQUEST && $_REQUEST['ajax']) {
});
if (empty($installed_packages)) {
- print("<div class=\"alert alert-warning\" role=\"alert\">\n");
- print(" <strong>". gettext("No packages installed.") . "</strong>\n");
- print(" " . gettext('You can install packages <a href="pkg_mgr.php" class="alert-link">here</a>.') . "\n");
- print("</div>\n");
+ print_info_box("<strong>". gettext("No packages installed.") . "</strong>\n" . " " .
+ gettext('You can install packages <a href="pkg_mgr.php" class="alert-link">here</a>.') . "\n", 'warning', false);
exit;
}
OpenPOWER on IntegriCloud