aboutsummaryrefslogtreecommitdiff
path: root/pages/account/reset_password.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-11 15:56:11 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-11 15:56:11 +0000
commit0e39eac3459d2ff698b51e87a469a2790e510a19 (patch)
tree65caa36ace7d782bba36137aa4a78912c68ae367 /pages/account/reset_password.php
parentd720eac96fda5415f4becf64d6ba49716aa14f6c (diff)
downloadelgg-0e39eac3459d2ff698b51e87a469a2790e510a19.tar.gz
elgg-0e39eac3459d2ff698b51e87a469a2790e510a19.tar.bz2
Fixes #3515 created a unified page handler for account pages
git-svn-id: http://code.elgg.org/elgg/trunk@9175 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'pages/account/reset_password.php')
-rw-r--r--pages/account/reset_password.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/pages/account/reset_password.php b/pages/account/reset_password.php
new file mode 100644
index 000000000..019ec3add
--- /dev/null
+++ b/pages/account/reset_password.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Page for resetting a forgotten password
+ *
+ * @package Elgg.Core
+ * @subpackage Registration
+ */
+
+if (elgg_is_logged_in()) {
+ forward();
+}
+
+$user_guid = get_input('u');
+$code = get_input('c');
+
+$user = get_entity($user_guid);
+
+// don't check code here to avoid automated attacks
+if (!$user instanceof ElggUser) {
+ register_error(elgg_echo('user:passwordreset:unknown_user'));
+ forward();
+}
+
+$params = array(
+ 'guid' => $user_guid,
+ 'code' => $code,
+);
+$form = elgg_view_form('user/passwordreset', array(), $params);
+
+$title = elgg_echo('resetpassword');
+$content = elgg_view_title(elgg_echo('resetpassword')) . $form;
+
+$body = elgg_view_layout('one_column', array('content' => $content));
+
+echo elgg_view_page($title, $body);