43 $code = isset(
$_GET[
'code']) ? trim(
$_GET[
'code']) :
'';
45 if ($code !=
'' &&
$areyou == $code) {
48 $xoopsMailer->useMail();
49 $xoopsMailer->setTemplate(
"lostpass2.tpl");
50 $xoopsMailer->assign(
"SITENAME",
$xoopsConfig[
'sitename']);
51 $xoopsMailer->assign(
"ADMINMAIL",
$xoopsConfig[
'adminmail']);
52 $xoopsMailer->assign(
"SITEURL", XOOPS_URL .
"/");
53 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
54 $xoopsMailer->assign(
"NEWPWD", $newpass);
55 $xoopsMailer->setToUsers(
$getuser[0]);
59 if (! $xoopsMailer->send()) {
60 echo $xoopsMailer->getErrors();
63 $sql = sprintf(
"UPDATE %s SET pass = '%s' WHERE uid = %u",
$xoopsDB->prefix(
"users"), md5($newpass),
$getuser[0]->getVar(
'uid'));
65 include
$GLOBALS[
'xoops']->path(
'header.php');
67 include
$GLOBALS[
'xoops']->path(
'footer.php');
75 $xoopsMailer->useMail();
76 $xoopsMailer->setTemplate(
"lostpass1.tpl");
77 $xoopsMailer->assign(
"SITENAME",
$xoopsConfig[
'sitename']);
78 $xoopsMailer->assign(
"ADMINMAIL",
$xoopsConfig[
'adminmail']);
79 $xoopsMailer->assign(
"SITEURL", XOOPS_URL .
"/");
80 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
81 $xoopsMailer->assign(
"NEWPWD_LINK", XOOPS_URL .
"/lostpass.php?email=" .
$email .
"&code=" .
$areyou);
82 $xoopsMailer->setToUsers(
$getuser[0]);
86 include
$GLOBALS[
'xoops']->path(
'header.php');
87 if (! $xoopsMailer->send()) {
88 echo $xoopsMailer->getErrors();
93 include
$GLOBALS[
'xoops']->path(
'footer.php');