.
require_once("../inc/boinc_db.inc");
require_once("../inc/util.inc");
require_once("../inc/team.inc");
if (DISABLE_TEAMS) error_page("Teams are disabled");
check_get_args(array("teamid", "action", "tnow", "ttok"));
function show_admin_page($user, $team) {
page_head(tra("Team administration for %1", $team->name));
echo "
- id>".tra("Edit team info")."
".tra("Change team name, URL, description, type, or country")."
-
".tra("Member list:")."
id>".tra("HTML")."
· id&plain=1>".tra("text")."
".tra("View member names and email addresses")."
- ".tra("View change history:")."
id>".tra("HTML")."
· id&xml=1>".tra("XML")."
".tra("See when members joined or quit this team")."
";
// founder-only stuff follows
//
if ($team->userid == $user->id) {
$tokens = url_tokens($user->authenticator);
if ($team->ping_user > 0) {
$user2 = BoincUser::lookup_id($team->ping_user);
$deadline = date_str(transfer_ok_time($team));
echo " -
id>".tra("Respond to foundership request.")." ".tra("If you don't respond by %1, %2 may assume foundership of this team.", $deadline, $user2->name)
;
}
echo "
- id>".tra("Remove members")."
".tra("Remove inactive or unwanted members from this team")."
- id>".tra("Change founder")."
".tra("Transfer foundership to another member")."
- id>".tra("Add/remove Team Admins")."
".tra("Give selected team members Team Admin privileges")."
- id&action=delete&$tokens>".tra("Remove team")."
".tra("Allowed only if team has no members")."
- id&cmd=manage>".tra("Message board")."
".tra("Create or manage a team message board")."
";
}
echo "
-
".tra("To have this team created on all BOINC projects (current and future) you can make it into a %1BOINC-wide team%2.", "", "")."
-
".tra("Team admins are encouraged to join and participate in the Google %1boinc-team-founders%2 group.", "", "")."
-
".tra("Other resources for BOINC team admins are available from a third-party site, %1www.boincteams.com%2.", "", "")."
";
page_tail();
}
$user = get_logged_in_user(true);
$teamid = get_int('teamid');
$team = BoincTeam::lookup_id($teamid);
if (!$team) error_page(tra("No such team"));
$action = get_str('action', true);
if ($action == 'delete') {
require_founder_login($user, $team);
if (team_count_members($team->id) > 0) {
error_page(tra("Can't delete non-empty team"));
}
check_tokens($user->authenticator);
$team->delete();
page_head(tra("Team %1 deleted", $team->name));
page_tail();
} else {
require_admin($user, $team);
show_admin_page($user, $team);
}
?>