mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2735
This commit is contained in:
parent
c834528097
commit
e6f9710032
|
@ -8004,3 +8004,24 @@ Karl 2003-12-02
|
|||
- created export-tarball program for nightly-tarball
|
||||
|
||||
nightly-tarball
|
||||
|
||||
David 28 Nov 2003
|
||||
- changed indices on result table
|
||||
changed res_hostid to include id desc
|
||||
removed res_wuid
|
||||
added app_received_time
|
||||
- removed "last result for host" info from web pages;
|
||||
this required an index with no other function
|
||||
- added comments to constraints.sql explaining why each index is needed
|
||||
- add "subscriptions" table to schema.sql
|
||||
|
||||
db/
|
||||
constraints.sql
|
||||
schema.sql
|
||||
html_user/
|
||||
host.inc
|
||||
totals.php
|
||||
util.inc
|
||||
forum/
|
||||
post.php
|
||||
subscribe.inc
|
||||
|
|
|
@ -22,33 +22,71 @@ alter table user
|
|||
add unique(authenticator),
|
||||
add index ind_tid (teamid),
|
||||
add index user_tot (total_credit desc),
|
||||
-- db_dump.C
|
||||
add index user_avg (expavg_credit desc);
|
||||
-- db_dump.C
|
||||
|
||||
alter table team
|
||||
add unique(name),
|
||||
add index team_avg (expavg_credit desc),
|
||||
-- db_dump.C
|
||||
add index team_tot (total_credit desc);
|
||||
-- db_dump.C
|
||||
|
||||
alter table workunit
|
||||
add unique(name),
|
||||
-- not currently used but good invariant
|
||||
add index wu_val (appid, need_validate),
|
||||
-- validator
|
||||
add index wu_timeout (transition_time),
|
||||
-- transitioner
|
||||
add index wu_filedel (file_delete_state),
|
||||
-- file_deleter
|
||||
add index wu_assim (appid, assimilate_state);
|
||||
-- assimilator
|
||||
|
||||
alter table result
|
||||
add unique(name),
|
||||
add index res_wuid (workunitid),
|
||||
-- the scheduler looks up results by name
|
||||
|
||||
//add index res_wuid (workunitid),
|
||||
// -- transitioner
|
||||
// -- NOTE: res_wu_user may suffice; could try dropping this one
|
||||
|
||||
add index ind_res_st (server_state, random),
|
||||
-- feeder (random is to avoid sending WU result close together)
|
||||
|
||||
add index res_app_state(appid, server_state),
|
||||
-- splitter, e.g.
|
||||
|
||||
add index res_filedel (file_delete_state),
|
||||
add index res_hostid (hostid),
|
||||
-- file_deleter
|
||||
|
||||
add index res_userid_id(userid, id desc),
|
||||
-- html_user/results.php
|
||||
|
||||
add index res_userid_val(userid, validate_state),
|
||||
-- to show pending credit
|
||||
|
||||
add index res_hostid (hostid, id desc),
|
||||
-- html_user/results.php
|
||||
|
||||
add index res_wu_user (workunitid, userid),
|
||||
-- scheduler (avoid sending mult results of same WU to one user)
|
||||
|
||||
add index app_received_time (appid, received_time desc);
|
||||
-- html_ops/result_summary.php
|
||||
|
||||
alter table host
|
||||
add index host_user (userid),
|
||||
-- html_user/host_user.php
|
||||
add index host_avg (expavg_credit desc),
|
||||
-- db_dump.C
|
||||
add index host_tot (total_credit desc);
|
||||
-- db_dump.C
|
||||
|
||||
alter table profile
|
||||
add unique profile_userid(userid);
|
||||
|
||||
alter table subscriptions
|
||||
add unique sub_unique(userid, threadid);
|
||||
|
|
|
@ -317,3 +317,9 @@ create table post (
|
|||
primary key (id)
|
||||
);
|
||||
|
||||
-- subscription to a thread
|
||||
--
|
||||
create table subscriptions (
|
||||
userid integer not null,
|
||||
threadid integer not null
|
||||
);
|
||||
|
|
|
@ -91,10 +91,10 @@ if ($category->is_helpdesk) {
|
|||
echo "<p>
|
||||
If you are having software problems,
|
||||
mention the version number of the software,
|
||||
your computer type, operating system, etc.
|
||||
your computer type and operating system.
|
||||
</td>
|
||||
";
|
||||
} else {
|
||||
}
|
||||
|
||||
|
||||
echo "
|
||||
|
|
|
@ -13,16 +13,6 @@ function subscribe($thread, $user=null) {
|
|||
$user = get_logged_in_user(true, '../');
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM subscriptions WHERE (userid = " . $user->id . ") AND (threadid = " . $thread->id . ")";
|
||||
$result = mysql_query($sql);
|
||||
|
||||
// If they're already subscribed, don't add them again;
|
||||
if (mysql_num_rows($result) > 0) {
|
||||
// TODO: Specific "error" page for this case.
|
||||
show_result_page("subscribe", true, $thread);
|
||||
exit();
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO subscriptions SET userid = " . $user->id . ", threadid = " . $thread->id;
|
||||
show_result_page("subscribe", (mysql_query($sql) != null), $thread);
|
||||
}
|
||||
|
@ -47,11 +37,11 @@ function show_result_page($action, $success, $thread) {
|
|||
echo "<p>You are now subscribed to <b>", stripslashes($thread->title), "</b>. You will receive an email whenever another user posts to this thread.</p>";
|
||||
} else if ($action == "unsubscribe" && $success) {
|
||||
page_head("Unsubscription Successful");
|
||||
echo "<span class=\"title\">Unsubscription successful</span>";
|
||||
echo "<span class=title>Unsubscription successful</span>";
|
||||
echo "<p>You have successfully unsubscribed from <b>", stripslashes($thread->title), "</b>. You will no longer receive emails for posts to this thread.</p>";
|
||||
} else if ($action == "subscribe" && !$success) {
|
||||
page_head("Subscription Failed");
|
||||
echo "<span class=\"title\">Subscription failed</span>";
|
||||
echo "<span class=title>Subscription failed</span>";
|
||||
if ($thread) {
|
||||
echo "<p>There was a problem subscribing you to ", stripslashes($thread->title), ". Please try again later.</p>";
|
||||
} else {
|
||||
|
@ -88,7 +78,7 @@ function notify_subscribers($threadID) {
|
|||
}
|
||||
|
||||
function send_notice_email($userId, $threadID) {
|
||||
$thread = getThread($threadID);
|
||||
$thread = getThread($threadID);
|
||||
|
||||
$result = mysql_query("SELECT * FROM user WHERE id = $userId");
|
||||
$row = mysql_fetch_assoc($result);
|
||||
|
@ -96,9 +86,9 @@ function send_notice_email($userId, $threadID) {
|
|||
$title = PROJECT . ": A user has posted to your subscribed thread.";
|
||||
$link = URL_BASE . "forum/thread.php?id=" . $threadID;
|
||||
$body = "Another " . PROJECT . " user has posted to the thread \"" . stripslashes($thread->title) . "\".\n"
|
||||
."To view the updated thread, direct your web browser to the following URL:\n\n$link";
|
||||
."To view the updated thread, visit the following URL:\n\n$link";
|
||||
|
||||
mail($row['email_addr'], $title, $body);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -76,15 +76,10 @@ function show_host($host, $private) {
|
|||
} else {
|
||||
row2("Average download rate", "Unknown");
|
||||
}
|
||||
$last_result = host_last_result($host);
|
||||
$nresults = host_nresults($host);
|
||||
$nresults_success = host_nresults_success($host);
|
||||
$nresults_valid = host_nresults_valid($host);
|
||||
$results = "$nresults_valid valid / $nresults_success successful / <a href=results.php?hostid=$host->id>$nresults</a> total";
|
||||
if ($last_result) {
|
||||
$time_last_result = time_str($last_result->received_time);
|
||||
$results .= "<br>Last received: $time_last_result";
|
||||
}
|
||||
row2("Results", $results);
|
||||
|
||||
if ($private) {
|
||||
|
@ -126,13 +121,6 @@ function host_table_start($title, $private) {
|
|||
";
|
||||
}
|
||||
|
||||
function host_last_result($host) {
|
||||
$result = mysql_query("select * from result where hostid = $host->id order by received_time desc limit 1");
|
||||
$last_result = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
return $last_result;
|
||||
}
|
||||
|
||||
function host_nresults($host) {
|
||||
$result = mysql_query("select count(*) as nresults from result where hostid=$host->id");
|
||||
$foobar = mysql_fetch_object($result);
|
||||
|
@ -184,15 +172,10 @@ function show_host_row($host, $i, $private) {
|
|||
$host->os_name, $host->os_version
|
||||
);
|
||||
|
||||
$last_result = host_last_result($host);
|
||||
$nresults = host_nresults($host);
|
||||
$nresults_success = host_nresults_success($host);
|
||||
$nresults_valid = host_nresults_valid($host);
|
||||
echo "<td>$nresults_valid / $nresults_success / <a href=results.php?hostid=$host->id>$nresults</a>";
|
||||
if ($last_result) {
|
||||
$date_last_result = date_str($last_result->received_time);
|
||||
echo " [$date_last_result]";
|
||||
}
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -9,20 +9,24 @@
|
|||
start_table();
|
||||
row1("Project totals");
|
||||
|
||||
$result = mysql_query("select count(*) as total from result where server_state=5");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results completed", $comp->total);
|
||||
// need to break out the following by app
|
||||
|
||||
$result = mysql_query("select count(*) as total from result where server_state=4");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results in progress", $comp->total);
|
||||
if (0) {
|
||||
$result = mysql_query("select count(*) as total from result where server_state=5");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results completed", $comp->total);
|
||||
|
||||
$result = mysql_query("select count(*) as total from result where server_state=2");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results waiting to send", $comp->total);
|
||||
$result = mysql_query("select count(*) as total from result where server_state=4");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results in progress", $comp->total);
|
||||
|
||||
$result = mysql_query("select count(*) as total from result where server_state=2");
|
||||
$comp = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
row2("Results waiting to send", $comp->total);
|
||||
}
|
||||
|
||||
$result = mysql_query("select count(*) as total from user");
|
||||
$comp = mysql_fetch_object($result);
|
||||
|
|
|
@ -60,8 +60,8 @@ function get_profile_from_userid($userid) {
|
|||
return null;
|
||||
}
|
||||
|
||||
// $pathMod is a prefix for the path of the login processing form. This
|
||||
// allows scripts in other directories (i.e. forum/) to call this function.
|
||||
// $pathMod is a prefix for the path of the login processing form.
|
||||
// This allows scripts in other directories (i.e. forum/) to call this function.
|
||||
|
||||
function get_logged_in_user($must_be_logged_in=true, $pathMod="") {
|
||||
$authenticator = init_session();
|
||||
|
|
Loading…
Reference in New Issue