From fa419731dd6af9ecbae09cdb42616a9385451ae4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 6 Sep 2011 04:34:29 +0000 Subject: [PATCH] - scheduler RPC: add element to the element in scheduler RPC request (tells the server that there's an override file). - account manager RPC: add element, including the override flag. - web: add "no time limit" option for forum search - web: increase show-user-post query limit to 10000 svn path=/trunk/boinc/; revision=24129 --- checkin_notes | 20 ++++++++++++++++++++ client/acct_mgr.cpp | 11 +++++++++-- client/cs_prefs.cpp | 2 ++ html/user/forum_search.php | 3 ++- html/user/forum_search_action.php | 7 ++++++- html/user/forum_user_posts.php | 2 +- lib/prefs.cpp | 9 +++++---- lib/prefs.h | 2 ++ 8 files changed, 47 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 32cc8b67ff..e835a06a6f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5608,3 +5608,23 @@ David 5 Sept submit_permissions.php inc/ forum.inc + +David 5 Sept + - scheduler RPC: add element to + the element in + scheduler RPC request + (tells the server that there's an override file). + - account manager RPC: add element, + including the override flag. + - web: add "no time limit" option for forum search + - web: increase show-user-post query limit to 10000 + + lib/ + prefs.cpp,h + client/ + cs_prefs.cpp + acct_mgr.cpp + html/user/ + forum_search.php + forum_search_action.php + forum_user_posts.php diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index 2e1fff5d24..4a685d1602 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -170,6 +170,15 @@ int ACCT_MGR_OP::do_rpc( p->ended?1:0 ); } + MIOFILE mf; + mf.init_file(f); + + // send working prefs + // + fprintf(f, "\n"); + gstate.global_prefs.write(mf); + fprintf(f, "\n"); + if (boinc_file_exists(GLOBAL_PREFS_FILE_NAME)) { FILE* fprefs = fopen(GLOBAL_PREFS_FILE_NAME, "r"); if (fprefs) { @@ -177,8 +186,6 @@ int ACCT_MGR_OP::do_rpc( fclose(fprefs); } } - MIOFILE mf; - mf.init_file(f); gstate.host_info.write(mf, !config.suppress_net_info, true); if (strlen(gstate.acct_mgr_info.opaque)) { fprintf(f, diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index f3f6857103..1e50021e74 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -431,6 +431,7 @@ void CLIENT_STATE::read_global_prefs( // read the override file // + global_prefs.override_file_present = false; if (override_fname) { f = fopen(override_fname, "r"); if (f) { @@ -441,6 +442,7 @@ void CLIENT_STATE::read_global_prefs( global_prefs.parse_override(xp, "", found_venue, mask); msg_printf(NULL, MSG_INFO, "Reading preferences override file"); fclose(f); + global_prefs.override_file_present = true; } } diff --git a/html/user/forum_search.php b/html/user/forum_search.php index 293e0a47ea..8d3405f711 100644 --- a/html/user/forum_search.php +++ b/html/user/forum_search.php @@ -49,7 +49,8 @@ row2(tra("Search limits")."
- + + "); $forumid = null; diff --git a/html/user/forum_search_action.php b/html/user/forum_search_action.php index aa541b9289..7e722acfde 100644 --- a/html/user/forum_search_action.php +++ b/html/user/forum_search_action.php @@ -146,7 +146,12 @@ $search_max_time = post_int("search_max_time"); $search_forum = post_int("search_forum"); $search_sort = post_int("search_sort"); $search_list = explode(" ",$search_keywords); -$min_timestamp = time() - ($search_max_time*3600*24); +if ($search_max_time) { + $min_timestamp = time() - ($search_max_time*3600*24); +} else { + $min_timestamp = 0; +} + $limit = 100; if ($search_forum==-1){ diff --git a/html/user/forum_user_posts.php b/html/user/forum_user_posts.php index 6012dba0a5..68ecadf9c9 100644 --- a/html/user/forum_user_posts.php +++ b/html/user/forum_user_posts.php @@ -72,7 +72,7 @@ if ($logged_in_user) { } page_head(tra("Posts by %1", $user->name)); -$posts = BoincPost::enum("user=$userid order by id desc limit 1000"); +$posts = BoincPost::enum("user=$userid order by id desc limit 10000"); $n = 0; start_table(); $options = get_output_options($logged_in_user); diff --git a/lib/prefs.cpp b/lib/prefs.cpp index b0291120a9..22c83b3f70 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -577,8 +577,7 @@ int GLOBAL_PREFS::parse_file( // This is used to write // 1) the app init data file // 2) GUI RPC get_state reply -// Not used for scheduler request; there, we just copy the -// global_prefs.xml file (which includes all venues). +// 3) scheduler request ( element) // int GLOBAL_PREFS::write(MIOFILE& f) { f.printf( @@ -614,7 +613,8 @@ int GLOBAL_PREFS::write(MIOFILE& f) { " %f\n" " %f\n" " %f\n" - " %d\n", + " %d\n" + " %d\n", source_project, mod_time, run_on_batteries?1:0, @@ -646,7 +646,8 @@ int GLOBAL_PREFS::write(MIOFILE& f) { max_bytes_sec_down, cpu_usage_limit, daily_xfer_limit_mb, - daily_xfer_period_days + daily_xfer_period_days, + override_file_present?1:0 ); if (max_ncpus) { f.printf(" %d\n", max_ncpus); diff --git a/lib/prefs.h b/lib/prefs.h index b8ae89acc7..82e34340de 100644 --- a/lib/prefs.h +++ b/lib/prefs.h @@ -169,6 +169,8 @@ struct GLOBAL_PREFS { char source_project[256]; char source_scheduler[256]; bool host_specific; + // an account manager can set this; if set, don't propagate + bool override_file_present; GLOBAL_PREFS(); void defaults();