Advertisement
Guest User

Untitled

a guest
May 10th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. if ($CFG_GLPI["use_mailing"]
  2. && countElementsInTable('glpi_notifications',
  3. "`itemtype`='User'
  4. AND `event`='passwordforget'
  5. AND `is_active`=1")) {
  6. echo '<a id="forget" href="front/lostpassword.php?lostpassword=1">'.
  7. __('Forgotten password?').'</a>';
  8. }
  9.  
  10. <?php
  11.  
  12. include ('../inc/includes.php');
  13.  
  14. if (!$CFG_GLPI['use_mailing']
  15. || !countElementsInTable('glpi_notifications',
  16. "`itemtype`='User' AND `event`='passwordforget' AND `is_active`=1")) {
  17. exit();
  18. }
  19.  
  20. $user = new User();
  21.  
  22. // Manage lost password
  23. Html::simpleHeader(__('Forgotten password?'));
  24.  
  25. // REQUEST needed : GET on first access / POST on submit form
  26. if (isset($_REQUEST['password_forget_token'])) {
  27.  
  28. if (isset($_POST['email'])) {
  29. $user->updateForgottenPassword($_REQUEST);
  30. } else {
  31. User::showPasswordForgetChangeForm($_REQUEST['password_forget_token']);
  32. }
  33.  
  34. } else {
  35.  
  36. if (isset($_POST['email'])) {
  37. $user->forgetPassword($_POST['email']);
  38. } else {
  39. User::showPasswordForgetRequestForm();
  40. }
  41. }
  42.  
  43. Html::nullFooter();
  44. exit();
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement