resend_confirmation_mail.php 957 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For license terms, see /license.txt */
  3. require_once __DIR__.'/../inc/global.inc.php';
  4. // Build the form
  5. $form = new FormValidator('resend');
  6. $form->addElement('header', get_lang('ReSendConfirmationMail'));
  7. $form->addText('user', get_lang('UserName'), true);
  8. $form->addButtonSend(get_lang('Send'));
  9. if ($form->validate()) {
  10. $values = $form->exportValues();
  11. /** @var \Chamilo\UserBundle\Entity\User $thisUser */
  12. $thisUser = Database::getManager()->getRepository('ChamiloUserBundle:User')->findBy(['username' => $values['user']]);
  13. UserManager::sendUserConfirmationMail($thisUser);
  14. Display::addFlash(Display::return_message(get_lang('EmailSent')));
  15. header('Location: '.api_get_path(WEB_PATH));
  16. exit;
  17. }
  18. $tpl = new Template(null);
  19. $tpl->assign('form', $form->toHtml());
  20. $content = $tpl->get_template('auth/resend_confirmation_mail.tpl');
  21. $tpl->assign('content', $tpl->fetch($content));
  22. $tpl->display_one_col_template();