$do_log['user_name'] = $row['user_name']; $do_log['user_loginname'] = $row['user_loginname']; $do_log['activation_code'] = $rcode; if (getperms('0')) { $ns->tablerender("Testing Mode", print_a($message, true)); require_once FOOTERF; exit; } // Try to send the email if (sendemail($clean_email, "" . LAN_09 . "" . SITENAME, $message)) { e107::getMessage()->addInfo(LAN_FPW6); $do_log['password_result'] = LAN_FPW20; } else { //$text = "<div style='text-align:center'>".LAN_02."</div>"; $do_log['password_result'] = LAN_FPW19; fpw_error(LAN_02); } // Log to user audit log e107::getAdminLog()->user_audit(USER_AUDIT_PW_RES, $do_log, $row['user_id'], $row['user_name']); $ns->tablerender(LAN_03, $text . e107::getMessage()->render()); require_once FOOTERF; exit; } else { //$text = LAN_213; //$ns->tablerender(LAN_214, "<div style='text-align:center'>".$text."</div>"); e107::getMessage()->addError(LAN_213); $ns->tablerender(LAN_214, e107::getMessage()->render()); } } $sc = array(); // needed?
echo "<script type='text/javascript'>document.location.href='index.php'</script>\n"; die; } switch ($row['user_ban']) { // Banned user, or not validated case USER_BANNED: die; case USER_VALIDATED: break; default: fpw_error(LAN_FPW22 . ':' . $row['user_ban']); // Intentionally rather a vague message exit; } if ($result = $sql->db_Select('tmp', '*', "`tmp_ip` = 'pwreset' AND `tmp_info` LIKE '" . $row['user_loginname'] . FPW_SEPARATOR . "%'")) { fpw_error(LAN_FPW4); // Password reset already requested exit; } mt_srand((double) microtime() * 1000000); $maxran = 1000000; $rand_num = mt_rand(0, $maxran); $datekey = date('r'); $rcode = md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref) . $rand_num . $datekey); $link = SITEURL . 'fpw.php?' . $rcode; $message = LAN_FPW5 . ' ' . SITENAME . ' ' . LAN_FPW14 . ' : [' . e107::getIPHandler()->getIP(FALSE) . '] ' . e107::getIPHandler()->getIP(TRUE) . ".\n\n" . LAN_FPW15 . "\n\n" . LAN_FPW16 . "\n\n" . LAN_FPW17 . "\n\n{$link}"; $deltime = time() + 86400 * 2; //Set timestamp two days ahead so it doesn't get auto-deleted $sql->db_Insert('tmp', "'pwreset',{$deltime},'" . $row['user_loginname'] . FPW_SEPARATOR . $rcode . "'"); $do_log['password_action'] = LAN_FPW18; $do_log['user_id'] = $row['user_id'];