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/diag_backup.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/diag_backup.php')
-rw-r--r-- | src/usr/local/www/diag_backup.php | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index bcf3619..173da92 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -225,10 +225,10 @@ if ($_POST) { if ($mode) { if ($mode == "download") { if ($_POST['encrypt']) { - if (!$_POST['encrypt_password'] || !$_POST['encrypt_passconf']) { + if (!$_POST['encrypt_password'] || !$_POST['encrypt_password_confirm']) { $input_errors[] = gettext("You must supply and confirm the password for encryption."); } - if ($_POST['encrypt_password'] != $_POST['encrypt_passconf']) { + if ($_POST['encrypt_password'] != $_POST['encrypt_password_confirm']) { $input_errors[] = gettext("The supplied 'Password' and 'Confirm' field values must match."); } } @@ -303,10 +303,10 @@ if ($_POST) { if ($mode == "restore") { if ($_POST['decrypt']) { - if (!$_POST['decrypt_password'] || !$_POST['decrypt_passconf']) { + if (!$_POST['decrypt_password'] || !$_POST['decrypt_password_confirm']) { $input_errors[] = gettext("You must supply and confirm the password for decryption."); } - if ($_POST['decrypt_password'] != $_POST['decrypt_passconf']) { + if ($_POST['decrypt_password'] != $_POST['decrypt_password_confirm']) { $input_errors[] = gettext("The supplied 'Password' and 'Confirm' field values must match."); } } @@ -659,20 +659,11 @@ $section->addInput(new Form_Checkbox( false )); -$section->addInput(new Form_Input( +$section->addPassword(new Form_Input( 'encrypt_password', - null, - 'password', - null, - ['placeholder' => 'Password'] -)); - -$section->addInput(new Form_Input( - 'encrypt_passconf', - null, + 'Password', 'password', - null, - ['placeholder' => 'Confirm password'] + null )); $group = new Form_Group(''); @@ -712,22 +703,14 @@ $section->addInput(new Form_Checkbox( false )); -$section->addInput(new Form_Input( +$section->addPassword(new Form_Input( 'decrypt_password', - null, + 'Password', 'password', null, ['placeholder' => 'Password'] )); -$section->addInput(new Form_Input( - 'decrypt_passconf', - null, - 'password', - null, - ['placeholder' => 'Confirm password'] -)); - $group = new Form_Group(''); $group->add(new Form_Button( 'Submit', @@ -782,9 +765,9 @@ events.push(function() { decryptHide = !($('input[name="decrypt"]').is(':checked')); hideInput('encrypt_password', encryptHide); - hideInput('encrypt_passconf', encryptHide); + hideInput('encrypt_password_confirm', encryptHide); hideInput('decrypt_password', decryptHide); - hideInput('decrypt_passconf', decryptHide); + hideInput('decrypt_password_confirm', decryptHide); } // ---------- Click handlers ------------------------------------------------------------------ |