diff --git a/checkin_notes b/checkin_notes index c6faa9107c..ddbe1da31c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2727,3 +2727,20 @@ David Dec 18 2002 util.inc lib/ countries.C,h + +David Dec 19 2002 + - The Edit Account form now shows current values + directly in input fields. + - Country select popup shows current value + - Improve new account email + + html_user/ + account_created.php + change_pass_action.php + create_account_action.php + edit.inc + edit_action.php + edit_user_info.php + util.inc + tools/ + country_select.C diff --git a/html/user/account_created.php b/html/user/account_created.php index 638d73d19c..3fcad81ec1 100644 --- a/html/user/account_created.php +++ b/html/user/account_created.php @@ -23,8 +23,6 @@ View or edit these preferences. "; - send_auth_email($new_email_addr, $authenticator); - page_tail(); ?> diff --git a/html/user/change_pass_action.php b/html/user/change_pass_action.php index 1072e3d636..331efdd864 100644 --- a/html/user/change_pass_action.php +++ b/html/user/change_pass_action.php @@ -28,14 +28,14 @@ printf( TABLE2."\n" ."Password changed successfully. Use your new password to\n" - ." login to your account.\n" + ." login to your account.\n" ."\n" ); } else { printf( TABLE2."\n" ."Password was unable to be changed. Continue using your old \n" - ."password to login to your account. You can try \n" + ."password to login to your account. You can try \n" ."changing your password again later.\n" ."" ); diff --git a/html/user/create_account_action.php b/html/user/create_account_action.php index b8d2feb223..063c4a39dc 100644 --- a/html/user/create_account_action.php +++ b/html/user/create_account_action.php @@ -57,4 +57,5 @@ function show_error($str) { // In success case, redirect to a fixed page so that user can // return to it without getting "Repost form data" stuff + send_auth_email($new_email_addr, $authenticator); Header("Location: account_created.php"); diff --git a/html/user/edit.inc b/html/user/edit.inc index b564723486..f64e3f73cf 100644 --- a/html/user/edit.inc +++ b/html/user/edit.inc @@ -1,32 +1,5 @@ \n" - .TABLE2."\n" - ."To edit your User Information, fill out the fields that you wish to change.\n" - ." You do not need to enter anything into the fields that you wish to keep the same.\n" - ."
\n" - ."".TD2.LG_FONT."User name:\n" - ); - row2("", $user->name); - echo "
\n"; - echo "".TD2.LG_FONT."Email address:\n"; - row2("", $user->email_addr); - echo "
\n"; - echo "".TD2.LG_FONT."Country:\n"; - echo "\n"; - echo "$user->country\n"; - echo "
\n"; - echo "".TD2.LG_FONT."Postal (ZIP) code:\n"; - row2("", $user->postal_code); - echo "\n"; - echo "

       \n"; - echo ""; -} - function print_change_password($user) { printf( "
\n" @@ -49,69 +22,70 @@ function print_change_password($user) { function print_update_ok($e_ok) { if ($e_ok == EMAIL_EXISTS) { - printf( - TABLE2."\n" - ."There's already an account with that email address. Click the Back button\n" - ." on your browser to edit your information, or login to your \n" - .$project." account.\n" - ."Any other changes you've made, if any, were successfully updated.\n" - ."\n" - ); + echo TABLE2."\n + There's already an account with that email address. + Click the Back button\n + in your browser to edit your information, + or login to your \n + ".$project." account.\n + Any other changes you've made, + if any, were successfully updated.\n + \n"; } else if ($e_ok == EMAIL_FAIL) { - printf( - TABLE2."\n" - ."Your email address failed to be updated. Click the Back button\n" - ." on your browser to edit your information, or try again later.\n" - ."Any other changes you've made, if any, were successfully updated.\n" - ."\n" - ); + echo TABLE2."\n + Your email address failed to be updated. + Click the Back button\n + in your browser to edit your information, + or try again later.\n + Any other changes you've made, + if any, were successfully updated.\n + \n"; } else if ($e_ok == EMAIL_UPDATED) { - printf( - TABLE2."\n" - ."Your information was successfully updated. A new, temporary password will be sent to the\n" - ." email address you provided. You must use this new password the next time you login.\n" - ."\n" - ); + echo TABLE2."\n + Your information was successfully updated. + A new, temporary password will be sent to the\n + email address you provided. + You must use this new password the next time you login. + \n\n"; } else { - printf( - TABLE2."\n" - ."Your information was successfully updated.\n" - ."\n" - ); + echo TABLE2."\n + Your information was successfully updated.\n + \n"; } } function print_update_fail($e_ok) { if ($e_ok == EMAIL_EXISTS) { - printf( - TABLE2."\n" - ."There's already an account with that email address. Click the Back button\n" - ." on your browser to edit your information, or login to your \n" - .$project." account. \n" - ."Any other changes you've made, if any, failed to be updated. Please try again later.\n" - ."\n" - ); + echo TABLE2."\n + There's already an account with that email address. + Click the Back button in your browser + to edit your information, + or login to your \n + ".$project." account. \n + Any other changes you've made, if any, + failed to be updated. Please try again later.\n + \n"; } else if ($e_ok == EMAIL_FAIL) { - printf( - TABLE2."\n" - ."Your information failed to be updated. Click the Back button\n" - ." on your browser to edit your information, or try again later.\n" - ."\n" - ); + echo TABLE2."\n + Your information failed to be updated. + Click the Back button\n + in your browser to edit your information, + or try again later.\n + \n"; } else if ($e_ok == EMAIL_UPDATED) { - printf( - TABLE2."\n" - ."Your email address was successfully updated. A new, temporary password will be sent to the\n" - ." email address you provided. You must use this new password the next time you login.\n" - ."Any other changes you've made, if any, failed to be updated. Please try again later.\n" - ."\n" - ); + echo TABLE2."\n + Your email address was successfully updated. + A new, temporary password will be sent to the\n + email address you provided. + You must use this new password the next time you login.\n + Any other changes you've made, if any, + failed to be updated. Please try again later.\n + \n"; } else { - printf( - TABLE2."\n" - ."Your information failed to be updated. Please try again later.\n" - ."\n" - ); + echo TABLE2."\n + Your information failed to be updated. + Please try again later.\n + \n"; } } diff --git a/html/user/edit_action.php b/html/user/edit_action.php index 62aae78a47..8aefe8d43d 100644 --- a/html/user/edit_action.php +++ b/html/user/edit_action.php @@ -16,6 +16,12 @@ $my_country = $HTTP_POST_VARS["my_country"]; $my_zip = $HTTP_POST_VARS["my_zip"]; + // TODO: we need to keep track of whether email addresses + // have been verified or not (i.e. whether we ever got back + // the authenticator, either via web or from core client) + // The right was to do this is to add a "email_verified" + // flag to the user structure. + // Also, email need not be unique. if (strlen($my_email)) { $query = sprintf("select * from user where email_addr='%s'", $my_email); diff --git a/html/user/edit_user_info.php b/html/user/edit_user_info.php index 4f1babd8ca..58f7bb1a10 100644 --- a/html/user/edit_user_info.php +++ b/html/user/edit_user_info.php @@ -1,20 +1,29 @@ name); - page_head($head); - print_edit_user_info($user); - page_tail(); +page_head("Edit user information"); +echo "\n + ".TABLE2."\n + User name\n + + Email address\n + + Country: + + Postal (ZIP) code + +
\n + \n +
"; +page_tail(); ?> - - - - diff --git a/html/user/util.inc b/html/user/util.inc index 437b880879..3bba6d93c9 100644 --- a/html/user/util.inc +++ b/html/user/util.inc @@ -25,13 +25,22 @@ define("PROJECT", "Astropulse"); define("MASTER_URL", "http://maggie.ssl.berkeley.edu/ap/"); // Sends the authenticator to the given email address +// function send_auth_email($email_addr, $auth) { - mail($email_addr, "Account information for ".PROJECT, - "The URL for this project is \n\n".MASTER_URL."\n\nYour account key is \n\n$auth\n\nCopy this information into the BOINC client."); + mail($email_addr, PROJECT." new account confirmation", +"This email confirms the creation of your account with ".PROJECT.", +a distributed computing project based on BOINC.\n +The URL for this project: ".MASTER_URL." +Your account key: $auth\n +Copy and paste these into the BOINC client when prompted.\n +Please save this email, as you will need the account key +to access your account on the ".PROJECT." web site." + ); } // Initializes the session and returns the authenticator // for the session (if any) +// function init_session() { session_start(); if (!isset($_SESSION["authenticator"])) { @@ -40,7 +49,8 @@ function init_session() { return $_SESSION["authenticator"]; } -// requires that the user be logged in +// if not logged in, put up login form and exit +// function require_login($user) { if (!$user) { print_login_form(); @@ -65,7 +75,7 @@ function get_user_from_cookie() { function show_login($user) { if ($user) { echo "Logged in as %s.\n", $user->name; - echo "
Log in as someone else.\n"; + echo "
Log in as someone else.\n"; } else { echo "Not logged in"; } @@ -122,9 +132,9 @@ function random_string() { return md5(uniqid(rand())); } -function print_country_select() { +function print_country_select($country) { $x = posix_getcwd(); - PassThru("$x/country_select"); + PassThru("$x/country_select '$country'"); } function print_login_form() { diff --git a/tools/country_select.C b/tools/country_select.C index 90e6fbca2e..e49f8a2e38 100644 --- a/tools/country_select.C +++ b/tools/country_select.C @@ -21,9 +21,14 @@ #include "countries.h" -int main() { +int main(int argc, char** argv) { int i; for (i=0; i%s\n", countries[i], countries[i]); + printf( + "