aboutsummaryrefslogtreecommitdiff
path: root/actions/user/requestnewpassword.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/user/requestnewpassword.php')
-rw-r--r--actions/user/requestnewpassword.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php
new file mode 100644
index 000000000..4f1fe7e83
--- /dev/null
+++ b/actions/user/requestnewpassword.php
@@ -0,0 +1,31 @@
+<?php
+ /**
+ * Action to request a new password.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ global $CONFIG;
+
+ $username = get_input('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(sprintf(elgg_echo('user:username:notfound'), $username));
+
+ forward($_SERVER['HTTP_REFERER']);
+ exit;
+?> \ No newline at end of file