diff --git a/checkin_notes b/checkin_notes index c65d29c77c..1ccf74110a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5391,3 +5391,15 @@ David 28 May 2007 client/ Makefile.am + +David 28 May 2007 + - user web: host-merging logic was wrong for Intel CPUs + with MHz instead of GHz in their names. + - user web: it no hosts eligible for merging, say so + instead of showing blank table + + html/ + inc/ + host.inc + user/ + host_edit_form.php diff --git a/html/inc/host.inc b/html/inc/host.inc index ae0908d44f..d1739022a5 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -253,6 +253,7 @@ function ghz($x) { $y = explode(" ", $x); foreach ($y as $z) { if (strstr($z, "GHz")) return $z; + if (strstr($z, "MHz")) return $z; } } diff --git a/html/user/host_edit_form.php b/html/user/host_edit_form.php index 6989447b69..1998666e21 100644 --- a/html/user/host_edit_form.php +++ b/html/user/host_edit_form.php @@ -22,18 +22,34 @@ echo "

+"; + +$result = mysql_query("select * from host where userid=$user->id"); + +$nhosts = 1; +$hosts = array(); +while ($host2 = mysql_fetch_object($result)) { + if ($host->id == $host2->id) continue; + if (!hosts_compatible($host, $host2)) continue; + $hosts[] = $host2; + $nhosts++; + if ($nhosts==500) break; +} +mysql_free_result($result); +if ($nhosts == 1) { + echo "No hosts are eligible for merging with this one."; + page_tail(); + exit(); +} +echo " +

Check the computers that are the same as $host->domain_name (created $t, computer ID $host->id):

"; - -$result = mysql_query("select * from host where userid=$user->id"); -$nhosts = 1; start_table(); row_heading_array(array("", "name", "created", "computer ID")); -while ($host2 = mysql_fetch_object($result)) { - if ($host->id == $host2->id) continue; - if (!hosts_compatible($host, $host2)) continue; +foreach ($hosts as $host2) { $t = time_str($host2->create_time); $x = $host2->domain_name; if ($x == "") { @@ -45,11 +61,8 @@ while ($host2 = mysql_fetch_object($result)) { "$t", "$host2->id" )); - $nhosts++; - if ($nhosts==500) break; } end_table(); -mysql_free_result($result); echo "