From 020a4d4ed1c0c30919fdaf9e33778fbf618358bc Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 17 Oct 2010 20:12:14 +0000 Subject: [PATCH] - user web: in RSS item for private message, don't say anything about the message (sender, title, or content) - user web: don't send an RSS item for a thread with no posts (i.e., hidden) - client simulator: support global_prefs_override.xml svn path=/trunk/boinc/; revision=22545 --- checkin_notes | 12 ++++++++++++ client/sim.cpp | 10 ++++++---- doc/sim_form.php | 15 ++++++++++++--- html/inc/forum_rss.inc | 1 + html/inc/pm.inc | 4 ++-- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 99abe54a18..85a1de524b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7421,3 +7421,15 @@ David 16 Oct 2010 client/ cs_notice.cpp + +David 16 Oct 2010 + - user web: in RSS item for private message, don't say anything + about the message (sender, title, or content) + - user web: don't send an RSS item for a thread with no posts (i.e., hidden) + - client simulator: support global_prefs_override.xml + + html/inc/ + pm.inc + forum_rss.inc + client/ + sim.cpp diff --git a/client/sim.cpp b/client/sim.cpp index b2a7a5e534..09a4a631d1 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -956,7 +956,7 @@ void cull_projects() { } void do_client_simulation() { - char buf[256]; + char buf[256], buf2[256]; msg_printf(0, MSG_INFO, "SIMULATION START"); sprintf(buf, "%s%s", file_prefix, CONFIG_FILE); @@ -975,10 +975,12 @@ void do_client_simulation() { buf ); sprintf(buf, "%s%s", file_prefix, GLOBAL_PREFS_FILE_NAME); - gstate.read_global_prefs(buf); + sprintf(buf2, "%s%s", file_prefix, GLOBAL_PREFS_OVERRIDE_FILE); + gstate.read_global_prefs(buf, buf2); fprintf(index_file, - "
Preferences file (global_prefs.xml)\n", - buf + "
Preferences file (global_prefs.xml)\n" + "
Preferences override file (global_prefs_override.xml)\n", + buf, buf2 ); cull_projects(); int j=0; diff --git a/doc/sim_form.php b/doc/sim_form.php index f3bd0ebefd..f11bbb3fd7 100644 --- a/doc/sim_form.php +++ b/doc/sim_form.php @@ -17,6 +17,12 @@ function show_form() { +

+ global_prefs_override.xml: (the host's preferences override file) +
+ +

cc_config.xml: (the client configuration options)
@@ -68,15 +74,18 @@ if ($_POST['submit']) { $state_fname = $prefix."client_state.xml"; file_put_contents_aux($state_fname, $x); - $prefs_name = null; - $config_name = null; - $x = $_POST['global_prefs']; if (strlen($x)) { $prefs_fname = $prefix."global_prefs.xml"; file_put_contents_aux($prefs_fname, $x); } + $x = $_POST['global_prefs_override']; + if (strlen($x)) { + $prefs_override_fname = $prefix."global_prefs_override.xml"; + file_put_contents_aux($prefs_override_fname, $x); + } + $x = $_POST['cc_config']; if (strlen($x)) { $config_fname = $prefix."cc_config.xml"; diff --git a/html/inc/forum_rss.inc b/html/inc/forum_rss.inc index 5e633cf1a6..4909bc5341 100644 --- a/html/inc/forum_rss.inc +++ b/html/inc/forum_rss.inc @@ -32,6 +32,7 @@ function show_forum_rss_item($thread, $userid, $threads_only, $truncate) { } else { $posts = BoincPost::enum("thread=$thread->id $clause2 order by timestamp desc limit 1"); } + if (!count($posts)) return; $post = $posts[0]; $post_date = gmdate('D, d M Y H:i:s',$post->timestamp).' GMT'; $t = bb2html($post->content, true); diff --git a/html/inc/pm.inc b/html/inc/pm.inc index 39dcf4ce4b..f961b93bc9 100644 --- a/html/inc/pm.inc +++ b/html/inc/pm.inc @@ -199,8 +199,8 @@ function pm_email_remind($user) { function pm_rss($notify, &$title, &$msg, &$url) { $pm = BoincPrivateMessage::lookup_id($notify->opaque); $from_user = BoincUser::lookup_id($pm->senderid); - $title = tra("Private message from")." $from_user->name: $pm->subject"; - $msg = "$pm->content"; + $title = tra("Private message"); + $msg = "You have received a private message."; $url = URL_BASE."pm.php"; }