mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-19 19:09:13 -04:00
Create the concept of a "failed authentication" as semantically
separate from a successful or failed login. 1) Rename user_login_failed event to user_authenticate_failed 2) Rename failed_logins table to failed_auth (bump Gallery module to v27 to rename the table) 3) auth::too_many_failed_logins -> auth::too_many_failures 4) auth::record_failed_auth_attempts -> auth::record_failed_attempts auth::clear_failed_auth_attempts -> auth::clear_failed_attempts
This commit is contained in:
@@ -84,6 +84,7 @@ class Users_Controller extends Controller {
|
||||
$user->save();
|
||||
module::event("user_change_password_form_completed", $user, $form);
|
||||
message::success(t("Password changed"));
|
||||
module::event("user_authenticate", $user);
|
||||
module::event("user_password_change", $user);
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
@@ -91,7 +92,7 @@ class Users_Controller extends Controller {
|
||||
} else {
|
||||
log::warning("user", t("Failed password change for %name", array("name" => $user->name)));
|
||||
$name = $user->name;
|
||||
module::event("user_password_change_failed", $name);
|
||||
module::event("user_authenticate_failed", $name);
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
@@ -119,14 +120,14 @@ class Users_Controller extends Controller {
|
||||
$user->save();
|
||||
module::event("user_change_email_form_completed", $user, $form);
|
||||
message::success(t("Email address changed"));
|
||||
module::event("user_login", $user); // since there's no user_authenticated event
|
||||
module::event("user_authenticate", $user);
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
} else {
|
||||
log::warning("user", t("Failed email change for %name", array("name" => $user->name)));
|
||||
$name = $user->name;
|
||||
module::event("user_login_failed", $name);
|
||||
module::event("user_authenticate_failed", $name);
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user