41 $code = isset(
$_GET[
'code']) ? trim(
$_GET[
'code']) :
'';
43 if ($code !=
'' &&
$areyou == $code) {
46 $xoopsMailer->useMail();
47 $xoopsMailer->setTemplate(
"lostpass2.tpl");
48 $xoopsMailer->assign(
"SITENAME",
$GLOBALS[
'xoopsConfig'][
'sitename']);
49 $xoopsMailer->assign(
"ADMINMAIL",
$GLOBALS[
'xoopsConfig'][
'adminmail']);
50 $xoopsMailer->assign(
"SITEURL", XOOPS_URL .
"/");
51 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
52 $xoopsMailer->assign(
"NEWPWD", $newpass);
53 $xoopsMailer->setToUsers(
$user);
54 $xoopsMailer->setFromEmail(
$GLOBALS[
'xoopsConfig'][
'adminmail']);
55 $xoopsMailer->setFromName(
$GLOBALS[
'xoopsConfig'][
'sitename']);
57 if (!$xoopsMailer->send()) {
58 echo $xoopsMailer->getErrors();
62 $sql = sprintf(
"UPDATE %s SET pass = '%s' WHERE uid = %u",
$GLOBALS[
'xoopsDB']->prefix(
"users"), md5($newpass),
$user->getVar(
'uid') );
64 include
$GLOBALS[
'xoops']->path(
'header.php');
74 $xoopsMailer->useMail();
75 $xoopsMailer->setTemplate(
"lostpass1.tpl");
76 $xoopsMailer->assign(
"SITENAME",
$GLOBALS[
'xoopsConfig'][
'sitename']);
77 $xoopsMailer->assign(
"ADMINMAIL",
$GLOBALS[
'xoopsConfig'][
'adminmail']);
78 $xoopsMailer->assign(
"SITEURL", XOOPS_URL.
"/");
79 $xoopsMailer->assign(
"IP",
$_SERVER[
'REMOTE_ADDR']);
80 $xoopsMailer->assign(
"NEWPWD_LINK", XOOPS_URL .
"/modules/profile/lostpass.php?email={$email}&code=" .
$areyou);
81 $xoopsMailer->setToUsers(
$user);
82 $xoopsMailer->setFromEmail(
$GLOBALS[
'xoopsConfig'][
'adminmail']);
83 $xoopsMailer->setFromName(
$GLOBALS[
'xoopsConfig'][
'sitename']);
85 include
$GLOBALS[
'xoops']->path(
'header.php');
86 if (!$xoopsMailer->send()) {
87 echo $xoopsMailer->getErrors();