From 93b816cb77e173b6170d53f874c53bfe8431e7d6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 7 Feb 2003 09:00:35 +0000 Subject: [PATCH] account creation svn path=/trunk/boinc/; revision=879 --- checkin_notes | 8 + html/user/account_created.php | 33 ++- html/user/account_setup.php | 27 +++ html/user/account_setup_first.php | 33 +++ html/user/account_setup_first_download.php | 56 +++++ html/user/account_setup_first_project.php | 25 +++ html/user/account_setup_nonfirst.php | 31 +++ html/user/account_setup_nonfirst_done.php | 49 ++++ html/user/create_account_action.php | 2 +- html/user/create_account_form.php | 18 +- html/user/download.inc | 46 ++++ html/user/download.php | 57 ++--- html/user/get_passwd.php | 20 +- html/user/index.php | 46 +--- html/user/login_action.php | 36 +-- html/user/prefs.inc | 246 +++++++++++---------- html/user/prefs_edit_form.php | 24 ++ html/user/prefs_edit_global_action.php | 10 +- html/user/prefs_edit_project_action.php | 7 +- html/user/prefs_edit_resource_action.php | 24 ++ html/user/project_specific_prefs.inc | 5 +- html/user/util.inc | 12 +- 22 files changed, 539 insertions(+), 276 deletions(-) create mode 100644 html/user/account_setup.php create mode 100644 html/user/account_setup_first.php create mode 100644 html/user/account_setup_first_download.php create mode 100644 html/user/account_setup_first_project.php create mode 100644 html/user/account_setup_nonfirst.php create mode 100644 html/user/account_setup_nonfirst_done.php create mode 100644 html/user/download.inc create mode 100644 html/user/prefs_edit_form.php create mode 100644 html/user/prefs_edit_resource_action.php diff --git a/checkin_notes b/checkin_notes index 671ab0eabd..c6590b26da 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3115,3 +3115,11 @@ David Feb 4 2003 participate.html sched/ db_dump.C + +David Feb 7 2003 + - Changed account creation features quite a bit. + It now bifurcates according to whether this is first project. + Asks for preferences and offers download accordingly. + + html_user/ + account_setup* (new) diff --git a/html/user/account_created.php b/html/user/account_created.php index 3fcad81ec1..b87ed2dde7 100644 --- a/html/user/account_created.php +++ b/html/user/account_created.php @@ -2,25 +2,24 @@ include_once("util.inc"); + parse_str(getenv("QUERY_STRING")); page_head("Account created"); - echo "Your account has been created, - and an account key is being emailed to you. + echo " +

Congratulations - your ".PROJECT." account has been created

- If you are already running the BOINC client: -

- Select the Add Project command in the BOINC client. - Enter the project URL and your account key. -
- If you aren't running the BOINC client: -
- Download the BOINC client. - Install and run the client. - Enter the project URL and your account key. -
-

- Your account initially has default preferences - (limits on CPU, disk and network usage). - View or edit these preferences. + Your account key has been emailed to $email_addr. +
+ Please wait until you receive this email (it may take a minute or two). +

+ + + + + + + +
Copy and paste the account key here:
and click here:
+
"; page_tail(); diff --git a/html/user/account_setup.php b/html/user/account_setup.php new file mode 100644 index 0000000000..e501b361fd --- /dev/null +++ b/html/user/account_setup.php @@ -0,0 +1,27 @@ +Account configuration + ".PROJECT." uses the BOINC software system. +
BOINC lets you divide your computer time between several + distributed computing projects. +
Are you currently participating in other projects that use BOINC? +

+ Yes +

+ No + + "; + page_tail(); + +?> diff --git a/html/user/account_setup_first.php b/html/user/account_setup_first.php new file mode 100644 index 0000000000..2639c4d6d5 --- /dev/null +++ b/html/user/account_setup_first.php @@ -0,0 +1,33 @@ +Account configuration + Thank you for allowing ".PROJECT." to use part of your computer power. +
+ You control when and how your computer is used. +
+ We suggest using the defaults - + just go to the bottom and click OK. +"; +$prefs = default_prefs(); +global_prefs_update($user, $prefs); +project_prefs_update($user, $prefs); + +prefs_form_global($user, $prefs, "account_setup_first_project.php"); +page_tail(); + +?> diff --git a/html/user/account_setup_first_download.php b/html/user/account_setup_first_download.php new file mode 100644 index 0000000000..d856cb62c0 --- /dev/null +++ b/html/user/account_setup_first_download.php @@ -0,0 +1,56 @@ + + The next step is to download the BOINC software. + Click on the kind of computer that you have to download + the appropriate version of BOINC. +

+"; + +print_download_links(); + +echo " +

+ After the download is finished: +

+ + When the BOINC software first runs, + it will ask you for a project URL and an account key. + Copy and paste the following: + + + + That's it - you're done. + Thanks for participating in ".PROJECT.". + Visit our main page for more information. +"; + +page_tail(); +?> diff --git a/html/user/account_setup_first_project.php b/html/user/account_setup_first_project.php new file mode 100644 index 0000000000..a173e05bf5 --- /dev/null +++ b/html/user/account_setup_first_project.php @@ -0,0 +1,25 @@ +Account configuration: graphics +
+ ".PROJECT." lets you control the following properties of its graphics. +"; +$prefs = null; +prefs_form_project($prefs, "account_setup_first_download.php"); +page_tail(); + +?> diff --git a/html/user/account_setup_nonfirst.php b/html/user/account_setup_nonfirst.php new file mode 100644 index 0000000000..f6cdf1cf3a --- /dev/null +++ b/html/user/account_setup_nonfirst.php @@ -0,0 +1,31 @@ +Account configuration +
+ You can control how your resources + (computer time and disk space) are divided + among ".PROJECT." and the other BOINC-based projects + in which you participate. + You do this by assigning a resource share to each project. + The resources allocated to a project are proportional to its resource share. + The default resource share is 100. +"; +$prefs = prefs_parse($user->project_prefs); +prefs_form_resource($prefs, "account_setup_nonfirst_done.php"); +page_tail(); + +?> diff --git a/html/user/account_setup_nonfirst_done.php b/html/user/account_setup_nonfirst_done.php new file mode 100644 index 0000000000..b381ee84d8 --- /dev/null +++ b/html/user/account_setup_nonfirst_done.php @@ -0,0 +1,49 @@ +Account configuration: last step + + Your ".PROJECT." account is now set up. +
Now you must tell your computer about it. + + In each case copy and paste the following: + + + That's it - you're done. + Thanks for participating in ".PROJECT.". + Visit our main page for more information. +"; + +page_tail(); + +?> diff --git a/html/user/create_account_action.php b/html/user/create_account_action.php index 063c4a39dc..a022f87cf7 100644 --- a/html/user/create_account_action.php +++ b/html/user/create_account_action.php @@ -58,4 +58,4 @@ function show_error($str) { // return to it without getting "Repost form data" stuff send_auth_email($new_email_addr, $authenticator); - Header("Location: account_created.php"); + Header("Location: account_created.php?email_addr=$new_email_addr"); diff --git a/html/user/create_account_form.php b/html/user/create_account_form.php index f02c05d4c6..26e834d26f 100644 --- a/html/user/create_account_form.php +++ b/html/user/create_account_form.php @@ -5,19 +5,26 @@ include_once("util.inc"); page_head("Create account"); ?> +

Create an account

+
@@ -38,7 +45,7 @@ page_head("Create account"); diff --git a/html/user/download.inc b/html/user/download.inc new file mode 100644 index 0000000000..45fb4f2c93 --- /dev/null +++ b/html/user/download.inc @@ -0,0 +1,46 @@ +id and appid=$core_app->id order by version_num desc"); + + if (!$result) return; + + $found = false; + + $download_url = parse_config(""); + echo "\n"; + if ($app_version = mysql_fetch_object($result)) { + $filename = parse_element($app_version->xml_doc, ""); + if (!$filename) { echo "CAN'T FIND FILENAMEn $app_version->xml_doc\n";} + $version = sprintf( + "BOINC core client, version %s %.2f", + $platform->name, + $app_version->version_num/100 + ); + echo "\n"; + //$app_version->md5_cksum"; + $found = true; + } + if (!$found) + echo ""; + + mysql_free_result($result); +} + +function print_download_links() { + start_table(); + + $result = mysql_query("select * from app where name='core client'"); + $core_app = mysql_fetch_object($result); + mysql_free_result($result); + + $result = mysql_query("select * from platform"); + while ($platform = mysql_fetch_object($result)) { + platform_downloads($platform, $core_app); + } + echo ""; + mysql_free_result($result); + echo "
-Name or nickname: -
Your identifier on our web site. Use your real name or a nickname. +Name: +
+This will identify you on our web site. +Use your real name or a nickname. +
Email address: -
Your account key will be emailed to this address. +
+Must be a valid address. +
Country: -
select the country you wish to represent, if any. +
Select the country you wish to represent, if any.
-Postal (ZIP) code: +Postal or ZIP code: +
Optional
$platform->name
$version
No version found
foobar
\n"; +} + +?> diff --git a/html/user/download.php b/html/user/download.php index 8713e96b91..10fd09db04 100644 --- a/html/user/download.php +++ b/html/user/download.php @@ -3,49 +3,26 @@ require_once("db.inc"); require_once("util.inc"); -function platform_downloads($platform, $core_app) { - $result = mysql_query("select * from app_version where platformid=$platform->id and appid=$core_app->id order by version_num desc"); - - if (!$result) return; - - $found = false; - - $download_url = parse_config(""); - echo "$platform->name\n"; - if ($app_version = mysql_fetch_object($result)) { - $filename = parse_element($app_version->xml_doc, ""); - if (!$filename) { echo "CAN'T FIND FILENAMEn $app_version->xml_doc\n";} - $version = sprintf( - "BOINC core client, version %s %.2f", - $platform->name, - $app_version->version_num/100 - ); - echo "$version\n"; - //$app_version->md5_cksum"; - $found = true; - } - if (!$found) - echo "No version found"; - - mysql_free_result($result); -} - $authenticator = init_session(); db_init(); + page_head("Download the BOINC client"); - - start_table(); - - $result = mysql_query("select * from app where name='core client'"); - $core_app = mysql_fetch_object($result); - mysql_free_result($result); - - $result = mysql_query("select * from platform"); - while ($platform = mysql_fetch_object($result)) { - platform_downloads($platform, $core_app); - } - mysql_free_result($result); - echo "\n

\n"; + echo " + To participate in ".PROJECT." you must + install BOINC* software on your computer. +

+ If BOINC is already installed on your computer, + finish setting up your account. +

+ Otherwise download BOINC. +

+ + *BOINC is distributed computing software + developed at the University of California by + the SETI@home project. + + "; + print_download_links(); page_tail(); ?> diff --git a/html/user/get_passwd.php b/html/user/get_passwd.php index f602edffd8..f0656c2a51 100644 --- a/html/user/get_passwd.php +++ b/html/user/get_passwd.php @@ -6,22 +6,6 @@ require_once("user.inc"); page_head("Account key"); echo "

Get your ".PROJECT." account key

- - In order to protect your account from modification by others, - we require both your account key for access. - -

    -
  • Do not give this account key out to anybody! If you get an - e-mail requesting your account key, please ignore it - it's not from us. -
  • The e-mail address you enter below is where we'll send the - account key. It should be the same address you enter to log into - ".PROJECT.". If they aren't the same, we cannot send the account - key for both security and administrative reasons. -
  • If your BOINC login is not a valid email address, we - unfortunately cannot help you access your account or your credits. - You will need to create a new account with a valid e-mail address - to access any future credit. -

@@ -31,8 +15,8 @@ echo "

Get your ".PROJECT." account key

- Your account key will be sent by e-mail to the address you - entered - you should receive it in a few minutes.

"; + Your account key will be emailed to this address. + You should receive it in a few minutes.

"; page_tail(); diff --git a/html/user/index.php b/html/user/index.php index b48fe287c8..d5cd9ee1ae 100644 --- a/html/user/index.php +++ b/html/user/index.php @@ -6,58 +6,16 @@ page_head("Home page"); ?> -

What we're doing

The Astropulse project, based at UC Berkeley, uses the idle time of thousands of computers to analyze radio telescope signals. -Astropulse uses BOINC, -which allows you to participate in other -distributed computing projects at the same time.

How to join Astropulse

-
    -
  • -First, create an account. -You will be asked for your email address. -An account key will be emailed to you. -
  • If you don't already have it, -download the BOINC client. -Install and run the client, and give it your account key. -
  • If you're already running the BOINC client, -select the Add project command -and give it your account key. +

    +Create an account.

-

Instructions for beta testers

-When you install and run the BOINC client, -it will ask you for a project URL and account key. -Then it should download two work units, -process them, upload the results, -and continue doing this forever. -

-If at any point BOINC is neither computing nor transferring files, -something is probably wrong; -submit a bug report (see below). -

-Windows users: -The BOINC core client (accessable via its system tray icon) -has tabs that let you see projects, file transfers, -work in progress, and messages. -If you experience bugs, look at the file stderr.txt -in the BOINC directory. -If it's nonempty please include it in your bug report. -

-Unix and Mac OS/X users: -This version of the client has no GUI, -and writes to stderr and stdout. -Please include any suspicious-looking text in your bug reports. -

-Please report bugs by sending email to the boinc-beta -mailing list on SourceForge.net. -To join this list, go to -http://lists.sourceforge.net/lists/listinfo/boinc-beta. -

Returning participants

  • Log in diff --git a/html/user/login_action.php b/html/user/login_action.php index ee2851ba46..e063352660 100644 --- a/html/user/login_action.php +++ b/html/user/login_action.php @@ -6,14 +6,14 @@ $authenticator = init_session(); db_init(); $authenticator = $HTTP_POST_VARS["authenticator"]; - $email_addr = $HTTP_POST_VARS["email_addr"]; - $password = $HTTP_POST_VARS["password"]; + //$email_addr = $HTTP_POST_VARS["email_addr"]; + //$password = $HTTP_POST_VARS["password"]; if (strlen($authenticator)) { $query = "select * from user where authenticator='$authenticator'"; - } else if (strlen($email_addr)) { - $query = "select * from user where email_addr='$email_addr'"; - } else { - echo "NO SELECTION"; + //} else if (strlen($email_addr)) { + // $query = "select * from user where email_addr='$email_addr'"; + //} else { + // echo "NO SELECTION"; } $result = mysql_query($query); if ($result) { @@ -22,17 +22,21 @@ } if (!$user) { page_head("Log in"); - echo "There is no account with the account key or email address you have entered.\n"; - echo "Click Back to try again.\n"; - } else if (strlen($password)) { - page_head("Log in"); - if ($user->web_password != $HTTP_POST_VARS["existing_password"]) { - echo "Bad password."; - } + echo " + We have no account with the account key '$authenticator'. +
    Click Back to try again. + "; + page_tail(); + //} else if (strlen($password)) { + // page_head("Log in"); + // if ($user->web_password != $HTTP_POST_VARS["existing_password"]) { + // echo "Bad password."; + // } } else { $_SESSION["authenticator"] = $user->authenticator; - page_head("User Page"); - show_user_page_private($user); + $url = $HTTP_POST_VARS["url"]; + Header("Location: $url"); + //page_head("User Page"); + //show_user_page_private($user); } - page_tail(); ?> diff --git a/html/user/prefs.inc b/html/user/prefs.inc index e4c59ccdf4..e5328cb5d5 100644 --- a/html/user/prefs.inc +++ b/html/user/prefs.inc @@ -78,12 +78,6 @@ function element_end($parser, $name) { case "confirm_before_connecting": $parse_result->confirm_before_connecting = 1; break; - case "run_minimized": - $parse_result->run_minimized = 1; - break; - case "run_on_startup": - $parse_result->run_on_startup = 1; - break; case "low_water_days": $parse_result->low_water_days = $text; break; @@ -129,24 +123,27 @@ function char_handler($parser, $x) { $text = $text.$x; } +function default_prefs() { + $p = null; + $p->dont_run_on_batteries = 1; + $p->dont_run_if_user_active = 1; + $p->confirm_before_connecting = 0; + $p->low_water_days = 1; + $p->high_water_days = 3; + $p->disk_max_used_gb = 1000; + $p->disk_max_used_pct = 50; + $p->disk_min_free_gb = 1; + + $p->resource_share = 100; + $p->show_email = 0; + $p->send_email = 1; + return $p; +} + function prefs_parse($prefs_xml) { global $parse_result; - $parse_result = null; - $parse_result->dont_run_on_batteries = 0; - $parse_result->dont_run_if_user_active = 0; - $parse_result->confirm_before_connecting = 0; - $parse_result->run_minimized = 0; - $parse_result->run_on_startup = 0; - $parse_result->low_water_days = 1; - $parse_result->high_water_days = 3; - $parse_result->disk_max_used_gb = 1000; - $parse_result->disk_max_used_pct = 50; - $parse_result->disk_min_free_gb = 1; - - $parse_result->resource_share = 1; - $parse_result->show_email = 1; - $parse_result->send_email = 1; + $parse_result = default_prefs(); $xml_parser = xml_parser_create(); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); @@ -166,17 +163,24 @@ function prefs_show_global($prefs) { echo "\n"; echo "".TD2.LG_FONT."Global preferences
    These apply to all BOINC projects in which you participate\n"; - $batteries = $prefs->dont_run_on_batteries?"No":"Yes"; - $in_use = $prefs->dont_run_if_user_active?"No":"Yes"; - $confirm = $prefs->confirm_before_connecting?"Yes":"No"; - $minimized = $prefs->run_minimized?"Yes":"No"; - $startup = $prefs->run_on_startup?"Yes":"No"; - + if ($prefs->dont_run_on_batteries) { + $batteries = "No"; + } else { + $batteries = "Yes"; + } + if ($prefs->dont_run_if_user_active) { + $in_use = "No"; + } else { + $in_use = "Yes"; + } + if ($prefs->confirm_before_connecting) { + $confirm = "Yes"; + } else { + $confirm = "No"; + } row2a("Work if computer on batteries: ", $batteries); row2a("Work if computer in use: ", $in_use); row2a("Confirm before connecting to network: ", $confirm); - row2a("Run minimized: ", $minimized); - row2a("Run on startup: ", $startup); row2a("Minimum amount of work to buffer: ", "$prefs->low_water_days days"); row2a("Maximum amount of work to buffer: ", "$prefs->high_water_days days"); @@ -195,86 +199,104 @@ function prefs_show_project($prefs) { echo "".TD2.LG_FONT."Project preferences
    These apply only to this project\n"; row2a("Resource Share: ", $prefs->resource_share); - $prefs = project_specific_prefs_parse($prefs); + $prefs = project_specific_prefs_parse($prefs->project_specific); project_specific_prefs_show($prefs); echo "\n"; echo "
    Edit project preferences
    "; } function print_prefs_display($user) { - prefs_show_global(prefs_parse($user->global_prefs)); prefs_show_project(prefs_parse($user->project_prefs)); + prefs_show_resource(prefs_parse($user->project_prefs)); + prefs_show_global(prefs_parse($user->global_prefs)); } //////////////////////////////////////////// // // Functions to display preference subsets as forms // -function prefs_form_global($user, $prefs) { - echo "
    \n - \n - \n - \n"; - printf(" \n", $prefs->dont_run_on_batteries?"checked":""); - echo " \n - \n - \n"; - printf(" \n", $prefs->dont_run_if_user_active?"checked":""); - echo " \n - \n - \n"; - printf(" \n", $prefs->confirm_before_connecting?"checked":""); - echo " \n - \n - \n"; - printf(" \n", $prefs->run_minimized?"checked":""); - echo " \n - \n - \n"; - printf(" \n", $prefs->run_on_startup?"checked":""); - echo " \n - \n - \n"; - printf(" \n"); - echo " \n - \n - \n"; - printf(" \n"); - echo " \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n -
    Don't run if computer is on batteries
    Don't run if user is active
    Confirm before connecting
    Run minimized
    Run on startup
    Minimum amount of work to buffer days
    Maximum amount of work to buffer days
    Maximum disk space allowed
    to be used for BOINC
    Gbytes
    Minimum disk space to leave free Gbytes
    Maximum % of disk space to
    use for BOINC
    \n - \n -
    \n"; +function prefs_form_global($user, $prefs, $next_url) { + echo "
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Should ".PROJECT." run while computer is on batteries? +
    (This matters only for portable computers) +
    + "; + printf("Yes \n", $prefs->dont_run_on_batteries?"":"checked"); + printf("No \n", $prefs->dont_run_on_batteries?"checked":""); + echo "
    Should ".PROJECT." run while you're using the computer? + + "; + printf("Yes \n", $prefs->dont_run_if_user_active?"":"checked"); + printf("No \n", $prefs->dont_run_if_user_active?"checked":""); + echo "
    Wait for your OK before connecting to Internet? +
    (This matters only if you use a modem) +
    + "; + printf("Yes \n", $prefs->confirm_before_connecting?"checked":""); + printf("No \n", $prefs->confirm_before_connecting?"":"checked"); + echo "
    Keep enough to work on disk to last between + + + and + days +
    + You can limit the disk space used by ".PROJECT." in three different ways: +
    Use no more than Gbytes
    Leave at least Gbytes free
    Use no more than % of total space

    +
    + "; } -function prefs_form_project($prefs) { - echo "
    \n - \n - \n - \n - \n - \n"; - $prefs = project_specific_prefs_parse($prefs); - project_specific_prefs_edit($prefs); - echo " - \n -
    Resource share:
    - If you participate in multiple projects, -
    this is the proportion of resources -
    allocated to this project. -

    \n -
    \n"; +function prefs_form_resource($prefs_xml, $next_url) { + $prefs = project_specific_prefs_parse($prefs_xml); + echo "
    + + + + + + +
    Resource share: +
    The proportion of your resources +
    allocated to ".PROJECT.".

    + "; +} + +function prefs_form_project($prefs_xml, $next_url) { + $prefs = project_specific_prefs_parse($prefs_xml); + echo "
    + + + "; + project_specific_prefs_edit($prefs); + echo " + +

    +
    + "; } //////////////////////////////////////////// @@ -286,8 +308,6 @@ function prefs_global_parse_form(&$prefs) { $prefs->dont_run_on_batteries = isset($dont_run_on_batteries)?1:0; $prefs->dont_run_if_user_active = isset($dont_run_if_user_active)?1:0; $prefs->confirm_before_connecting = isset($confirm_before_connecting)?1:0; - $prefs->run_minimized = isset($run_minimized)?1:0; - $prefs->run_on_startup = isset($run_on_startup)?1:0; $prefs->low_water_days = $low_water_days; $prefs->high_water_days = $high_water_days; $prefs->disk_max_used_gb = $disk_max_used_gb; @@ -295,12 +315,16 @@ function prefs_global_parse_form(&$prefs) { $prefs->disk_min_free_gb = $disk_min_free_gb; } -function prefs_project_parse_form(&$prefs) { +function prefs_resource_parse_form(&$prefs) { parse_str(getenv("QUERY_STRING")); $prefs->resource_share = $resource_share; +} + +function prefs_project_parse_form(&$prefs) { $prefs->project_specific = project_specific_prefs_parse_form(); } + //////////////////////////////////////////// // // convert prefs from structure to XML @@ -308,29 +332,23 @@ function prefs_project_parse_form(&$prefs) { function global_prefs_make_xml($prefs) { $xml = "\n"; $now = time(); - $xml = $xml." $now\n"; + $xml = $xml."$now\n"; if ($prefs->dont_run_on_batteries) { - $xml = $xml." \n"; + $xml = $xml."\n"; } if ($prefs->dont_run_if_user_active) { - $xml = $xml." \n"; + $xml = $xml."\n"; } if ($prefs->confirm_before_connecting) { - $xml = $xml." \n"; + $xml = $xml."\n"; } - if ($prefs->run_minimized) { - $xml = $xml." \n"; - } - if ($prefs->run_on_startup) { - $xml = $xml." \n"; - } - $xml = $xml - ." $prefs->low_water_days\n" - ." $prefs->high_water_days\n"; - $xml = $xml - ." $prefs->disk_max_used_gb\n" - ." $prefs->disk_max_used_pct\n" - ." $prefs->disk_min_free_gb\n"; + $xml = $xml."$prefs->low_water_days +$prefs->high_water_days +"; + $xml = $xml."$prefs->disk_max_used_gb +$prefs->disk_max_used_pct +$prefs->disk_min_free_gb +"; $xml = $xml."\n"; return $xml; } diff --git a/html/user/prefs_edit_form.php b/html/user/prefs_edit_form.php new file mode 100644 index 0000000000..a84f226c4e --- /dev/null +++ b/html/user/prefs_edit_form.php @@ -0,0 +1,24 @@ +project_prefs); +prefs_form_project($prefs); +$prefs = prefs_parse($user->global_prefs); +prefs_form_global($user, $prefs); +echo "

    \n"; +page_tail(); + +?> diff --git a/html/user/prefs_edit_global_action.php b/html/user/prefs_edit_global_action.php index 9128aca3c6..336cd30ec8 100644 --- a/html/user/prefs_edit_global_action.php +++ b/html/user/prefs_edit_global_action.php @@ -4,23 +4,19 @@ include_once("db.inc"); include_once("util.inc"); include_once("prefs.inc"); -$authenticator = init_session(); db_init(); +$authenticator = init_session(); $user = get_user_from_auth($authenticator); if ($user == NULL) { print_login_form(); exit(); } +parse_str(getenv("QUERY_STRING")); -page_head("Preferences"); $prefs = prefs_parse($user->prefs); prefs_global_parse_form($prefs); global_prefs_update($user, $prefs); -echo "
    "; -echo "
    "; -print_prefs_display($user); -echo "

    \n"; -page_tail(); +Header("Location: $next_url"); ?> diff --git a/html/user/prefs_edit_project_action.php b/html/user/prefs_edit_project_action.php index e42b1ff62a..d749eaa956 100644 --- a/html/user/prefs_edit_project_action.php +++ b/html/user/prefs_edit_project_action.php @@ -4,6 +4,8 @@ include_once("db.inc"); include_once("util.inc"); include_once("prefs.inc"); +parse_str(getenv("QUERY_STRING")); + $authenticator = init_session(); db_init(); @@ -14,12 +16,9 @@ if ($user == NULL) { } no_cache(); -page_head("Preferences"); $prefs = prefs_parse($user->project_prefs); prefs_project_parse_form($prefs); project_prefs_update($user, $prefs); -print_prefs_display($user); -echo "

    \n"; -page_tail(); +Header("Location: $next_url"); ?> diff --git a/html/user/prefs_edit_resource_action.php b/html/user/prefs_edit_resource_action.php new file mode 100644 index 0000000000..32c9e67d90 --- /dev/null +++ b/html/user/prefs_edit_resource_action.php @@ -0,0 +1,24 @@ +project_prefs); +prefs_resource_parse_form($prefs); +project_prefs_update($user, $prefs); +Header("Location: $next_url"); + +?> diff --git a/html/user/project_specific_prefs.inc b/html/user/project_specific_prefs.inc index daf6e8d8bd..e434d16f34 100644 --- a/html/user/project_specific_prefs.inc +++ b/html/user/project_specific_prefs.inc @@ -48,8 +48,7 @@ function project_specific_prefs_show($prefs) { // parse XML, fill in struct // -function project_specific_prefs_parse($prefs) { - $xml = $prefs->project_specific; - $prefs->color_scheme = parse_element($xml, ""); +function project_specific_prefs_parse($prefs_xml) { + $prefs->color_scheme = parse_element($prefs_xml, ""); return $prefs; } diff --git a/html/user/util.inc b/html/user/util.inc index 3bba6d93c9..90e1fea24e 100644 --- a/html/user/util.inc +++ b/html/user/util.inc @@ -28,11 +28,9 @@ define("MASTER_URL", "http://maggie.ssl.berkeley.edu/ap/"); // function send_auth_email($email_addr, $auth) { 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." +"This email confirms the creation of your ".PROJECT." account. +".PROJECT." URL: ".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." ); @@ -87,16 +85,16 @@ function page_head($title) { // Put your project title and logo here echo "

    ".PROJECT."


    \n"; - echo "

    $title

    \n"; + //echo "

    $title

    \n"; } function page_tail() { - echo "

    Return to main ".PROJECT." page
    \n"; + echo "

    Return to ".PROJECT." main page
    \n"; // put your copyright notice etc. here - echo "

    Copyright (c) 2002 ".PROJECT."
    \n"; + echo "

    Copyright (c) 2003 ".PROJECT."
    \n"; } function date_str($when) {