2003-03-17 22:37:49 +00:00
|
|
|
<?php
|
2003-03-19 21:01:32 +00:00
|
|
|
// show all the hosts for a user.
|
|
|
|
// if $userid is absent, show hosts of logged-in user
|
|
|
|
|
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-17 22:37:49 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
$userid = $_GET["userid"];
|
2003-03-19 21:01:32 +00:00
|
|
|
if ($userid) {
|
|
|
|
$result = mysql_query("select * from user where id=$userid");
|
|
|
|
$user = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
2004-01-05 23:38:13 +00:00
|
|
|
if ($user->show_hosts) {
|
|
|
|
page_head("Computers belonging to $user->name");
|
2004-05-14 22:57:59 +00:00
|
|
|
host_table_start(false, false);
|
2004-01-05 23:38:13 +00:00
|
|
|
} else {
|
|
|
|
echo "Hidden\n";
|
|
|
|
exit();
|
|
|
|
}
|
2003-03-19 21:01:32 +00:00
|
|
|
$private = false;
|
|
|
|
} else {
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
$userid = $user->id;
|
|
|
|
page_head("Your computers");
|
2004-05-14 22:57:59 +00:00
|
|
|
host_table_start(true, false);
|
2003-03-19 21:01:32 +00:00
|
|
|
$private = true;
|
|
|
|
}
|
2003-03-17 22:37:49 +00:00
|
|
|
$i = 1;
|
2003-03-19 21:01:32 +00:00
|
|
|
$result = mysql_query("select * from host where userid=$userid order by expavg_credit desc");
|
|
|
|
while ($host = mysql_fetch_object($result)) {
|
2003-12-15 02:31:29 +00:00
|
|
|
show_host_row($host, $i, $private, false);
|
2003-03-17 22:37:49 +00:00
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
echo "</table>\n";
|
|
|
|
page_tail();
|
|
|
|
?>
|