diff --git a/checkin_notes b/checkin_notes index 69b52b96a2..27ed9f189a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -14582,10 +14582,21 @@ David 17 Dec 2005 py/Boinc/ setup_project.py -David 17 Dec 2005 +David 18 Dec 2005 - compile fix: include config.h where needed lib/ boinc_cmd.C filesys.C shmem.C + +David 18 Dec 2005 + - extend the am_set_info.php RPC to let you + change email address and password_hash. + + html/ + inc/ + email.inc + user/ + am_set_info.php + edit_email_action.php diff --git a/doc/acct_mgt.php b/doc/acct_mgt.php index 3cc878093e..29d6168a87 100644 --- a/doc/acct_mgt.php +++ b/doc/acct_mgt.php @@ -59,7 +59,7 @@ to the account manager, obtaining a list of accounts. It then attaches to these accounts and proceeds. -The create account RPCs +RPCs to create, look up, and modify accounts are described here.

Core client functionality

diff --git a/html/inc/email.inc b/html/inc/email.inc index 573abdd93e..13cc524ce1 100644 --- a/html/inc/email.inc +++ b/html/inc/email.inc @@ -35,6 +35,19 @@ function send_email($user, $subject, $body) { return mail($user->email_addr, $subject, $body, $headers); } } + +function send_verify_email($old, $new, $user) { + $x = md5($new.$user->authenticator); + mail( + $new, + PROJECT." account email change", +"The email address of your " . PROJECT . " account has been changed from $old to $new. +To validate the new address, visit the URL: +".URL_BASE."validate_email.php?u=$user->id&x=$x +" + ); +} + // Send an email describing an account to the user. // There are a few scenarios: // diff --git a/html/user/am_set_info.php b/html/user/am_set_info.php index c162323eaa..e54d618fbb 100644 --- a/html/user/am_set_info.php +++ b/html/user/am_set_info.php @@ -3,6 +3,7 @@ require_once("../inc/db.inc"); require_once("../inc/xml.inc"); require_once("../inc/team.inc"); +require_once("../inc/email.inc"); function reply($x) { echo " @@ -43,6 +44,8 @@ $send_email = process_user_text($_GET["send_email"]); $show_hosts = process_user_text($_GET["show_hosts"]); $teamid = get_int("teamid", true); $venue = process_user_text($_GET["venue"]); +$email_addr = strtolower(process_user_text($_GET["email_addr"])); +$password_hash = process_user_text($_GET["password_hash"]); $query = ""; if ($name) { @@ -80,9 +83,21 @@ if ($teamid) { if ($venue) { $query .= " venue='$venue', "; } +if ($email_addr && $email_addr!=$user->email_addr) { + $old_email_addr = $user->email_addr; + $query .= " email_addr='$email_addr', "; +} +if ($password_hash) { + $password_hash .= " password_hash='$password_hash', "; +} +// the seti_id=seti_id is to make it legal if no fields updated +// $result = mysql_query("update user set $query seti_id=seti_id where id=$user->id"); if ($result) { + if ($old_email_addr) { + send_verify_email($old_email_addr, $email_addr, $user); + } success(""); } else { error("database error"); diff --git a/html/user/edit_email_action.php b/html/user/edit_email_action.php index bc139379b4..47b7a6fd74 100644 --- a/html/user/edit_email_action.php +++ b/html/user/edit_email_action.php @@ -5,18 +5,6 @@ require_once("../inc/util.inc"); require_once("../inc/email.inc"); require_once("../inc/user.inc"); -function send_verify_email($old, $new, $user) { - $x = md5($new.$user->authenticator); - mail( - $new, - PROJECT." account email change", -"The email address of your " . PROJECT . " account has been changed from $old to $new. -To validate the new address, visit the URL: -".URL_BASE."validate_email.php?u=$user->id&x=$x -" - ); -} - db_init(); $user = get_logged_in_user();