2004-12-16 20:52:27 +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/>.
|
2004-12-16 20:52:27 +00:00
|
|
|
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/team.inc");
|
2007-10-26 21:14:35 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2004-12-16 20:52:27 +00:00
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("tnow", "ttok"));
|
|
|
|
|
2004-12-16 20:52:27 +00:00
|
|
|
$user = get_logged_in_user();
|
|
|
|
|
2007-10-26 21:14:35 +00:00
|
|
|
$teamid = post_int("teamid");
|
|
|
|
$team = BoincTeam::lookup_id($teamid);
|
|
|
|
if (!$team) {
|
2010-02-16 01:06:03 +00:00
|
|
|
error_page(tra("no such team"));
|
2004-12-16 20:52:27 +00:00
|
|
|
}
|
|
|
|
require_founder_login($user, $team);
|
2007-11-07 23:59:08 +00:00
|
|
|
check_tokens($user->authenticator);
|
2004-12-16 20:52:27 +00:00
|
|
|
|
2007-11-07 23:59:08 +00:00
|
|
|
$userid = post_int("userid");
|
|
|
|
$new_founder = BoincUser::lookup_id($userid);
|
|
|
|
if (!$new_founder || $new_founder->teamid != $team->id) {
|
2010-02-16 01:06:03 +00:00
|
|
|
error_page(tra("User is not a member of %1", $team->name));
|
2004-12-16 20:52:27 +00:00
|
|
|
}
|
2007-11-07 23:59:08 +00:00
|
|
|
|
2010-02-16 01:06:03 +00:00
|
|
|
page_head(tra("Changing founder of %1", $team->name));
|
2007-11-07 23:59:08 +00:00
|
|
|
$team->update("userid=$userid, ping_user=0");
|
2010-02-16 01:06:03 +00:00
|
|
|
echo tra("%1 is now founder of %2", $new_founder->name, $team->name);
|
2004-12-16 20:52:27 +00:00
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|