From 2c67bef9d4501ef6a2a7d1857bceade4340c871f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 11 Aug 2016 14:59:27 -0300 Subject: Be more verbose and let user know results of SMTP settings test --- src/usr/local/www/system_advanced_notifications.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/usr/local/www') diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php index 0a02cba..347cc0f 100644 --- a/src/usr/local/www/system_advanced_notifications.php +++ b/src/usr/local/www/system_advanced_notifications.php @@ -206,7 +206,13 @@ if ($_POST) { if (file_exists("/var/db/notices_lastmsg.txt")) { unlink("/var/db/notices_lastmsg.txt"); } - $savemsg = notify_via_smtp(sprintf(gettext("This is a test message from %s. It is safe to ignore this message."), $g['product_name']), true); + $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'; + } else { + $smtp_test_class = 'danger'; + } } } @@ -217,8 +223,8 @@ if ($input_errors) { print_input_errors($input_errors); } -if ($savemsg) { - print_info_box($savemsg, 'success'); +if ($smtp_test_result) { + print_info_box($smtp_test_result, $smtp_test_class); } $tab_array = array(); -- cgit v1.1