2003-03-21 04:38:55 +00:00
|
|
|
<?php
|
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/host.inc");
|
2003-03-21 04:38:55 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
|
2005-02-15 22:29:32 +00:00
|
|
|
$hostid = get_int("hostid");
|
|
|
|
$host = lookup_host($hostid);
|
2003-03-21 04:38:55 +00:00
|
|
|
if (!$host || $host->userid != $user->id) {
|
2005-02-15 22:29:32 +00:00
|
|
|
error_page("We have no record of that computer");
|
2003-03-21 04:38:55 +00:00
|
|
|
}
|
|
|
|
|
2005-02-15 22:29:32 +00:00
|
|
|
page_head("Merge host");
|
|
|
|
|
2003-03-21 21:45:34 +00:00
|
|
|
$t = time_str($host->create_time);
|
2003-03-21 04:38:55 +00:00
|
|
|
echo "
|
2004-01-08 00:09:26 +00:00
|
|
|
Sometimes BOINC assigns separate identities to the same computer by mistake.
|
2003-03-21 21:45:34 +00:00
|
|
|
You can correct this by merging old identities with the newest one.
|
2004-01-08 00:09:26 +00:00
|
|
|
<form name=blah action=host_edit_action.php>
|
|
|
|
<input type=hidden name=id_0 value=$hostid>
|
|
|
|
<p>
|
|
|
|
Check the computers that are the same as $host->domain_name (created $t):
|
2003-03-21 04:38:55 +00:00
|
|
|
<p>
|
|
|
|
";
|
|
|
|
|
|
|
|
$result = mysql_query("select * from host where userid=$user->id");
|
2004-01-08 00:09:26 +00:00
|
|
|
$nhosts = 1;
|
2003-03-21 04:38:55 +00:00
|
|
|
while ($host2 = mysql_fetch_object($result)) {
|
2003-03-21 21:45:34 +00:00
|
|
|
if ($host->id == $host2->id) continue;
|
2004-01-08 00:09:26 +00:00
|
|
|
//if ($host2->create_time > $host->create_time) continue;
|
2003-03-21 04:38:55 +00:00
|
|
|
if (!hosts_compatible($host, $host2)) continue;
|
2003-03-21 21:45:34 +00:00
|
|
|
$t = time_str($host2->create_time);
|
2004-03-20 01:35:37 +00:00
|
|
|
$x = $host2->domain_name;
|
|
|
|
if ($x == "") {
|
|
|
|
$x = "[no hostname]";
|
|
|
|
}
|
|
|
|
echo "<br><input type=checkbox name=id_$nhosts value=$host2->id> $x (created $t)\n";
|
2004-01-08 00:09:26 +00:00
|
|
|
$nhosts++;
|
|
|
|
if ($nhosts==500) break;
|
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
echo "
|
|
|
|
<br>
|
|
|
|
<script>
|
|
|
|
function set_all() {
|
|
|
|
";
|
|
|
|
for ($i=1; $i<$nhosts; $i++) {
|
|
|
|
echo "document.blah.id_$i.checked=1;\n";
|
|
|
|
}
|
|
|
|
echo "
|
|
|
|
}
|
|
|
|
function clear_all() {
|
|
|
|
";
|
|
|
|
for ($i=1; $i<$nhosts; $i++) {
|
|
|
|
echo "document.blah.id_$i.checked=0;\n";
|
2003-03-21 04:38:55 +00:00
|
|
|
}
|
|
|
|
echo "
|
2004-01-08 00:09:26 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<p><a href=javascript:set_all()>Select all</a>
|
|
|
|
<p><a href=javascript:clear_all()>Unselect all</a>
|
|
|
|
<input type=hidden name=nhosts value=$nhosts>
|
|
|
|
<p><input type=submit value='Merge hosts'>
|
2003-03-21 04:38:55 +00:00
|
|
|
</form>
|
|
|
|
";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|