mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 03:19:13 -04:00
Add a confirmation password input field that must match the primary
password field in order for the update to succeed. If there is no data entered in the primary password field, the confirmation field is ignored. Addresses Trac Ticket #4
This commit is contained in:
@@ -37,6 +37,12 @@ class Admin_Users_Controller extends Controller {
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
if ($form->add_user->password->value &&
|
||||
$form->add_user->password->value != $form->add_user->password2->value) {
|
||||
$form->add_user->password2->add_error("mistyped", 1);
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$user = user::create(
|
||||
$name, $form->add_user->full_name->value, $form->add_user->password->value);
|
||||
@@ -106,6 +112,12 @@ class Admin_Users_Controller extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if ($form->edit_user->password->value &&
|
||||
$form->edit_user->password->value != $form->edit_user->password2->value) {
|
||||
$form->edit_user->password2->add_error("mistyped", 1);
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
$user->name = $new_name;
|
||||
$user->full_name = $form->edit_user->full_name->value;
|
||||
|
||||
Reference in New Issue
Block a user