Skip to content

Commit

Permalink
Fix reauth authentication to use the identity helper instead of the
Browse files Browse the repository at this point in the history
user helper directly.  Else it doesn't work with LDAP and other
identity systems.
  • Loading branch information
bharat committed Jul 13, 2010
1 parent 887154a commit 297f98f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/gallery/controllers/reauthenticate.php
Expand Up @@ -79,7 +79,7 @@ private static function _form() {
$group = $form->group("reauthenticate")->label(t("Re-authenticate"));
$group->password("password")->label(t("Password"))->id("g-password")->class(null)
->callback("auth::validate_too_many_failed_auth_attempts")
->callback("user::valid_password")
->callback("Reauthenticate_Controller::valid_password")
->error_messages("invalid_password", t("Incorrect password"))
->error_messages(
"too_many_failed_auth_attempts",
Expand Down Expand Up @@ -108,4 +108,10 @@ private static function _call_admin_function($reauthenticate) {

call_user_func_array(array(new $controller_name, $method), $args);
}

static function valid_password($password_input) {
if (!identity::is_correct_password(identity::active_user(), $password_input->value)) {
$password_input->add_error("invalid_password", 1);
}
}
}

0 comments on commit 297f98f

Please sign in to comment.