$email = $db->escape_string($email); $query = $db->simple_select("users", "*", "email='".$db->escape_string($mybb->get_input('email'))."'"); $numusers = $db->num_rows($query); if($numusers < 1)
|
$email = $db->escape_string($email); $query = $db->simple_select("users", "*", "email='".$db->escape_string($mybb->get_input('email'))."'"); $numusers = $db->num_rows($query); if($numusers < 1)
|
$db->delete_query("awaitingactivation", "uid='{$user['uid']}' AND type='p'"); $user['activationcode'] = random_str(30); $now = TIME_NOW; $uid = $user['uid']; $awaitingarray = array( "uid" => $user['uid'], "dateline" => TIME_NOW, "code" => $user['activationcode'], "type" => "p" ); $db->insert_query("awaitingactivation", $awaitingarray); $username = $user['username']; $email = $user['email']; $activationcode = $user['activationcode']; $emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']); switch($mybb->settings['username_method'])
| while($user = $db->fetch_array($query))
|
case 0: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 1: $emailmessage = $lang->sprintf($lang->email_lostpw1, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 2: $emailmessage = $lang->sprintf($lang->email_lostpw2, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; default: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break;
| $db->delete_query("awaitingactivation", "uid='{$user['uid']}' AND type='p'"); $user['activationcode'] = random_str(30); $now = TIME_NOW; $uid = $user['uid']; $awaitingarray = array( "uid" => $user['uid'], "dateline" => TIME_NOW, "code" => $user['activationcode'], "type" => "p" ); $db->insert_query("awaitingactivation", $awaitingarray); $username = $user['username']; $email = $user['email']; $activationcode = $user['activationcode']; $emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']); switch($mybb->settings['username_method']) { case 0: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 1: $emailmessage = $lang->sprintf($lang->email_lostpw1, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 2: $emailmessage = $lang->sprintf($lang->email_lostpw2, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; default: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; } my_mail($email, $emailsubject, $emailmessage);
|
my_mail($email, $emailsubject, $emailmessage);
| $plugins->run_hooks("member_do_lostpw_end");
redirect("index.php", $lang->redirect_lostpwsent, "", true); } else { $mybb->input['action'] = "lostpw"; } } }
if($mybb->input['action'] == "lostpw") { $plugins->run_hooks("member_lostpw");
$captcha = ''; // Generate CAPTCHA? if($mybb->settings['captchaimage']) { require_once MYBB_ROOT.'inc/class_captcha.php'; $post_captcha = new captcha(true, "post_captcha");
if($post_captcha->html) { $captcha = $post_captcha->html;
|