diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-28 14:31:51 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-28 14:33:26 -0500 |
commit | 5ea90990e6ebcdbeb78fadf8b88aedef66428c66 (patch) | |
tree | e3437d140c9e44224273c86f614bef8019c0576e /src/usr/local/www/system_advanced_notifications.php | |
parent | f1b7a0b1bc66ead820f5d8301ad7e9b2199cfb2c (diff) | |
download | pfsense-5ea90990e6ebcdbeb78fadf8b88aedef66428c66.zip pfsense-5ea90990e6ebcdbeb78fadf8b88aedef66428c66.tar.gz |
Experimental: Fixed #5693
Added new functionality to PHP classes, and used it ONLY in system_advanced_notifications.php -> smtp password
Diffstat (limited to 'src/usr/local/www/system_advanced_notifications.php')
-rw-r--r-- | src/usr/local/www/system_advanced_notifications.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php index 0c5ed03..7bd5ee8 100644 --- a/src/usr/local/www/system_advanced_notifications.php +++ b/src/usr/local/www/system_advanced_notifications.php @@ -153,7 +153,15 @@ if ($_POST) { $config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress']; $config['notifications']['smtp']['username'] = $_POST['smtpusername']; - $config['notifications']['smtp']['password'] = $_POST['smtppassword']; + + if ($_POST['smtppassword'] != DMYPWD) { + if ($_POST['smtppassword'] == $_POST['smtppassword_confirm']) { + $config['notifications']['smtp']['password'] = $_POST['smtppassword']; + } else { + $input_errors[] = gettext("SMTP passwords must match"); + } + } + $config['notifications']['smtp']['authentication_mechanism'] = $_POST['smtpauthmech']; $config['notifications']['smtp']['fromaddress'] = $_POST['smtpfromaddress']; @@ -170,10 +178,12 @@ if ($_POST) { unset($config['system']['disablebeep']); } - write_config(); + if (!$input_errors) { + write_config(); - pfSenseHeader("system_advanced_notifications.php"); - return; + pfSenseHeader("system_advanced_notifications.php"); + return; + } } @@ -337,12 +347,12 @@ $section->addInput(new Form_Input( ['autocomplete' => 'off'] ))->setHelp('Enter the e-mail address username for SMTP authentication.'); -$section->addInput(new Form_Input( +$section->addPassword(new Form_Input( 'smtppassword', 'Notification E-Mail auth password', 'password', $pconfig['smtppassword'] -))->setHelp('Enter the e-mail address password for SMTP authentication.'); +))->setHelp('Enter the e-mail account password for SMTP authentication.'); $section->addInput(new Form_Select( 'smtpauthmech', |