2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
2004-11-18 20:01:12 +00:00
|
|
|
require_once("../inc/email.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
2004-12-06 22:41:19 +00:00
|
|
|
page_head("Mailed account key");
|
2004-06-14 18:05:47 +00:00
|
|
|
$email_addr = trim(strtolower($HTTP_POST_VARS["email_addr"]));
|
2002-12-06 21:37:30 +00:00
|
|
|
if (strlen($email_addr)) {
|
2005-03-03 23:49:49 +00:00
|
|
|
$esc_email_addr = escape_pattern("@".$email_addr."_%");
|
|
|
|
$query = "select * from user where email_addr = '$email_addr' "
|
2004-08-06 12:12:26 +00:00
|
|
|
. "or email_addr like '$esc_email_addr'";
|
2002-08-07 18:56:55 +00:00
|
|
|
$result = mysql_query($query);
|
|
|
|
$user = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$user) {
|
2002-12-06 23:25:16 +00:00
|
|
|
echo "There is no user with that email address. <br>
|
2003-08-31 00:18:45 +00:00
|
|
|
Try reentering your email address.<p>
|
|
|
|
";
|
2002-12-06 21:37:30 +00:00
|
|
|
} else {
|
2004-12-06 22:41:19 +00:00
|
|
|
if (split_munged_email_addr($user->email_addr, $auth, $orig_email)) {
|
|
|
|
$is_auth = false;
|
|
|
|
$user->email_addr = $orig_email;
|
|
|
|
} else {
|
|
|
|
$is_auth = true;
|
|
|
|
}
|
|
|
|
$retval = send_auth_email($user, false, $is_auth);
|
2004-09-30 17:44:43 +00:00
|
|
|
if ($retval) {
|
|
|
|
email_sent_message($email_addr);
|
|
|
|
} else {
|
|
|
|
echo "Can't send email to $user->email_addr: $retval";
|
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
2002-12-06 21:37:30 +00:00
|
|
|
?>
|