From 05b2a28785fd3aca5ced7337ca43e2f26b0ea554 Mon Sep 17 00:00:00 2001 From: Cecile Kim Date: Mon, 12 Aug 2002 19:46:52 +0000 Subject: [PATCH] added edit.inc, edit_action.php, edit_user_info.php svn path=/trunk/boinc/; revision=293 --- html/user/edit.inc | 20 ++++++++ html/user/edit_action.php | 93 ++++++++++++++++++++++++++++++++++++ html/user/edit_user_info.php | 24 ++++++++++ 3 files changed, 137 insertions(+) create mode 100644 html/user/edit.inc create mode 100644 html/user/edit_action.php create mode 100644 html/user/edit_user_info.php diff --git a/html/user/edit.inc b/html/user/edit.inc new file mode 100644 index 0000000000..a26dde4f0c --- /dev/null +++ b/html/user/edit.inc @@ -0,0 +1,20 @@ +\n" + .TABLE2."\n"; + ."".TD3.LG_FONT."User Information:\n" + ); + row3("User name: ", "", $user->name); + row3("Email address: ", "", $user->email_addr); + echo "Country: "; + row3("Postal (ZIP) code: ", "", $user->postal_code); + echo "".TD3."
/td>\n"; + echo "".TD3."\n"; + echo "\n"; +} + +?> diff --git a/html/user/edit_action.php b/html/user/edit_action.php new file mode 100644 index 0000000000..7d31350379 --- /dev/null +++ b/html/user/edit_action.php @@ -0,0 +1,93 @@ +id); + $result = mysql_query($query); + if($result) { + print_update_ok(); + } else { + print_update_fail(); + } + } else if (strlen($my_name) && strlen($my_country)) { + query = sprintf("update user set name='%s', country='%s' where id=%d", $my_name, $my_country, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + } else if (strlen($my_country) && strlen($my_zip)) { + query = sprintf("update user set country='%s', postal_code='%s' where id=%d", $my_country, $my_zip, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + } else if (strlen($my_name) && strlen($my_zip)) { + query = sprintf("update user set name='%s', postal_code=%d where id=%d", $my_name, $my_zip, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + } else if (strlen($my_name)) { + query = sprintf("update user set name='%s' where id=%d", $my_name, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + + } else if (strlen($my_zip)) { + query = sprintf("update user set country='%s', postal_code='%s' where id=%d", $my_country, $my_zip, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + + } else if (strlen($my_country)) { + query = sprintf("update user set country='%s', postal_code='%s' where id=%d", $my_country, $my_zip, $user->id); + $result = mysql_query($query); + if($result) { + print_update_note(); + } else { + print_update_fail(); + } + } + + + + $query = sprintf("select * from user where email_addr='%s', + $HTTP_POST_VARS["my_email"]); + $result = mysql_query($query); + if ($result) { + $user = mysql_fetch_object($result); + mysql_free_result($result); + } + if ($user) { + 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" + ."\n" + ); + } else { + + + diff --git a/html/user/edit_user_info.php b/html/user/edit_user_info.php new file mode 100644 index 0000000000..c169357477 --- /dev/null +++ b/html/user/edit_user_info.php @@ -0,0 +1,24 @@ +here to login.\n"); + } + page_tail(); + +?> + + + +