. // show all the hosts for a user. // if $userid is absent, show hosts of logged-in user require_once("../inc/boinc_db.inc"); require_once("../inc/util.inc"); require_once("../inc/host.inc"); check_get_args(array("show_all", "rev", "sort", "userid")); $show_all = get_int("show_all", true); if ($show_all != 1) { $show_all = 0; } $rev = get_int("rev", true); if ($rev != 1) { $rev = 0; } $sort = get_str("sort", true); $user = get_logged_in_user(false); $userid = get_int("userid", true); if ($user && $user->id == $userid) { $userid = 0; } if ($userid) { $user = lookup_user_id($userid); if (!$user) { error_page("No such user"); } if ($user->show_hosts) { page_head(tra("Computers belonging to %1", $user->name)); } else { page_head("Computers hidden"); echo tra("This user has chosen not to show information about their computers."); page_tail(); exit(); } $private = false; } else { $user = get_logged_in_user(); $userid = $user->id; page_head("Your computers"); $private = true; } show_user_hosts($userid, $private, $show_all, $sort, $rev); page_tail(); ?>