.
require_once("../inc/boinc_db.inc");
require_once("../inc/util.inc");
require_once("../inc/team.inc");
function show_admin_page($user, $team) {
page_head("Team administration for $team->name");
echo "
";
page_tail();
}
$user = get_logged_in_user(true);
$teamid = get_int('teamid');
$team = BoincTeam::lookup_id($teamid);
if (!$team) error_page("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("Can't delete non-empty team");
}
check_tokens($user->authenticator);
$team->delete();
page_head("Team $team->name deleted");
page_tail();
} else {
require_admin($user, $team);
show_admin_page($user, $team);
}
?>