1<?php
2// This file is part of BOINC.
3// http://boinc.berkeley.edu
4// Copyright (C) 2014 University of California
5//
6// BOINC is free software; you can redistribute it and/or modify it
7// under the terms of the GNU Lesser General Public License
8// as published by the Free Software Foundation,
9// either version 3 of the License, or (at your option) any later version.
10//
11// BOINC is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14// See the GNU Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
18
19require_once("../inc/util.inc");
20require_once("../inc/team.inc");
21require_once("../inc/cache.inc");
22
23if (DISABLE_TEAMS) error_page("Teams are disabled");
24
25check_get_args(array("sort_by", "offset", "teamid"));
26
27if (isset($_GET["sort_by"])) {
28    $sort_by = $_GET["sort_by"];
29    $sort_by = strip_tags($sort_by);    // remove XSS nonsense
30} else {
31    $sort_by = "expavg_credit";
32}
33
34$offset = get_int("offset", true);
35if (!$offset) $offset=0;
36
37if ($offset > 1000) {
38    error_page(tra("Limit exceeded:  Can only display the first 1000 members."));
39}
40
41$teamid = get_int("teamid");
42
43$cache_args = "teamid=$teamid";
44$team = unserialize(get_cached_data(TEAM_PAGE_TTL, $cache_args));
45if (!$team) {
46    $team = BoincTeam::lookup_id($teamid);
47    if (!$team) error_page("no such team");
48    set_cached_data(TEAM_PAGE_TTL, serialize($team), $cache_args);
49}
50
51page_head(tra("Members of %1", "<a href=team_display.php?teamid=$teamid>$team->name</a>"));
52display_team_members($team, $offset, $sort_by);
53page_tail();
54
55?>
56