summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_advanced_notifications.php
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2014-04-06 18:51:11 +0200
committerWarren Baker <warren@decoy.co.za>2014-04-06 18:51:11 +0200
commitd269747b358f6e8f844e88d39fe36b8f33343d24 (patch)
tree99df9901bc24808e47891b66b04dffd88e386d47 /usr/local/www/system_advanced_notifications.php
parent1458017ab9abff68f23c22a32a703dd38bf19fdf (diff)
downloadpfsense-d269747b358f6e8f844e88d39fe36b8f33343d24.zip
pfsense-d269747b358f6e8f844e88d39fe36b8f33343d24.tar.gz
Ensure variable is available when testing smtp. Fixes #3577 (well not the rrd summary package).
Diffstat (limited to 'usr/local/www/system_advanced_notifications.php')
-rw-r--r--usr/local/www/system_advanced_notifications.php34
1 files changed, 20 insertions, 14 deletions
diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php
index 59950a2..8f5e90a 100644
--- a/usr/local/www/system_advanced_notifications.php
+++ b/usr/local/www/system_advanced_notifications.php
@@ -60,21 +60,21 @@ else
// SMTP
$pconfig['disable_smtp'] = isset($config['notifications']['smtp']['disable']);
-if($config['notifications']['smtp']['ipaddress'])
+if ($config['notifications']['smtp']['ipaddress'])
$pconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress'];
-if($config['notifications']['smtp']['port'])
+if ($config['notifications']['smtp']['port'])
$pconfig['smtpport'] = $config['notifications']['smtp']['port'];
-if($config['notifications']['smtp']['ssl'])
- $pconfig['smtpssl'] = $config['notifications']['smtp']['ssl'];
-if($config['notifications']['smtp']['tls'])
- $pconfig['smtptls'] = $config['notifications']['smtp']['tls'];
-if($config['notifications']['smtp']['notifyemailaddress'])
+if (isset($config['notifications']['smtp']['ssl']))
+ $pconfig['smtpssl'] = true;
+if (isset($config['notifications']['smtp']['tls']))
+ $pconfig['smtptls'] = true;
+if ($config['notifications']['smtp']['notifyemailaddress'])
$pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress'];
-if($config['notifications']['smtp']['username'])
+if ($config['notifications']['smtp']['username'])
$pconfig['smtpusername'] = $config['notifications']['smtp']['username'];
-if($config['notifications']['smtp']['password'])
+if ($config['notifications']['smtp']['password'])
$pconfig['smtppassword'] = $config['notifications']['smtp']['password'];
-if($config['notifications']['smtp']['fromaddress'])
+if ($config['notifications']['smtp']['fromaddress'])
$pconfig['smtpfromaddress'] = $config['notifications']['smtp']['fromaddress'];
// System Sounds
@@ -114,8 +114,14 @@ if ($_POST) {
// SMTP
$config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress'];
$config['notifications']['smtp']['port'] = $_POST['smtpport'];
- $config['notifications']['smtp']['ssl'] = isset($_POST['smtpssl']) ? 'checked' : 'unchecked';
- $config['notifications']['smtp']['tls'] = isset($_POST['smtptls']) ? (isset($_POST['smtpssl']) ? 'unchecked' : 'checked') : 'unchecked';
+ if (isset($_POST['smtpssl']))
+ $config['notifications']['smtp']['ssl'] = true;
+ else
+ unset($config['notifications']['smtp']['ssl']);
+ if (isset($_POST['smtptls']))
+ $config['notifications']['smtp']['tls'] = true;
+ else
+ unset($config['notifications']['smtp']['tls']);
$config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress'];
$config['notifications']['smtp']['username'] = $_POST['smtpusername'];
$config['notifications']['smtp']['password'] = $_POST['smtppassword'];
@@ -268,8 +274,8 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Secure SMTP Connection"); ?></td>
<td width="78%" class="vtable">
- <input type='checkbox' id='smtpssl' name='smtpssl' <?php echo $pconfig['smtpssl']; ?> />Enable SMTP over SSL/TLS<br />
- <input type='checkbox' id='smtptls' name='smtptls' <?php echo $pconfig['smtptls']; ?> />Enable STARTTLS<br />
+ <input type='checkbox' id='smtpssl' name='smtpssl' <?php if (isset($pconfig['smtpssl'])) echo "checked=\"checked\""; ?> />Enable SMTP over SSL/TLS<br />
+ <input type='checkbox' id='smtptls' name='smtptls' <?php if (isset($pconfig['smtptls'])) echo "checked=\"checked\""; ?> />Enable STARTTLS<br />
</td>
</tr>
<tr>
OpenPOWER on IntegriCloud