@@ -320,6 +349,12 @@ function prefs_resource_parse_form(&$prefs) {
$prefs->resource_share = $resource_share;
}
+function prefs_email_parse_form(&$prefs) {
+ parse_str(getenv("QUERY_STRING"));
+ $prefs->send_email = isset($send_email)?1:0;
+ $prefs->show_email = isset($show_email)?1:0;
+}
+
function prefs_project_parse_form(&$prefs) {
$prefs->project_specific = project_specific_prefs_parse_form();
}
diff --git a/html/user/prefs_edit_email_action.php b/html/user/prefs_edit_email_action.php
new file mode 100644
index 0000000000..e0bdc2e202
--- /dev/null
+++ b/html/user/prefs_edit_email_action.php
@@ -0,0 +1,24 @@
+project_prefs);
+prefs_email_parse_form($prefs);
+project_prefs_update($user, $prefs);
+Header("Location: $next_url");
+
+?>
diff --git a/html/user/prefs_edit_email_form.php b/html/user/prefs_edit_email_form.php
new file mode 100644
index 0000000000..e95a1249c8
--- /dev/null
+++ b/html/user/prefs_edit_email_form.php
@@ -0,0 +1,21 @@
+project_prefs);
+prefs_form_email($prefs, "prefs.php");
+page_tail();
+
+?>
diff --git a/html/user/prefs_edit_form.php b/html/user/prefs_edit_form.php
index a84f226c4e..7b5b990ee7 100644
--- a/html/user/prefs_edit_form.php
+++ b/html/user/prefs_edit_form.php
@@ -12,7 +12,7 @@ if ($user == NULL) {
print_login_form();
exit();
}
-page_head("Edit preferences");
+page_head("Edit preferences", $user);
parse_str(getenv("QUERY_STRING"));
$prefs = prefs_parse($user->project_prefs);
prefs_form_project($prefs);
diff --git a/html/user/prefs_edit_global_form.php b/html/user/prefs_edit_global_form.php
index bbd90c4a48..f6edae167c 100644
--- a/html/user/prefs_edit_global_form.php
+++ b/html/user/prefs_edit_global_form.php
@@ -12,11 +12,18 @@ if ($user == NULL) {
print_login_form();
exit();
}
-page_head("Edit Global Preferences");
+page_head("Edit global preferences", $user);
$prefs = prefs_parse($user->global_prefs);
-prefs_form_global($user, $prefs);
+echo "Edit global preferences
+ These preferences apply to all the BOINC projects
+ in which you participate.
+
If you participate in multiple BOINC projects,
+ edit your preferences only one project's web site;
+
otherwise edits may be overwritten.
+";
+
+prefs_form_global($user, $prefs, "prefs.php");
echo "Back to preferences\n";
-echo "\n";
page_tail();
?>
diff --git a/html/user/prefs_edit_project_form.php b/html/user/prefs_edit_project_form.php
index b4390aa36b..3e97a7dd6a 100644
--- a/html/user/prefs_edit_project_form.php
+++ b/html/user/prefs_edit_project_form.php
@@ -12,10 +12,10 @@ if ($user == NULL) {
print_login_form();
exit();
}
-page_head("Edit project preferences");
+page_head("Edit project preferences", $user);
parse_str(getenv("QUERY_STRING"));
$prefs = prefs_parse($user->project_prefs);
-prefs_form_project($prefs);
+prefs_form_project($prefs, "prefs.php");
echo "
\n";
page_tail();
diff --git a/html/user/prefs_edit_resource_form.php b/html/user/prefs_edit_resource_form.php
new file mode 100644
index 0000000000..e28f82bf1c
--- /dev/null
+++ b/html/user/prefs_edit_resource_form.php
@@ -0,0 +1,21 @@
+project_prefs);
+prefs_form_resource($prefs, "prefs.php");
+page_tail();
+
+?>
diff --git a/html/user/project_specific_prefs.inc b/html/user/project_specific_prefs.inc
index e434d16f34..6752391bc7 100644
--- a/html/user/project_specific_prefs.inc
+++ b/html/user/project_specific_prefs.inc
@@ -41,7 +41,7 @@ function project_specific_prefs_parse_form() {
//
function project_specific_prefs_show($prefs) {
echo "
\n
- Color scheme: | \n
+ Color scheme: | \n
$prefs->color_scheme | \n
\n";
}
diff --git a/html/user/user.inc b/html/user/user.inc
index 0124e22649..0f1711d90c 100644
--- a/html/user/user.inc
+++ b/html/user/user.inc
@@ -2,15 +2,15 @@
function show_user_stats($user) {
echo TABLE2."\n";
- echo "".TD2.LG_FONT."User Stats:
\n";
- $row = sprintf("%s user since: ", $project);
+ echo "".TD2.LG_FONT."User stats
\n";
+ $row = sprintf("%s user since", $project);
row($row, time_str($user->create_time));
- row("Total credit: ", $user->total_credit);
- row("Recent average credit: ", $user->expavg_credit);
+ row("Total credit", $user->total_credit);
+ row("Recent average credit", $user->expavg_credit);
if ($user->teamid) {
$result = mysql_query("select * from team where id = $user->teamid");
$team = mysql_fetch_object($result);
- row("Team: ", "id>$team->name");
+ row("Team", "id>$team->name");
} else {
row("Team: ", "None");
}
@@ -19,7 +19,8 @@ function show_user_stats($user) {
function show_user_profile($user) {
echo TABLE2."\n";
- echo "".TD2.LG_FONT."User Information:
\n";
+ echo "".TD2.LG_FONT."User information
\n";
+ row("name", $user->name);
row("email address", $user->email_addr);
row("country", $user->country);
row("postal (ZIP) code", $user->postal_code);
@@ -46,10 +47,11 @@ function show_hosts($user) {
function show_host_brief($host) {
echo "
- id>$host->domain_name |
- $host->total_credit |
- $host->expavg_credit |
-
";
+ id>$host->domain_name |
+ $host->total_credit |
+ $host->expavg_credit |
+
+ ";
}
// show a summary of the user.
diff --git a/html/user/util.inc b/html/user/util.inc
index 90e1fea24e..2299ac8460 100644
--- a/html/user/util.inc
+++ b/html/user/util.inc
@@ -15,7 +15,7 @@ define("TD3", "");
define("TABLE", "");
define("VISTABLE", "");
-define("TABLE2", "");
+define("TABLE2", "");
define("BG_COLOR", " bgcolor=ffffff ");
define("TITLE_COLOR", " bgcolor=000000 ");
@@ -79,13 +79,18 @@ function show_login($user) {
}
}
-function page_head($title) {
+function page_head($title, $user=null) {
echo "$title\n";
// Put your project title and logo here
- echo "".PROJECT." \n";
- //echo "$title\n";
+ echo "".PROJECT." | \n";
+ if ($user) {
+ echo "Logged in as $user->name";
+ } else {
+ echo " ";
+ }
+ echo " |
\n";
}
function page_tail() {
|