diff options
Diffstat (limited to 'actions/user')
-rw-r--r-- | actions/user/passwordreset.php | 19 | ||||
-rw-r--r-- | actions/user/requestnewpassword.php | 27 | ||||
-rw-r--r-- | actions/user/spotlight.php | 19 |
3 files changed, 65 insertions, 0 deletions
diff --git a/actions/user/passwordreset.php b/actions/user/passwordreset.php new file mode 100644 index 000000000..201d6abcf --- /dev/null +++ b/actions/user/passwordreset.php @@ -0,0 +1,19 @@ +<?php +/** + * Action to reset a password and send success email. + * + * @package Elgg + * @subpackage Core + */ + +$user_guid = get_input('u'); +$code = get_input('c'); + +if (execute_new_password_request($user_guid, $code)) { + system_message(elgg_echo('user:password:success')); +} else { + register_error(elgg_echo('user:password:fail')); +} + +forward(); +exit; diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php new file mode 100644 index 000000000..f1d4fa43c --- /dev/null +++ b/actions/user/requestnewpassword.php @@ -0,0 +1,27 @@ +<?php +/** + * Action to request a new password. + * + * @package Elgg.Core + * @subpackage User.Account + */ + +$username = get_input('username'); + +// allow email addresses +if (strpos($username, '@') !== false && ($users = get_user_by_email($username))) { + $username = $users[0]->username; +} + +$user = get_user_by_username($username); +if ($user) { + if (send_new_password_request($user->guid)) { + system_message(elgg_echo('user:password:resetreq:success')); + } else { + register_error(elgg_echo('user:password:resetreq:fail')); + } +} else { + register_error(elgg_echo('user:username:notfound', array($username))); +} + +forward(); diff --git a/actions/user/spotlight.php b/actions/user/spotlight.php new file mode 100644 index 000000000..202dde387 --- /dev/null +++ b/actions/user/spotlight.php @@ -0,0 +1,19 @@ +<?php +/** + * Close or open spotlight. + * + * @package Elgg.Core + * @subpackage Spotlight + * @todo This is deprecated in 1.8 + */ + +$closed = get_input('closed', 'true'); +if ($closed != 'true') { + $closed = false; +} else { + $closed = true; +} + +elgg_get_logged_in_user_entity()->spotlightclosed = $closed; +// exit as this action is called through Ajax +exit;
\ No newline at end of file |