diff --git a/checkin_notes b/checkin_notes index 75d2711530..9531ee0a21 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3386,3 +3386,18 @@ Charlie 11 Apr 2007 lib/ browser.C,h mac_browser.mm (new, Mac only) + +David 11 Apr 2007 + - database: add sent_email table; keep track of emails sent to users + - boinc_cmd: add --read_cc_config command + + db/ + boinc_db.h + schema.sql + client/ + cs_cmdline.C + html/ops/ + db_update.php + remind.php + lib/ + boinc_cmd.C diff --git a/client/cs_cmdline.C b/client/cs_cmdline.C index 9319fe6e19..e3827ce33a 100644 --- a/client/cs_cmdline.C +++ b/client/cs_cmdline.C @@ -48,7 +48,7 @@ static void print_options(char* prog) { " --run_cpu_benchmarks run the CPU benchmarks\n" " --check_all_logins for idle detection, check remote logins\n too" " --allow_remote_gui_rpc allow remote GUI RPC connections\n" - " --gui_rpc_port port for GUI RPCs\n" + " --gui_rpc_port port for GUI RPCs\n" " --redirectio redirect stdout and stderr to log files\n" " --detach detach from console (Windows)\n" " --dir use given dir as BOINC home\n" diff --git a/db/boinc_db.h b/db/boinc_db.h index 7b9ce50dac..e898f949f0 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -144,7 +144,8 @@ struct USER { bool show_hosts; int posts; // number of messages posted (redundant) // deprecated as of 9/2004 - forum_preferences.posts is used instead - // may be used as a temp var (e.g. for mass email) + // may be used as a temp var + // WARNING: it's a shortint (16 bits) in the DB // The following are specific to SETI@home; // they record info about the user's involvement in a prior project diff --git a/db/schema.sql b/db/schema.sql index c375fb72a9..01675d1e16 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -437,3 +437,17 @@ create table post_ratings ( rating tinyint not null, primary key(post, user) ) TYPE=MyISAM; + +create table sent_email ( + userid integer not null, + time_sent integer not null, + email_type smallint not null, + -- 0 = other + -- 1 = newsletter + -- 2 = lapsed reminder + -- 3 = failed reminder + -- 4 = forum post hide + -- 5 = forum ban + -- 6 = fundraising appeal + primary key(userid) +) TYPE=MyISAM; diff --git a/doc/boinc_cmd.php b/doc/boinc_cmd.php index 8ee6c2d010..0ae67a0ec8 100644 --- a/doc/boinc_cmd.php +++ b/doc/boinc_cmd.php @@ -135,6 +135,7 @@ list_item("--read_global_prefs_override", " ); list_item("--quit", "Tell the core client to quit"); +list_item("--read_cc_config", "Reread the configuration file (cc_config.xml)"); list_bar("Miscellaneous"); list_item("--help, -h", "show options and commands"); list_end(); diff --git a/doc/project_options.php b/doc/project_options.php index 07f0e5ab74..5bd981ea56 100644 --- a/doc/project_options.php +++ b/doc/project_options.php @@ -34,7 +34,6 @@ echo html_text(" /path/to/directory http://A/URL - ../ bin cgi-bin [ path ] diff --git a/doc/rev_history.php b/doc/rev_history.php index c70276687d..4e93feaeec 100644 --- a/doc/rev_history.php +++ b/doc/rev_history.php @@ -3,6 +3,51 @@ require_once("docutil.php"); page_head("Version history"); echo" +

Version 5.9

+
    +
  • Manager +
      +
    • Project selection list in Attach Project wizard +
    • Advanced preferences dialog +
    • Grid-based views: column sorting, progress bars, line shading +
    • Ability to find browser cookies on some platforms; + enables web-only attach. +
    • Don't allow multiple connection-request dialogs +
    +
  • Core client +
      +
    • Improved slot directory logic makes it impossible + for two apps to run in same slot +
    • Reject directory-traversal and format conversion characters + in filenames from projects +
    • Add security-related configuration options: + suppress_net_info, disallow_attach, os_random_only. +
    • Support new work_buf_additional_days preference +
    • Various changes to prevent buffer overruns. +
    • Day-of-week preference enforcement +
    • Work correctly if core client starts up + before DNS system is working +
    • Export scheduling info in GUI RPCs +
    +
  • Windows +
      +
    • Work around Vista problems + by running all components with administrative rights +
    +
  • Windows +
      +
    • Correctly report RAM > 2 GB +
    • If screensaver launched BOINC, don't stop running when + energy saver puts display to sleep +
    • Improved user idle detection +
    • More robust installer +
    +
  • Library upgrades +
      +
    • OpenSSL 0.9.8e +
    • LibcURL 7.16.1 +
    +

Version 5.8

  • Snooze button. diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 5a1a70238c..5acb72b9db 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -350,7 +350,16 @@ function update_12_22_2007() { do_query("ALTER TABLE forum ADD is_dev_blog TINYINT NOT NULL DEFAULT 0"); } +function update_4_07_2007() { + do_query('create table sent_email + userid integer not null, + time_sent integer not null, + email_type smallint not null, + primary key(userid) + ) TYPE=MyISAM;' + ); +} -//update_12_22_2007(); +//update_4_07_2007(); ?> diff --git a/html/ops/remind.php b/html/ops/remind.php index 7afd5f5644..4a8c26b6a8 100644 --- a/html/ops/remind.php +++ b/html/ops/remind.php @@ -135,8 +135,9 @@ function replace($user, $template) { return preg_replace($pat, $rep, $template); } -function mail_type($user, $email_file) { +function mail_type($user, $email_files, $type) { global $testing; + $email_file = $email_files[$type]; if ($email_file['html']) { $html = replace($user, $email_file['html']); } else { @@ -160,14 +161,14 @@ function mail_type($user, $email_file) { $html ); $now = time(); - mysql_query("update user set posts=$now where id=$user->id"); + $ntype = 0; + if $type == 'lapsed') $ntype = 2; + if $type == 'failed') $ntype = 3; + $query = "insert into sent_email values($user->id, $now, $ntype)"; + mysql_query($query); } } -// NOTE: we're using user.posts (a deprecated field) -// to store the time the user was last sent an email. -// At some point maybe we'll rename this field. - function handle_user($user, $email_files) { global $lapsed_interval; global $testing; @@ -179,7 +180,7 @@ function handle_user($user, $email_files) { if ($testing) { echo "zero credit, sending failed email\n"; } - mail_type($user, $email_files['failed']); + mail_type($user, $email_files, 'failed'); } else { $t = last_rpc_time($user); if ($t < time() - $lapsed_interval) { @@ -187,11 +188,23 @@ function handle_user($user, $email_files) { if ($testing) { echo "nonzero credit, last RPC $user->lapsed_interval days ago, sending lapsed email\n"; } - mail_type($user, $email_files['lapsed']); + mail_type($user, $email_files, 'lapsed'); } } } +function last_reminder_time($user) { + $query = "select * from sent_email where $userid=$user->id"; + $result = mysql_query($query); + $t = 0; + while ($r = mysql_fetch_object($result)) { + if ($r->email_type !=2 && $r->email_type != 3) continue; + if ($r->time_sent > $t) $t = $time_sent; + } + mysql_free_result($result); + return $t; +} + function do_batch($email_files, $startid, $n) { global $email_interval; global $start_interval; @@ -199,9 +212,10 @@ function do_batch($email_files, $startid, $n) { $max_email_time = time() - $email_interval; $max_create_time = time() - $start_interval; $result = mysql_query( - "select * from user where id>$startid and send_email<>0 and posts<$max_email_time and create_time<$max_create_time and expavg_credit < 10 order by id limit $n" + "select * from user where id>$startid and send_email<>0 and create_time<$max_create_time and expavg_credit < 10 order by id limit $n" ); while ($user = mysql_fetch_object($result)) { + if (last_reminder_time($user) > $max_email_time) continue; handle_user($user, $email_files); $startid = $user->id; } @@ -233,8 +247,8 @@ if ($userid) { echo "No such user: $userid\n"; exit(); } - mail_type($user, $email_files['failed']); - mail_type($user, $email_files['lapsed']); + mail_type($user, $email_files, 'failed'); + mail_type($user, $email_files, 'lapsed'); } else { main($email_files); } diff --git a/lib/boinc_cmd.C b/lib/boinc_cmd.C index f0e8711039..e65bdcca93 100644 --- a/lib/boinc_cmd.C +++ b/lib/boinc_cmd.C @@ -88,6 +88,7 @@ Commands:\n\ --get_project_config_poll\n\ --lookup_account url email passwd\n\ --create_account url email passwd name\n\ + --read_cc_config\n\ --quit\n\ "); exit(1); @@ -512,6 +513,8 @@ int main(int argc, char** argv) { printf("retval %d\n", retval); } else if (!strcmp(cmd, "--quit")) { retval = rpc.quit(); + } else if (!strcmp(cmd, "read_cc_config")) { + retval = rpc.read_cc_config(); } else { fprintf(stderr, "unrecognized command %s\n", cmd); }