summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/system_advanced_notifications.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-11 16:36:08 -0300
committerRenato Botelho <renato@netgate.com>2016-08-11 16:36:08 -0300
commite7cf30eb6fcd0cc2ec20dd267775b03db2b3667f (patch)
tree64c4d143d22894ac4ec704067f6d0497e39824a4 /src/usr/local/www/system_advanced_notifications.php
parent50950d0686160e85af6eea11b2b43ca6a69daa7d (diff)
downloadpfsense-e7cf30eb6fcd0cc2ec20dd267775b03db2b3667f.zip
pfsense-e7cf30eb6fcd0cc2ec20dd267775b03db2b3667f.tar.gz
Ticket #3734: Convert growl related code to use pear-Net_Growl port
Diffstat (limited to 'src/usr/local/www/system_advanced_notifications.php')
-rw-r--r--src/usr/local/www/system_advanced_notifications.php26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php
index 9fa52ba..17092f2 100644
--- a/src/usr/local/www/system_advanced_notifications.php
+++ b/src/usr/local/www/system_advanced_notifications.php
@@ -47,7 +47,7 @@ if ($config['notifications']['growl']['notification_name']) {
if ($config['notifications']['growl']['name']) {
$pconfig['name'] = $config['notifications']['growl']['name'];
} else {
- $pconfig['name'] = 'PHP-Growl';
+ $pconfig['name'] = 'pfSense-Growl';
}
@@ -160,7 +160,13 @@ if ($_POST) {
if (isset($config['notifications']['growl']['ipaddress'])) {
unlink_if_exists($g['vardb_path'] . "/growlnotices_lastmsg.txt");
register_via_growl();
- notify_via_growl(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true);
+ $test_result = notify_via_growl(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true);
+ if (empty($test_result)) {
+ $test_result = gettext("Growl testing notification successfully sent");
+ $test_class = 'success';
+ } else {
+ $test_class = 'danger';
+ }
}
}
@@ -169,12 +175,12 @@ if ($_POST) {
if (file_exists("/var/db/notices_lastmsg.txt")) {
unlink("/var/db/notices_lastmsg.txt");
}
- $smtp_test_result = notify_via_smtp(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true);
- if (empty($smtp_test_result)) {
- $smtp_test_result = gettext("SMTP testing e-mail successfully sent");
- $smtp_test_class = 'success';
+ $test_result = notify_via_smtp(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true);
+ if (empty($test_result)) {
+ $test_result = gettext("SMTP testing e-mail successfully sent");
+ $test_class = 'success';
} else {
- $smtp_test_class = 'danger';
+ $test_class = 'danger';
}
}
}
@@ -186,8 +192,8 @@ if ($input_errors) {
print_input_errors($input_errors);
}
-if ($smtp_test_result) {
- print_info_box($smtp_test_result, $smtp_test_class);
+if ($test_result) {
+ print_info_box($test_result, $test_class);
}
$tab_array = array();
@@ -216,7 +222,7 @@ $section->addInput(new Form_Input(
'Registration Name',
'text',
$pconfig['name'],
- ['placeholder' => 'PHP-Growl']
+ ['placeholder' => 'pfSense-Growl']
))->setHelp('Enter the name to register with the Growl server.');
$section->addInput(new Form_Input(
OpenPOWER on IntegriCloud