From 4268377c37fe7b3b82504d875c10e689394b9e36 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Mon, 10 Apr 2017 22:48:37 +0200 Subject: notify test buttons for smtp/growl should use new unsaved settings just made (cherry picked from commit 64f8ec62ddd57241e4a8a755cade7ca8cd9196a6) --- src/usr/local/www/system_advanced_notifications.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php index d8851c9..ec56cc9 100644 --- a/src/usr/local/www/system_advanced_notifications.php +++ b/src/usr/local/www/system_advanced_notifications.php @@ -120,7 +120,9 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - if (isset($_POST['save'])) { + $testgrowl = isset($_POST['test-growl']); + $testsmtp = isset($_POST['test-smtp']); + if (isset($_POST['save']) || $testsmtp || $testgrowl) { // Growl $config['notifications']['growl']['ipaddress'] = $_POST['ipaddress']; @@ -194,7 +196,7 @@ if ($_POST) { unset($config['system']['disablebeep']); } - if (!$input_errors) { + if (!$input_errors && !$testsmtp && !$testgrowl) { write_config(); pfSenseHeader("system_advanced_notifications.php"); @@ -203,7 +205,7 @@ if ($_POST) { } - if (isset($_POST['test-growl'])) { + if ($testgrowl) { // Send test message via growl if (isset($config['notifications']['growl']['ipaddress'])) { unlink_if_exists($g['vardb_path'] . "/growlnotices_lastmsg.txt"); @@ -212,7 +214,7 @@ if ($_POST) { } } - if (isset($_POST['test-smtp'])) { + if ($testsmtp) { // Send test message via smtp if (file_exists("/var/db/notices_lastmsg.txt")) { unlink("/var/db/notices_lastmsg.txt"); -- cgit v1.1