diff --git a/html/user/logout.php b/html/user/logout.php new file mode 100644 index 0000000000..6479c37451 --- /dev/null +++ b/html/user/logout.php @@ -0,0 +1,13 @@ + diff --git a/html/user/project_specific_prefs_ap.inc b/html/user/project_specific_prefs_ap.inc new file mode 100755 index 0000000000..b96151bdd3 --- /dev/null +++ b/html/user/project_specific_prefs_ap.inc @@ -0,0 +1,155 @@ + +// A few presets, plus "Custom" to control other parameters +// +// Starting hue (0..1) for graph +// +// Delta hue for graph (+ or -) +// +// Time to grow graph, back to front +// +// Time to hold completed graph +// +// If present, draw 2-D graph +// +// transparency of graph (0..1) + +function project_specific_prefs_default() { + return "Tahiti Sunset\n"; +} + +function option($name, $val) { + if ($name == $val) { + $x = "selected"; + } else { + $x = ""; + } + echo "$name\n"; +} + +// given struct, show form for editing +// +function project_specific_prefs_edit($prefs) { + $x = $prefs->color_scheme; + echo " + Color scheme: + + "; + option("Tahiti Sunset", $x); + option("Desert Sands", $x); + option("Underwater", $x); + option("Custom", $x); + echo "\n"; + if ($prefs->color_scheme == "Custom") { + $sel2 = ($prefs->two_dim?"checked":""); + $sel3 = ($prefs->two_dim?"":"checked"); + echo " + Start hue + + Hue change + + Grow time + + Hold time + + Graph dimension + 2-D + 3-D + Graph transparency + + "; + } +} + +// Return XML version of project-specific prefs from form vars +// +function project_specific_prefs_parse_form() { + parse_str(getenv("QUERY_STRING")); + switch( $color_scheme ) { + case "Tahiti Sunset": + $start_hue = 0.5; + $hue_change = 0.5; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Desert Sands": + $start_hue = 0.0; + $hue_change = 0.2; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Underwater": + $start_hue = 0.2; + $hue_change = 0.4; + $grow_time = 10; + $hold_time = 5; + $graph_alpha = 0.7; + $two_dim = "no"; + break; + case "Custom": + if (!isset($start_hue)) $start_hue = 0; + if (!isset($hue_change)) $hue_change = 1; + if (!isset($grow_time)) $grow_time = 10; + if (!isset($hold_time)) $hold_time = 5; + if (!isset($graph_alpha)) $graph_alpha = 0.7; + if (!isset($two_dim)) $two_dim = "no"; + break; + } + $x = "$color_scheme + $start_hue + $hue_change + $grow_time + $hold_time + $graph_alpha + "; + if ($two_dim == "yes") $x = $x."\n"; + return $x; +} + +// show non-editable version of prefs +// +function project_specific_prefs_show($prefs) { + echo " + Color scheme: + $prefs->color_scheme + + "; + if ($prefs->color_scheme == "Custom") { + $dim = $prefs->two_dim?"2":"3"; + echo " + Start hue + $prefs->start_hue + Hue change + $prefs->hue_change + Grow time + $prefs->grow_time + Hold time + $prefs->hold_time + Graph alpha + $prefs->graph_alpha + Graph dimension + $dim + "; + } +} + +// parse XML, fill in struct +// +function project_specific_prefs_parse($prefs_xml) { + $prefs->color_scheme = parse_element($prefs_xml, ""); + $prefs->start_hue = parse_element($prefs_xml, ""); + $prefs->hue_change = parse_element($prefs_xml, ""); + $prefs->grow_time = parse_element($prefs_xml, ""); + $prefs->hold_time = parse_element($prefs_xml, ""); + $prefs->graph_alpha = parse_element($prefs_xml, ""); + $prefs->two_dim = parse_element($prefs_xml, ""); + return $prefs; +} diff --git a/sched/handle_request.C b/sched/handle_request.C index d3f0836e44..cf25b16969 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -227,6 +227,11 @@ new_host: reply.hostid = reply.host.id; // this tells client to updates its host ID } + if (reply.user.teamid) { + TEAM team; + retval = db_team(reply.user.teamid, team); + if (!retval) reply.team = team; + } return 0; } diff --git a/sched/server_types.C b/sched/server_types.C index 6d5ecee10f..89af999530 100644 --- a/sched/server_types.C +++ b/sched/server_types.C @@ -106,6 +106,7 @@ SCHEDULER_REPLY::SCHEDULER_REPLY() { code_sign_key_signature = 0; memset(&user, 0, sizeof(user)); memset(&host, 0, sizeof(host)); + memset(&team, 0, sizeof(team)); nucleus_only = false; } @@ -153,6 +154,15 @@ int SCHEDULER_REPLY::write(FILE* fout) { host.expavg_credit ); + // might want to send team credit too. + // + if (team.id) { + fprintf(fout, + "%s\n", + team.name + ); + } + if (hostid) { fprintf(fout, "%d\n" diff --git a/sched/server_types.h b/sched/server_types.h index 6d10e26f82..f43a042237 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -67,6 +67,7 @@ struct SCHEDULER_REPLY { bool nucleus_only; // send only message USER user; HOST host; + TEAM team; vector apps; vector app_versions; vectorwus; diff --git a/test/make_project_ap.php b/test/make_project_ap.php index e0938fd912..2e101e93c4 100644 --- a/test/make_project_ap.php +++ b/test/make_project_ap.php @@ -16,7 +16,7 @@ $app_version = new App_Version($app); $app_version->platform = $platform; $app_version->exec_dir = "../apps"; - $app_version->exec_name = "ap_win_0.02.exe"; + $app_version->exec_name = "ap_win_0.05.exe"; $core_app = new App("core client"); $core_app_version = new App_Version($core_app); @@ -38,6 +38,7 @@ $project->start_validate = false; $project->shmem_key = 0x31415927; $project->project_php_file = "project_ap.inc"; + $project->project_prefs_php_file = "project_specific_prefs_ap.inc"; $project->install(); diff --git a/test/make_project_sah.php b/test/make_project_sah.php index c2c4916a30..f73ff2e04d 100644 --- a/test/make_project_sah.php +++ b/test/make_project_sah.php @@ -16,7 +16,7 @@ $app_version = new App_Version($app); $app_version->platform = $platform; $app_version->exec_dir = "../apps"; - $app_version->exec_name = "ap_win_0.02.exe"; + $app_version->exec_name = "ap_win_0.05.exe"; $core_app = new App("core client"); $core_app_version = new App_Version($core_app); diff --git a/test/test.inc b/test/test.inc index 58bae477c2..c14eedc15d 100644 --- a/test/test.inc +++ b/test/test.inc @@ -155,6 +155,7 @@ class Project { var $start_result_retry; var $start_validate; var $project_php_file; + var $project_prefs_php_file; var $make_work_wu_template; var $make_work_result_template; @@ -297,12 +298,15 @@ class Project { // copy the user and administrative PHP files to the project dir, // - PassThru("cp -f $source_dir/html_user/* $this->project_dir/html_user"); - PassThru("cp -f $source_dir/tools/country_select $this->project_dir/html_user"); - PassThru("cp -f $source_dir/html_ops/* $this->project_dir/html_ops"); + PassThru("cp -f $source_dir/html_user/* $this->project_dir/html_user >> /dev/null 2>&1"); + PassThru("cp -f $source_dir/tools/country_select $this->project_dir/html_user >> /dev/null 2>&1"); + PassThru("cp -f $source_dir/html_ops/* $this->project_dir/html_ops >> /dev/null 2>&1"); if ($this->project_php_file) { PassThru("cp -f $source_dir/html_user/$this->project_php_file $this->project_dir/html_user/project.inc"); } + if ($this->project_prefs_php_file) { + PassThru("cp -f $source_dir/html_user/$this->project_prefs_php_file $this->project_dir/html_user/project_specific_prefs.inc"); + } // Copy the sched server in the cgi directory with the // cgi names given $source_dir/html_usr/schedulers.txt @@ -633,7 +637,6 @@ class Host { function install() { $base_dir = get_env_var("BOINC_HOSTS_DIR"); $this->host_dir = $base_dir."/".$this->name; - $user = $this->user; PassThru("rm -rf $this->host_dir"); PassThru("mkdir $this->host_dir");