2003-03-17 22:37:49 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2008-03-06 00:40:48 +00:00
|
|
|
|
2005-12-04 23:39:09 +00:00
|
|
|
// show all the hosts for a user.
|
|
|
|
// if $userid is absent, show hosts of logged-in user
|
2003-03-19 21:01:32 +00:00
|
|
|
|
2007-10-28 15:03:14 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2005-12-04 23:39:09 +00:00
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/host.inc");
|
2003-03-17 22:37:49 +00:00
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("show_all", "rev", "sort", "userid"));
|
|
|
|
|
2005-12-04 23:39:09 +00:00
|
|
|
$show_all = get_int("show_all", true);
|
2006-02-27 20:49:22 +00:00
|
|
|
if ($show_all != 1) {
|
|
|
|
$show_all = 0;
|
2008-09-07 07:40:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$rev = get_int("rev", true);
|
|
|
|
if ($rev != 1) {
|
|
|
|
$rev = 0;
|
2006-02-27 20:49:22 +00:00
|
|
|
}
|
|
|
|
|
2006-02-22 06:19:54 +00:00
|
|
|
$sort = get_str("sort", true);
|
2008-09-07 07:40:56 +00:00
|
|
|
|
2005-12-04 23:39:09 +00:00
|
|
|
$user = get_logged_in_user(false);
|
2006-02-27 20:49:22 +00:00
|
|
|
$userid = get_int("userid", true);
|
|
|
|
|
2005-12-04 23:39:09 +00:00
|
|
|
if ($user && $user->id == $userid) {
|
|
|
|
$userid = 0;
|
|
|
|
}
|
|
|
|
if ($userid) {
|
|
|
|
$user = lookup_user_id($userid);
|
|
|
|
if (!$user) {
|
|
|
|
error_page("No such user");
|
2005-07-20 12:49:45 +00:00
|
|
|
}
|
2007-10-27 20:05:32 +00:00
|
|
|
|
2005-12-04 23:39:09 +00:00
|
|
|
if ($user->show_hosts) {
|
2010-05-19 16:28:01 +00:00
|
|
|
page_head(tra("Computers belonging to %1", $user->name));
|
2003-03-19 21:01:32 +00:00
|
|
|
} else {
|
2011-08-25 22:12:48 +00:00
|
|
|
page_head(tra("Computers hidden"));
|
|
|
|
echo tra(tra("This user has chosen not to show information about his or her computers."));
|
2005-12-04 23:39:09 +00:00
|
|
|
page_tail();
|
|
|
|
exit();
|
2003-03-19 21:01:32 +00:00
|
|
|
}
|
2005-12-04 23:39:09 +00:00
|
|
|
$private = false;
|
|
|
|
} else {
|
2005-12-21 22:59:21 +00:00
|
|
|
$user = get_logged_in_user();
|
2005-12-04 23:39:09 +00:00
|
|
|
$userid = $user->id;
|
2011-08-25 22:12:48 +00:00
|
|
|
page_head(tra("Your computers"));
|
2005-12-04 23:39:09 +00:00
|
|
|
$private = true;
|
|
|
|
}
|
2005-09-21 21:39:35 +00:00
|
|
|
|
2010-02-04 16:15:54 +00:00
|
|
|
show_user_hosts($userid, $private, $show_all, $sort, $rev);
|
2007-10-24 17:35:28 +00:00
|
|
|
|
2010-05-19 16:28:01 +00:00
|
|
|
page_tail();
|
2008-03-06 00:40:48 +00:00
|
|
|
|
2003-03-17 22:37:49 +00:00
|
|
|
?>
|