diff --git a/checkin_notes b/checkin_notes
index f017117d88..f37f002e36 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -497,9 +497,13 @@ Bruce 16 Jan 2006
- ops page: add external IP to data shown for host
- user host info page: when giving IP data, show both private
AND external IP (only for owner of host machine).
-
+ - user web pages: if can't delete host because there are still
+ results, give clearer error message and link to list of results.
html/
inc/
db_ops.inc
host.inc
+ user/
+ host_delete.php
+
diff --git a/html/user/host_delete.php b/html/user/host_delete.php
index 9bb4c0e78b..adb6ce66a3 100644
--- a/html/user/host_delete.php
+++ b/html/user/host_delete.php
@@ -5,7 +5,7 @@ require_once("../inc/util.inc");
require_once("../inc/host.inc");
function fail($msg) {
- echo "Error: $msg";
+ echo "
Error: $msg
";
page_tail();
exit();
}
@@ -13,7 +13,7 @@ function fail($msg) {
function get_host($hostid, $user) {
$host = lookup_host($hostid);
if (!$host || $host->userid != $user->id) {
- fail("We have no record of that computer");
+ fail("We have no record of that computer.");
}
return $host;
}
@@ -28,7 +28,17 @@ $host = get_host($hostid, $user);
if (host_nresults($host)==0) {
mysql_query("delete from host where id=$hostid");
} else {
- fail("existing results");
+ $config = get_config();
+ $results = "existing results";
+ if (parse_bool($config, "show_results")) {
+ $nresults = host_nresults($host);
+ if ($nresults) {
+ $results = "id>existing $nresults results";
+ }
+ }
+ fail("You can not delete this computer because the project database still contains work for it. ".
+ "You must wait a few days until all the $results for this computer ".
+ "have been deleted from the project database.");
}
echo "
Host deleted.