change_password.php 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Page for resetting a forgotten password
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Registration
  7. */
  8. if (elgg_is_logged_in()) {
  9. forward();
  10. }
  11. $user_guid = get_input('u');
  12. $code = get_input('c');
  13. $user = get_entity($user_guid);
  14. // don't check code here to avoid automated attacks
  15. if (!$user instanceof ElggUser) {
  16. register_error(elgg_echo('user:resetpassword:unknown_user'));
  17. forward();
  18. }
  19. $title = elgg_echo('changepassword');
  20. $params = array(
  21. 'guid' => $user_guid,
  22. 'code' => $code,
  23. );
  24. $content = elgg_view_form('user/changepassword', array('class' => 'elgg-form-account'), $params);
  25. if (elgg_get_config('walled_garden')) {
  26. elgg_load_css('elgg.walled_garden');
  27. $body = elgg_view_layout('walled_garden', array('content' => $content));
  28. echo elgg_view_page($title, $body, 'walled_garden');
  29. } else {
  30. $body = elgg_view_layout('one_column', array(
  31. 'title' => $title,
  32. 'content' => $content,
  33. ));
  34. echo elgg_view_page($title, $body);
  35. }