- user web: enable the "merge computers by name" feature.

I added this on 30 May 07 but accidentally left
    "if ($userid==0)" around it.

svn path=/trunk/boinc/; revision=13945
This commit is contained in:
David Anderson 2007-10-24 17:35:28 +00:00
parent a122425261
commit 05542a460f
3 changed files with 22 additions and 15 deletions

View File

@ -9829,3 +9829,12 @@ Frank Thomas 24 Oct 2007
clientgui/ clientgui/
ProjectProcessingPage.cpp ProjectProcessingPage.cpp
David 24 Oct 2007
- user web: enable the "merge computers by name" feature.
I added this on 30 May 07 but accidentally left
"if ($userid==0)" around it.
html/user/
merge_by_name.php
hosts_user.php

View File

@ -85,8 +85,9 @@ if ($userid) {
error_page("No such user"); error_page("No such user");
} }
$caching=true; $caching=true;
// At this point, we know that (1) $userid, $show_all and $sort all have // At this point, we know that $userid, $show_all and $sort all have
// valid values. // valid values.
//
$cache_args="userid=$userid&show_all=$show_all&sort=$sort"; $cache_args="userid=$userid&show_all=$show_all&sort=$sort";
start_cache(USER_PAGE_TTL, $cache_args); start_cache(USER_PAGE_TTL, $cache_args);
if ($user->show_hosts) { if ($user->show_hosts) {
@ -128,14 +129,14 @@ while ($host = mysql_fetch_object($result)) {
mysql_free_result($result); mysql_free_result($result);
echo "</table>\n"; echo "</table>\n";
if ($old_hosts>0) more_or_less($show_all); if ($old_hosts>0) {
more_or_less($show_all);
if ($userid == 0) {
echo "
<a href=merge_by_name.php>Merge hosts by name</a>
";
} }
echo "
<a href=merge_by_name.php>Merge hosts by name</a>
";
if ($caching) { if ($caching) {
page_tail(true); page_tail(true);
end_cache(USER_PAGE_TTL, $cache_args); end_cache(USER_PAGE_TTL, $cache_args);

View File

@ -22,7 +22,7 @@ function merge_name($list) {
} }
$error = merge_hosts($host, $newest_host); $error = merge_hosts($host, $newest_host);
if (!$error) { if (!$error) {
echo "<b>merged $host->id into $newest_host->id\n"; echo "<br>Merged $host->id into $newest_host->id\n";
} else { } else {
echo "<br>$error\n"; echo "<br>$error\n";
} }
@ -54,17 +54,14 @@ if ($_GET['confirmed']) {
} else { } else {
$tokens = url_tokens($user->authenticator); $tokens = url_tokens($user->authenticator);
echo " echo "
This operation will merge all of your computers This operation merges computers based on their domain name.
that have the same domain name.
<p> <p>
For each name, it will merge all older computers For each domain name, it will merge all older computers
having that name with the newest computer having that name. having that name with the newest computer having that name.
Incompatible computers will not be merged. Incompatible computers will not be merged.
<p> <p>
Click <a href=merge_by_name.php?confirmed=1&$tokens>here</a> <a href=merge_by_name.php?confirmed=1&$tokens>Go ahead and do this</a>.
if you're sure you want to do this. <p><a href=hosts_user.php>Return to the list of computers</a>.
<p>Click <a href=hosts_user.php>here</a>
to return to the list of your computers.
"; ";
} }
page_tail(); page_tail();