From e88e698106533a9db772439c4ca787d1f947126e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 22 Jun 2008 19:14:53 +0000 Subject: [PATCH] - scheduler: change message if bad auth (fixes #685) svn path=/trunk/boinc/; revision=15445 --- checkin_notes | 8 +++ client/hostinfo_unix.C | 7 +-- html/inc/bolt_util.inc | 10 +-- html/user/bolt_compare.php | 123 ++++++++++++++++++++++++++++++++----- sched/handle_request.C | 4 +- 5 files changed, 125 insertions(+), 27 deletions(-) diff --git a/checkin_notes b/checkin_notes index 0452f204f8..b390514035 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5036,3 +5036,11 @@ David 20 June 2008 lib/ proc_control.C shmem.C,h + +David 22 June 2008 + - scheduler: change message if bad auth (fixes #685) + + client/ + hostinfo_unix.C + sched/ + handle_request.C diff --git a/client/hostinfo_unix.C b/client/hostinfo_unix.C index 8807492248..74b58e9a15 100644 --- a/client/hostinfo_unix.C +++ b/client/hostinfo_unix.C @@ -216,8 +216,8 @@ bool HOST_INFO::host_is_running_on_batteries() { bool retval = false; FILE* fapm = fopen("/proc/apm", "r"); - if (fapm) { // Then we're using APM! Yay. - + if (fapm) { + // we're using APM char apm_driver_version[11]; int apm_major_version; int apm_minor_version; @@ -235,8 +235,7 @@ bool HOST_INFO::host_is_running_on_batteries() { retval = (apm_ac_line_status == 0); fclose(fapm); } else { - - // we try ACPI + // try ACPI char buf[128]; char ac_state[64]; std::string ac_name; diff --git a/html/inc/bolt_util.inc b/html/inc/bolt_util.inc index 36e4f2d24f..3a19e3be6f 100644 --- a/html/inc/bolt_util.inc +++ b/html/inc/bolt_util.inc @@ -62,7 +62,7 @@ function request_info($user, $course) { // xset_result: the user's first completion of the xset // select_finished: the user's last completion of the select before this -function write_snapshot($course_id, $select_name, $xset_name, $start) { +function write_compare_snapshot($course_id, $select_name, $xset_name, $start) { $xrs = BoltXsetResult::enum( "course_id=$course_id and name='$xset_name' and create_time >= $start" ); @@ -100,11 +100,13 @@ function write_snapshot($course_id, $select_name, $xset_name, $start) { $f = fopen($filename, "w"); fwrite($f, json_encode($a)); fclose($f); + return $a; } -function read_snapshot($course_id, $select_name, $xset_name) { - $filename = "compare_snapshot_$course_id_$select_name_$xset_name.json"; - $f = fopen($filename, "r"); +function read_compare_snapshot($course_id, $select_name, $xset_name) { + $filename = "compare_snapshot_".$course_id."_".$select_name."_".$xset_name.".json"; + $f = @fopen($filename, "r"); + if (!$f) return null; $x = fread($f, filesize($filename)); fclose($f); return json_decode($x); diff --git a/html/user/bolt_compare.php b/html/user/bolt_compare.php index fbb15d6745..dc63067d5c 100644 --- a/html/user/bolt_compare.php +++ b/html/user/bolt_compare.php @@ -1,7 +1,7 @@ name; } if (is_subclass_of($unit, "BoltSet")) { foreach ($unit->units as $u) { - $n = units_of_type($u); + $n = units_of_type($u, $type); $names = array_merge($names, $n); } } @@ -43,8 +43,10 @@ function units_of_type($unit, $type) { // show a menu of select units // -function select_menu($top_unit) { - echo " +