2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2007-11-20 00:23:02 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/util.inc");
|
2004-11-18 20:01:12 +00:00
|
|
|
require_once("../inc/email.inc");
|
2007-11-20 00:23:02 +00:00
|
|
|
require_once("../project/project.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2007-11-20 00:23:02 +00:00
|
|
|
function email_sent_message($email_addr) {
|
|
|
|
if (defined('EMAIL_FROM')) {
|
|
|
|
$email_from = EMAIL_FROM;
|
|
|
|
} else {
|
|
|
|
$email_from = URL_BASE;
|
|
|
|
}
|
|
|
|
|
|
|
|
page_head("Email sent");
|
|
|
|
echo "
|
|
|
|
Instructions have been emailed to $email_addr.
|
|
|
|
<p>
|
|
|
|
If the email doesn't arrive in a few minutes,
|
|
|
|
your ISP may be blocking it as spam.
|
|
|
|
In this case please contact your ISP and
|
|
|
|
ask them to not block email from $email_from.
|
|
|
|
";
|
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2008-06-11 19:36:10 +00:00
|
|
|
$email_addr = strtolower(post_str("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);
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
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 {
|
2006-04-03 23:09:20 +00:00
|
|
|
if (substr($user->authenticator, 0, 1) == 'x') {
|
|
|
|
page_head("Account Currently Disabled");
|
|
|
|
echo "This account has been administratively disabled.";
|
|
|
|
} else {
|
|
|
|
$user->email_addr = $email_addr;
|
2008-09-25 22:03:56 +00:00
|
|
|
$retval = send_auth_email($user);
|
2006-04-03 23:09:20 +00:00
|
|
|
if ($retval) {
|
|
|
|
email_sent_message($email_addr);
|
|
|
|
} else {
|
2007-11-20 00:23:02 +00:00
|
|
|
page_head("Email failed");
|
2009-04-08 17:46:47 +00:00
|
|
|
echo "Can't send email to $user->email_addr";
|
2006-04-03 23:09:20 +00:00
|
|
|
}
|
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
2002-12-06 21:37:30 +00:00
|
|
|
?>
|