mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-22 12:29:11 -04:00
Partial fix for #1225 addresses the issues with the user edit forms.
This commit is contained in:
committed by
Bharat Mediratta
parent
bb04015149
commit
89d18c0714
@@ -54,11 +54,10 @@ class Users_Controller extends Controller {
|
||||
$user->save();
|
||||
module::event("user_edit_form_completed", $user, $form);
|
||||
message::success(t("User information updated"));
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
json::reply(array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
} else {
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
json::reply(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,14 +86,13 @@ class Users_Controller extends Controller {
|
||||
message::success(t("Password changed"));
|
||||
module::event("user_auth", $user);
|
||||
module::event("user_password_change", $user);
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
json::reply(array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
} else {
|
||||
log::warning("user", t("Failed password change for %name", array("name" => $user->name)));
|
||||
$name = $user->name;
|
||||
module::event("user_auth_failed", $name);
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
json::reply(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,14 +120,13 @@ class Users_Controller extends Controller {
|
||||
module::event("user_change_email_form_completed", $user, $form);
|
||||
message::success(t("Email address changed"));
|
||||
module::event("user_auth", $user);
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"resource" => url::site("users/{$user->id}")));
|
||||
json::reply(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_auth_failed", $name);
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
json::reply(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +136,7 @@ class Users_Controller extends Controller {
|
||||
access::forbidden();
|
||||
}
|
||||
|
||||
print json_encode(array("form" => (string) $this->_get_edit_form($user)));
|
||||
json::reply(array("form" => (string) $this->_get_edit_form($user)));
|
||||
}
|
||||
|
||||
public function form_change_password($id) {
|
||||
@@ -148,7 +145,7 @@ class Users_Controller extends Controller {
|
||||
access::forbidden();
|
||||
}
|
||||
|
||||
print json_encode(array("form" => (string) $this->_get_change_password_form($user)));
|
||||
json::reply(array("form" => (string) $this->_get_change_password_form($user)));
|
||||
}
|
||||
|
||||
public function form_change_email($id) {
|
||||
@@ -157,7 +154,7 @@ class Users_Controller extends Controller {
|
||||
access::forbidden();
|
||||
}
|
||||
|
||||
print json_encode(array("form" => (string) $this->_get_change_email_form($user)));
|
||||
json::reply(array("form" => (string) $this->_get_change_email_form($user)));
|
||||
}
|
||||
|
||||
private function _get_change_password_form($user) {
|
||||
|
||||
Reference in New Issue
Block a user