- web: don't select orphaned profile as UOTD;

delete profile when delete user.  Fixes #761

svn path=/trunk/boinc/; revision=16255
This commit is contained in:
David Anderson 2008-10-22 15:49:01 +00:00
parent d6eea6d46e
commit 1f6df503f5
6 changed files with 31 additions and 19 deletions

View File

@ -8555,3 +8555,11 @@ Charlie 22 Oct 2008
clientscr/
mac_saver_module.cpp
Mac_Saver_ModuleView.m
David 22 Oct 2008
- web: don't select orphaned profile as UOTD;
delete profile when delete user. Fixes #761
html/inc/
uotd.inc
boinc_db.inc

View File

@ -2,27 +2,27 @@
$project_news = array(
array("October 17, 2008",
"Read <a href=http://www.isgtw.org/?pid=1001391>Reaching for the Exa-scale with volunteer computing</a> in International Science Grid This Week."
"Read <a href=\"http://www.isgtw.org/?pid=1001391\">Reaching for the Exa-scale with volunteer computing</a> in International Science Grid This Week."
),
array("September 30, 2008",
"An <a href=http://www.isgtw.org/?pid=1001381>article on
"An <a href=\"http://www.isgtw.org/?pid=1001381\">article on
the recent BOINC workshop in Grenoble</a>
appeared in International Science Grid This Week."
),
array("September 29, 2008",
"An article on <a href=http://ps3grid.net>PS3grid.net</a> project,
"An article on <a href=\"http://ps3grid.net\">PS3grid.net</a> project,
which does scientific computing on Sony Playstations, appeared recently in
<a href=http://www.sciencemag.org/cgi/content/long/321/5895/1425b>Science</a>."
<a href=\"http://www.sciencemag.org/cgi/content/long/321/5895/1425b\">Science</a>."
),
array("September 27, 2008",
"See an <a href=http://boinc.berkeley.edu/eff.php>open letter
"See an <a href=\"http://boinc.berkeley.edu/eff.php\">open letter
to the Electronic Frontier Foundation</a>."
),
array("September 25, 2008",
"Read <a href=http://www.economist.com/science/displaystory.cfm?story_id=12295198>an article about Quake Catcher Network</a> in Economist.com."
"Read <a href=\"http://www.economist.com/science/displaystory.cfm?story_id=12295198\">an article about Quake Catcher Network</a> in Economist.com."
),
array("September 25, 2008",
"<a href=http://registro.ibercivis.es/>Ibercivis</a>,
"<a href=\"http://registro.ibercivis.es/\">Ibercivis</a>,
a joint project of several Spanish universities and research institutes,
is now open to the public.
Sign up and support Spanish research."

View File

@ -24,7 +24,7 @@ $type_name = $_GET["type"];
require_once("versions.inc");
function dl_item($x, $y) {
echo "<tr><td valign=top align=right width=30%>$x</td>
echo "<tr><td valign=top align=right width=\"30%\">$x</td>
<td>$y</td></tr>
";
}
@ -91,9 +91,9 @@ function show_version($pname, $i, $v) {
$status = $v["status"];
if (is_dev($v)) {
$status = $status."
<br><span class=dev><b>
<br><span class=dev>
(MAY BE UNSTABLE - USE ONLY FOR TESTING)
</b></font>
</span>
";
}
$path = "dl/$file";
@ -176,13 +176,13 @@ if ($xml) {
$p = $platforms[$pname];
$name = $p['name'];
page_head("Download BOINC client software for $name");
echo "<table width=100% cellpadding=4 >";
echo "<table width=\"100%\" cellpadding=4 >";
show_platform($pname, $p, $dev);
list_end();
} else {
page_head("Download BOINC client software");
echo "
<table width=100% cellpadding=4 >
<table width=\"100%\" cellpadding=4 >
";
foreach($platforms as $short_name=>$p) {
show_platform($short_name, $p, $dev);
@ -192,8 +192,8 @@ if ($xml) {
<h3>Other platforms</h3>
If your computer is not of one of these types, you can
<ul>
<li> <a href=trac/wiki/AnonymousPlatform>make your own client software</a> or
<li> <a href=trac/wiki/DownloadOther>download executables from a third-party site</a>
<li> <a href=\"trac/wiki/AnonymousPlatform\">make your own client software</a> or
<li> <a href=\"trac/wiki/DownloadOther\">download executables from a third-party site</a>
(available for Solaris/Opteron, Linux/Opteron, Linux/PPC, HP-UX, and FreeBSD, and others).
</ul>
@ -204,7 +204,7 @@ if ($xml) {
echo "
<h3>Customizing this page</h3>
The information on this page can be
<a href=trac/wiki/DownloadInfo>
<a href=\"trac/wiki/DownloadInfo\">
restricted by platform and/or version number,
or presented in XML format</a>.
";

View File

@ -219,10 +219,6 @@ if (defined("CHARSET")) {
header("Content-type: text/html; charset=".tr(CHARSET));
}
echo "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
";
html_tag();
echo "
<head>

View File

@ -102,6 +102,7 @@ class BoincUser {
}
function delete() {
$db = BoincDb::get();
$db->delete_aux('profile', "userid=$this->id");
return $db->delete($this, 'user');
}
}

View File

@ -106,6 +106,13 @@ function select_uotd() {
$profile = mysql_fetch_object($result);
$user = lookup_user_id($profile->userid);
// if profile is "orphaned", delete it and try again
//
if (!$user) {
$profile->delete_aux("userid=$profile->userid");
select_uotd();
}
$sql = "UPDATE profile SET uotd_time = ".time()." WHERE userid=$user->id";
mysql_query($sql);