diff options
Diffstat (limited to 'modules/user/controllers/password.php')
-rw-r--r-- | modules/user/controllers/password.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index 477651bf..5f36b554 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -101,27 +101,29 @@ class Password_Controller extends Controller { if (!empty($hash)) { $hidden->value($hash); } - $group->password("password")->label(t("Password"))->id("g-password") - ->rules("required|length[1,40]"); + $minimum_length = module::get_var("user", "mininum_password_length", 5); + $input_password = $group->password("password")->label(t("Password"))->id("g-password") + ->rules($minimum_length ? "required|length[$minimum_length, 40]" : "length[40]"); $group->password("password2")->label(t("Confirm Password"))->id("g-password2") ->matches($group->password); $group->inputs["password2"]->error_messages( "mistyped", t("The password and the confirm password must match")); $group->submit("")->value(t("Update")); - $template->content = $form; + $template->content = new View("user_form.html"); + $template->content->form = $form; return $template; } private function _change_password() { $view = $this->_new_password_form(); - if ($view->content->validate()) { + if ($view->content->form->validate()) { $user = user::lookup_by_hash(Input::instance()->post("hash")); if (empty($user)) { throw new Exception("@todo FORBIDDEN", 503); } - $user->password = $view->content->reset->password->value; + $user->password = $view->content->form->reset->password->value; $user->hash = null; $user->save(); message::success(t("Password reset successfully")); |