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();
|
|
|
|
|
2005-03-23 03:04:56 +00:00
|
|
|
$email_addr = process_user_text(strtolower($_POST["email_addr"]));
|
2005-04-15 18:43:53 +00:00
|
|
|
if (!strlen($email_addr)) {
|
|
|
|
error_page("no address given");
|
|
|
|
}
|
|
|
|
$user = lookup_user_email_addr($email_addr);
|
|
|
|
if (!$user) {
|
2005-03-23 03:04:56 +00:00
|
|
|
$esc_email_addr = escape_pattern("@".$email_addr."_");
|
2005-04-15 18:43:53 +00:00
|
|
|
$query = "select * from user where 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) {
|
2005-03-23 03:04:56 +00:00
|
|
|
page_head("No such user");
|
|
|
|
echo "There is no user with email address $email_addr. <br>
|
2003-08-31 00:18:45 +00:00
|
|
|
Try reentering your email address.<p>
|
|
|
|
";
|
2002-12-06 21:37:30 +00:00
|
|
|
} else {
|
2005-03-23 03:04:56 +00:00
|
|
|
page_head("Mailed account key");
|
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
|
|
|
?>
|