*** empty log message ***

svn path=/trunk/boinc/; revision=12346
This commit is contained in:
David Anderson 2007-04-11 18:05:26 +00:00
parent d715e3a9a8
commit 6b43ad0cbc
10 changed files with 116 additions and 15 deletions

View File

@ -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

View File

@ -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> port for GUI RPCs\n"
" --redirectio redirect stdout and stderr to log files\n"
" --detach detach from console (Windows)\n"
" --dir <path> use given dir as BOINC home\n"

View File

@ -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

View File

@ -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;

View File

@ -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();

View File

@ -34,7 +34,6 @@ echo html_text("
<upload_dir> /path/to/directory </upload_dir>
<cgi_url> http://A/URL </cgi_url>
<!-- optional; defaults as indicated: -->
<project_dir> ../ </project_dir> <!-- relative to location of 'start' -->
<bin_dir> bin </bin_dir> <!-- relative to project_dir -->
<cgi_bin_dir> cgi-bin </cgi_dir> <!-- relative to project_dir -->
[ <sched_lockfile_dir> path </sched_lockfile_dir> ]

View File

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

View File

@ -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();
?>

View File

@ -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);
}

View File

@ -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);
}