From e98419d8f600d48333c1e1ca7a2433084d99a047 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 9 Jul 2009 21:59:44 -0400 Subject: [PATCH] Adding register_via_growl() --- etc/inc/pfsense-utils.inc | 21 +++++++++++++++++-- .../www/system_advanced_notifications.php | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index faa746c139..e94fa10fd0 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1681,10 +1681,27 @@ function notify_via_growl($message) { $growl_password = $config['notifications']['growl']['password']; if($growl_ip) { $growl = new Growl($growl_ip, $growl_password); - $growl->register(); $growl->notify("pfSense growl alert", "pfSense", "{$message}"); } - return true; // XXX: check for error? +} + +/****f* pfsense-utils/register_via_growl + * NAME + * register_via_growl + * INPUTS + * none + * RESULT + * none + ******/ +function register_via_growl() { + require_once("growl.class"); + global $config; + $growl_ip = $config['notifications']['growl']['ipaddress']; + $growl_password = $config['notifications']['growl']['password']; + if($growl_ip) { + $growl = new Growl($growl_ip, $growl_password); + $growl->register(); + } } ?> \ No newline at end of file diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index 6f2a55cd10..d623d8a7a2 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -66,8 +66,9 @@ if ($_POST) { write_config(); + register_via_growl(); notify_via_growl("This is a test message form pfSense. It is safe to ignore this message."); - + pfSenseHeader("system_advanced_notifications.php"); exit; }