2002-12-06 21:37:30 +00:00
|
|
|
<?php
|
|
|
|
require_once("db.inc");
|
2003-08-22 05:36:25 +00:00
|
|
|
require_once("util.inc");
|
2002-12-06 21:37:30 +00:00
|
|
|
require_once("user.inc");
|
2003-03-17 22:37:49 +00:00
|
|
|
require_once("host.inc");
|
2002-12-06 21:37:30 +00:00
|
|
|
|
|
|
|
db_init();
|
2003-03-21 04:38:55 +00:00
|
|
|
$hostid = $_GET["hostid"];
|
2003-06-17 22:28:01 +00:00
|
|
|
$private = $_GET["private"];
|
2003-03-19 21:01:32 +00:00
|
|
|
$result = mysql_query("select * from host where id = $hostid");
|
|
|
|
$host = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
2003-03-20 02:05:25 +00:00
|
|
|
if (!$host) {
|
|
|
|
echo "Couldn't find computer";
|
|
|
|
exit();
|
|
|
|
}
|
2003-06-17 22:28:01 +00:00
|
|
|
if ($private) {
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
if (!$user || $user->id != $host->userid) {
|
|
|
|
$private = false;
|
|
|
|
}
|
2002-12-06 21:37:30 +00:00
|
|
|
}
|
2003-06-17 22:28:01 +00:00
|
|
|
|
2003-03-20 02:05:25 +00:00
|
|
|
page_head("Computer summary", $user);
|
|
|
|
show_host($host, $private);
|
2003-03-19 21:01:32 +00:00
|
|
|
page_tail();
|
2002-12-06 21:37:30 +00:00
|
|
|
?>
|