mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Adding register_via_growl()
This commit is contained in:
parent
8c73ff0c51
commit
e98419d8f6
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user