diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-28 16:11:17 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-28 16:11:17 -0500 |
commit | c8b10b4ce59161e21a93786d04237ad3f330178a (patch) | |
tree | 9e696532f61abc22b52ebb86d678ec7c1ac356c4 /src/usr/local/www/system_hasync.php | |
parent | 690026d8256f15fd3b1df97ca1cba8f4815e425e (diff) | |
download | pfsense-c8b10b4ce59161e21a93786d04237ad3f330178a.zip pfsense-c8b10b4ce59161e21a93786d04237ad3f330178a.tar.gz |
Added new addPassword method and password == password_confirm validation where required.
Diffstat (limited to 'src/usr/local/www/system_hasync.php')
-rwxr-xr-x | src/usr/local/www/system_hasync.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/usr/local/www/system_hasync.php b/src/usr/local/www/system_hasync.php index f5aca57..8c44ae9 100755 --- a/src/usr/local/www/system_hasync.php +++ b/src/usr/local/www/system_hasync.php @@ -99,11 +99,19 @@ if ($_POST) { $a_hasync['pfsyncinterface'] = $pconfig['pfsyncinterface']; $a_hasync['synchronizetoip'] = $pconfig['synchronizetoip']; $a_hasync['username'] = $pconfig['username']; - $a_hasync['password'] = $pconfig['passwordfld']; - write_config("Updated High Availability Sync configuration"); - interfaces_sync_setup(); - header("Location: system_hasync.php"); - exit(); + + if ($pconfig['passwordfld'] == $pconfig['passwordfld_confirm']) { + $a_hasync['password'] = $pconfig['passwordfld']; + } else { + $input_errors[] = gettext("Password and confirmation must match."); + } + + if (!$input_errors) { + write_config("Updated High Availability Sync configuration"); + interfaces_sync_setup(); + header("Location: system_hasync.php"); + exit(); + } } foreach ($checkbox_names as $name) { @@ -129,6 +137,10 @@ foreach ($ifaces as $ifname => $iface) { include("head.inc"); +if ($input_errors) { + print_input_errors($input_errors); +} + $form = new Form; $section = new Form_Section('State Synchronization Settings (pfsync)'); @@ -184,7 +196,7 @@ $section->addInput(new Form_Input( ))->setHelp('Enter the webConfigurator username of the system entered above for synchronizing your configuration.<br />' . 'Do not use the Synchronize Config to IP and username option on backup cluster members!'); -$section->addInput(new Form_Input( +$section->addPassword(new Form_Input( 'passwordfld', 'Remote System Password', 'password', |