2004-01-09 00:51:47 +00:00
|
|
|
<?php
|
2005-02-19 08:06:53 +00:00
|
|
|
|
2007-10-27 20:38:12 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2005-02-19 08:06:53 +00:00
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/host.inc");
|
2004-01-09 00:51:47 +00:00
|
|
|
|
2005-02-19 08:06:53 +00:00
|
|
|
$user = get_logged_in_user();
|
2004-01-09 00:51:47 +00:00
|
|
|
|
2005-02-19 08:06:53 +00:00
|
|
|
$hostid = get_int("hostid");
|
2007-10-27 20:38:12 +00:00
|
|
|
$host = BoincHost::lookup_id($hostid);
|
2007-01-29 18:15:16 +00:00
|
|
|
if (!$host || $host->userid != $user->id) {
|
|
|
|
error_page("We have no record of that computer.");
|
|
|
|
}
|
|
|
|
|
|
|
|
$nresults = host_nresults($host);
|
|
|
|
if ($nresults == 0) {
|
2007-10-27 20:38:12 +00:00
|
|
|
$host->delete();
|
2005-02-19 08:06:53 +00:00
|
|
|
} else {
|
2007-01-29 18:15:16 +00:00
|
|
|
error_page(
|
|
|
|
"You can not delete our record of this computer because our
|
|
|
|
database still contains work for it.
|
|
|
|
You must wait a few days until the work for this computer
|
2007-10-27 20:38:12 +00:00
|
|
|
has been deleted from the project database."
|
2007-01-29 18:15:16 +00:00
|
|
|
);
|
2005-02-19 08:06:53 +00:00
|
|
|
}
|
2007-01-29 18:15:16 +00:00
|
|
|
page_head("Delete record of computer");
|
2005-02-19 08:06:53 +00:00
|
|
|
echo "
|
2007-01-29 18:15:16 +00:00
|
|
|
Record deleted.
|
2005-02-19 08:06:53 +00:00
|
|
|
<p><a href=hosts_user.php>Return to list of your computers</a>
|
|
|
|
";
|
|
|
|
page_tail();
|
2004-01-09 00:51:47 +00:00
|
|
|
|
|
|
|
?>
|