From eb56ee821f0261c0106252c561e314b753b4cbb5 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 3 Feb 2009 00:17:40 +0000 Subject: 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 --- modules/user/helpers/user.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 14e3f09c..f125d67d 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -30,6 +30,9 @@ class user_Core { $group->input("name")->label(t("Name"))->id("gName")->value($user->name); $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name); $group->password("password")->label(t("Password"))->id("gPassword"); + $group->password("password2")->label(t("Confirm Password"))->id("gPassword2"); + $group->inputs["password2"]->error_messages( + "mistyped", t("The password and the confirm password must match")); $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->submit("")->value(t("Save")); @@ -46,6 +49,9 @@ class user_Core { "in_use", t("There is already a user with that name")); $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name); $group->password("password")->label(t("Password"))->id("gPassword"); + $group->password("password2")->label(t("Confirm Password"))->id("gPassword2"); + $group->inputs["password2"]->error_messages( + "mistyped", t("The password and the confirm password must match")); $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->submit("")->value(t("Modify User")); @@ -61,6 +67,9 @@ class user_Core { "in_use", t("There is already a user with that name")); $group->input("full_name")->label(t("Full Name"))->id("gFullName"); $group->password("password")->label(t("Password"))->id("gPassword"); + $group->password("password2")->label(t("Confirm Password"))->id("gPassword2"); + $group->inputs["password2"]->error_messages( + "mistyped", t("The password and the confirm password must match")); $group->input("email")->label(t("Email"))->id("gEmail"); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->submit("")->value(t("Add User")); -- cgit v1.2.3