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/boinc_db.inc"); 20require_once("../inc/util.inc"); 21require_once("../inc/team.inc"); 22 23if (DISABLE_TEAMS) error_page("Teams are disabled"); 24 25check_get_args(array()); 26 27$user = get_logged_in_user(); 28$team = BoincTeam::lookup_id($user->teamid); 29if (!$team) { 30 error_page(tra("You need to be a member of a team to access this page.")); 31} 32 33page_head(tra("Request foundership of %1", $team->name)); 34$now = time(); 35 36// it should never happen, but just in case 37// 38if (!$team->userid) { 39 $team->update("userid=$user->id, ping_user=0, ping_time=0"); 40 echo tra("You are now founder of team %1.", $team->name); 41 page_tail(); 42 exit; 43} 44 45if ($user->id == $team->ping_user) { 46 echo "<p>".tra("You requested the foundership of %1 on %2.", $team->name, date_str($team->ping_time))." 47 </p>"; 48 if (transfer_ok($team, $now)) { 49 echo tra("60 days have elapsed since your request, and the founder has not responded. You may now assume foundership by clicking here:") 50 ."<form method=\"post\" action=\"team_founder_transfer_action.php\"> 51 <input type=\"hidden\" name=\"action\" value=\"finalize_transfer\"> 52 <input class=\"btn btn-default\" type=\"submit\" value=\"".tra("Assume foundership")."\"> 53 </form> 54 "; 55 } else { 56 echo "<p>".tra("The founder was notified of your request. If he/she does not respond by %1 you will be given an option to become founder.", date_str(transfer_ok_time($team))) 57 ."</p>"; 58 } 59} else { 60 if (new_transfer_request_ok($team, $now)) { 61 echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">"; 62 echo "<p>".tra("If the team founder is not active and you want to assume the role of founder, click the button below. The current founder will be sent an email detailing your request, and will be able to transfer foundership to you or to decline your request. If the founder does not respond in 60 days, you will be allowed to become the founder.<br /><br /> 63 Are you sure you want to request foundership?") 64 ."</p>"; 65 66 echo "<input type=\"hidden\" name=\"action\" value=\"initiate_transfer\"> 67 <input class=\"btn btn-default\" type=\"submit\" value=\"".tra("Request foundership")."\"> 68 </form> 69 "; 70 } else { 71 if ($team->ping_user) { 72 if ($team->ping_user < 0) { 73 $team->ping_user = -$team->ping_user; 74 } 75 $ping_user = BoincUser::lookup_id($team->ping_user); 76 echo "<p>".tra("Founder change has already been requested by %1 on %2.", user_links($ping_user), date_str($team->ping_time)) 77 ."</p>"; 78 } else { 79 echo "<p>".tra("A foundership change was requested during the last 90 days, so new requests are not allowed. Please try again later.") 80 ."</p>"; 81 } 82 } 83} 84 85echo "<p><a href=\"team_display.php?teamid=".$team->id."\">".tra("Return to team page")."</a>"; 86 87page_tail(); 88 89$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit 90?> 91