diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-09-13 15:31:24 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-09-13 15:31:24 +0000 |
commit | b06c6d6f157513e2fc5d6eaa1e6c02d1e1046567 (patch) | |
tree | 2037cc644e26084359f38de7c5f582a88779988c /actions/admin/user/resetpassword.php | |
parent | dd354e7b0f75e59ed3be40dc7d7a3a8262213ccb (diff) | |
download | elgg-b06c6d6f157513e2fc5d6eaa1e6c02d1e1046567.tar.gz elgg-b06c6d6f157513e2fc5d6eaa1e6c02d1e1046567.tar.bz2 |
Refs #2450: Updated docs for core admin actions.
git-svn-id: http://code.elgg.org/elgg/trunk@6929 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/admin/user/resetpassword.php')
-rw-r--r-- | actions/admin/user/resetpassword.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/actions/admin/user/resetpassword.php b/actions/admin/user/resetpassword.php index aead052dd..c70410201 100644 --- a/actions/admin/user/resetpassword.php +++ b/actions/admin/user/resetpassword.php @@ -1,26 +1,29 @@ <?php /** - * Admin password reset. + * Reset a user's password. * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ + * This is an admin action that generates a new salt and password + * for a user, then emails the password to the user's registered + * email address. + * + * NOTE: This is different to the "reset password" link users + * can use in that it does not first email the user asking if + * they want to have their password reset. + * + * @package Elgg.Core + * @subpackage Administration.User */ -global $CONFIG; - -// block non-admin users admin_gatekeeper(); -// Get the user $guid = get_input('guid'); $obj = get_entity($guid); if (($obj instanceof ElggUser) && ($obj->canEdit())) { $password = generate_random_cleartext_password(); - $obj->salt = generate_random_cleartext_password(); // Reset the salt + // Always reset the salt before generating the user password. + $obj->salt = generate_random_cleartext_password(); $obj->password = generate_user_password($obj, $password); if ($obj->save()) { @@ -39,5 +42,4 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) { register_error(elgg_echo('admin:user:resetpassword:no')); } -forward($_SERVER['HTTP_REFERER']); -exit; +forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file |