summaryrefslogtreecommitdiffstats
path: root/etc/inc/notices.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-06-13 12:17:47 -0400
committerjim-p <jimp@pfsense.org>2013-06-13 12:17:47 -0400
commit48b86f6257bd0c79f26ee5e111bfa1488a28e6fb (patch)
tree86187791127263f32593be951c14f8a368715889 /etc/inc/notices.inc
parent00a695c8cd0960b6ec38f61178fe88b7174e127f (diff)
downloadpfsense-48b86f6257bd0c79f26ee5e111bfa1488a28e6fb.zip
pfsense-48b86f6257bd0c79f26ee5e111bfa1488a28e6fb.tar.gz
Add the ability to disable Growl or SMTP notifications but keep their settings intact. Remove automatic test messages on save. Add individual test buttons for Growl and SMTP that work even if the service(s) are disabled.
Diffstat (limited to 'etc/inc/notices.inc')
-rw-r--r--etc/inc/notices.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc
index 284c077..11d4176 100644
--- a/etc/inc/notices.inc
+++ b/etc/inc/notices.inc
@@ -265,11 +265,14 @@ function are_notices_pending($category = "all") {
* RESULT
* returns true if message was sent
******/
-function notify_via_smtp($message) {
+function notify_via_smtp($message, $force = false) {
global $config, $g;
if($g['booting'])
return;
+ if(isset($config['notifications']['smtp']['disable']) && !$force)
+ return;
+
if(!$config['notifications']['smtp']['ipaddress'])
return;
@@ -342,10 +345,13 @@ function notify_via_smtp($message) {
* RESULT
* returns true if message was sent
******/
-function notify_via_growl($message) {
+function notify_via_growl($message, $force=false) {
require_once("growl.class");
global $config,$g;
+ if (isset($config['notifications']['growl']['disable']) && !$force)
+ return;
+
/* Do NOT send the same message twice */
if(file_exists("/var/db/growlnotices_lastmsg.txt")) {
$lastmsg = trim(file_get_contents("/var/db/growlnotices_lastmsg.txt"));
OpenPOWER on IntegriCloud