diff options
Diffstat (limited to 'pages/account/reset_password.php')
-rw-r--r-- | pages/account/reset_password.php | 35 |
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..6515bfc5d --- /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('class' => 'elgg-form-account'), $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); |