26 $xoops->preload()->triggerEvent(
'core.lostpass.start');
30 $xoops->loadLanguage(
'user');
32 $email = Request::getEmail(
'email', null,
'GET');
36 $xoops->redirect(
"user.php", 2, XoopsLocale::NO_);
48 $code = Request::getCmd(
'code',
'',
'GET');
49 $areyou = substr(md5($userObject->getVar(
"pass")), 0, 5);
51 $newpass =
$xoops->makePass();
52 $xoopsMailer =
$xoops->getMailer();
53 $xoopsMailer->useMail();
54 $xoopsMailer->setTemplate(
"lostpass2.tpl");
55 $xoopsMailer->assign(
"SITENAME",
$xoops->getConfig(
'sitename'));
56 $xoopsMailer->assign(
"ADMINMAIL",
$xoops->getConfig(
'adminmail'));
57 $xoopsMailer->assign(
"SITEURL",
$xoops_url .
"/");
58 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
59 $xoopsMailer->assign(
"NEWPWD", $newpass);
60 $xoopsMailer->setToUsers($userObject);
61 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
62 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
64 if (!$xoopsMailer->send()) {
65 echo $xoopsMailer->getErrors();
68 $userObject->setVar(
"pass", password_hash($newpass, PASSWORD_DEFAULT));
77 $xoopsMailer =
$xoops->getMailer();
78 $xoopsMailer->useMail();
79 $xoopsMailer->setTemplate(
"lostpass1.tpl");
80 $xoopsMailer->assign(
"SITENAME",
$xoops->getConfig(
'sitename'));
81 $xoopsMailer->assign(
"ADMINMAIL",
$xoops->getConfig(
'adminmail'));
82 $xoopsMailer->assign(
"SITEURL",
$xoops_url .
"/");
83 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
85 $xoopsMailer->setToUsers($userObject);
86 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
87 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
90 if (!$xoopsMailer->send()) {
91 echo $xoopsMailer->getErrors();
if(empty($email)) $userHandler
const F_NEW_PASSWORD_REQUEST_AT
defined('DS') or define('DS' DIRECTORY_SEPARATOR
const SF_PASSWORD_SENT_TO
if(!is_object($module)||!$module->getVar('isactive')) $msg
const F_CONFIRMATION_EMAIL_SENT