summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-07-13 12:52:59 -0700
committerBharat Mediratta <bharat@menalto.com>2010-07-13 12:52:59 -0700
commit297f98fcee9d45d49f0d2bebfd22aabc7af4c60b (patch)
tree34d4e25cc3aa60dd651958189058de5783e212ed /modules/gallery/controllers
parent887154a3b797eade36c1c651e2e849c613459544 (diff)
Fix reauth authentication to use the identity helper instead of the
user helper directly. Else it doesn't work with LDAP and other identity systems.
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r--modules/gallery/controllers/reauthenticate.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php
index d35259e5..29387536 100644
--- a/modules/gallery/controllers/reauthenticate.php
+++ b/modules/gallery/controllers/reauthenticate.php
@@ -79,7 +79,7 @@ class Reauthenticate_Controller extends Controller {
$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",
@@ -108,4 +108,10 @@ class Reauthenticate_Controller extends Controller {
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);
+ }
+ }
}