コード例 #1
0
ファイル: team_manage.php プロジェクト: Turante/boincweb
function show_admin_page($user, $team)
{
    page_head("Team administration for {$team->name}");
    echo "\r\n\t\t<ul>\r\n\t\t<li><a href=team_edit_form.php?teamid={$team->id}>Edit team info</a>\r\n\t\t\t<br><span class=note>Change team name, URL, description, type, or country</span>\r\n\t\t<li>\r\n\t\t\tMember list:\r\n\t\t<a href=team_email_list.php?teamid={$team->id}>HTML</a>\r\n\t\t| <a href=team_email_list.php?teamid={$team->id}&plain=1>text</a>\r\n\t\t\t<br><span class=note> View member names and email addresses </span>\r\n\t\t<li>View change history:\r\n\t\t\t<a href=team_delta.php?teamid={$team->id}>HTML</a>\r\n\t\t\t| <a href=team_delta.php?teamid={$team->id}&xml=1>XML</a>\r\n\t\t\t<br><span class=note>See when members joined or quit this team</span>\r\n\t";
    // 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 "<li>\r\n\t\t\t\t<a href=team_change_founder_form.php?teamid={$team->id}><font color=red><b>Respond to foundership request</b></font></a>.  If you don't respond by {$deadline}, {$user2->name} may assume foundership of this team.\r\n\t\t\t";
        }
        echo "\r\n\t\t\t<li><a href=team_remove_inactive_form.php?teamid={$team->id}>Remove members</a>\r\n\t\t\t\t<br><span class=note>Remove inactive or unwanted members from this team</span>\r\n\t\t\t<li><a href=team_change_founder_form.php?teamid={$team->id}>Change founder</a>\r\n\t\t\t\t<br><span class=note>Transfer foundership to another member</span>\r\n\t\t\t<li><a href=team_admins.php?teamid={$team->id}>Add/remove Team Admins</a>\r\n\t\t\t\t<br><span class=note>Give selected team members Team Admin privileges</span>\r\n\r\n\t\t\t<li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>Remove team</a>\r\n\t\t\t\t<br><span class=note>Allowed only if team has no members</a>\r\n\t\t\t<li><a href=team_forum.php?teamid={$team->id}&cmd=manage>Message board</a>\r\n\t\t\t\t<br><span class=note>Create or manage team message board</span>\r\n\t\t";
    }
    echo "\r\n\r\n\t\t<p>\r\n\t\t<li>\r\n\t\t\tTo have this team created on all BOINC projects\r\n\t\t\t(current and future) you can make it into a\r\n\t\t\t<a href=http://boinc.berkeley.edu/teams/>BOINC-wide team</a>.\r\n\t\t<li>\r\n\t\t\tTeam admins are encouraged to join and participate in the Google\r\n\t\t\t<a href=http://groups.google.com/group/boinc-team-founders>boinc-team-founders</a> group.\r\n\t\t<li>\r\n\t\t\tOther resources for BOINC team admins\r\n\t\t\tare available from a third-party site,\r\n\t\t\t<a href=http://www.boincteams.com>www.boincteams.com</a>.\r\n\t</ul>\r\n\t";
    page_tail();
}
コード例 #2
0
ファイル: team_manage.php プロジェクト: CalvinZhu/boinc
function show_admin_page($user, $team)
{
    page_head(tra("Team administration for %1", $team->name));
    echo "\n        <ul>\n        <li><a href=team_edit_form.php?teamid={$team->id}>" . tra("Edit team info") . "</a>\n            <br><p class=\"text-muted\">" . tra("Change team name, URL, description, type, or country") . "</p>\n        <li>\n            " . tra("Member list:") . "\n        <a href=team_email_list.php?teamid={$team->id}>" . tra("HTML") . "</a>\n        &middot; <a href=team_email_list.php?teamid={$team->id}&plain=1>" . tra("text") . "</a>\n            <br><p class=\"text-muted\">" . tra("View member names and email addresses") . "</p>\n        <li>" . tra("View change history:") . "\n            <a href=team_delta.php?teamid={$team->id}>" . tra("HTML") . "</a>\n            &middot; <a href=team_delta.php?teamid={$team->id}&xml=1>" . tra("XML") . "</a>\n            <br><p class=\"text-muted\">" . tra("See when members joined or quit this team") . "</p>\n    ";
    // 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 "<li>\n                <a href=team_change_founder_form.php?teamid={$team->id}><font color=red><strong>" . tra("Respond to foundership request.") . "</strong></font></a>  " . tra("If you don't respond by %1, %2 may assume foundership of this team.", $deadline, $user2->name);
        }
        echo "\n            <li><a href=team_remove_inactive_form.php?teamid={$team->id}>" . tra("Remove members") . "</a>\n                <br><p class=\"text-muted\">" . tra("Remove inactive or unwanted members from this team") . "</p>\n            <li><a href=team_change_founder_form.php?teamid={$team->id}>" . tra("Change founder") . "</a>\n                <br><p class=\"text-muted\">" . tra("Transfer foundership to another member") . "</p>\n            <li><a href=team_admins.php?teamid={$team->id}>" . tra("Add/remove Team Admins") . "</a>\n                <br><p class=\"text-muted\">" . tra("Give selected team members Team Admin privileges") . "</p>\n\n            <li><a href=team_manage.php?teamid={$team->id}&action=delete&{$tokens}>" . tra("Remove team") . "</a>\n                <br><p class=\"text-muted\">" . tra("Allowed only if team has no members") . "</p>\n            <li><a href=team_forum.php?teamid={$team->id}&cmd=manage>" . tra("Message board") . "</a>\n                <br><p class=\"text-muted\">" . tra("Create or manage a team message board") . "</p>\n        ";
    }
    echo "\n\n        <p>\n        <li>\n            " . tra("To have this team created on all BOINC projects (current and future) you can make it into a %1BOINC-wide team%2.", "<a href=http://boinc.berkeley.edu/teams/>", "</a>") . "\n        <li>\n            " . tra("Team admins are encouraged to join and participate in the Google %1boinc-team-founders%2 group.", "<a href=http://groups.google.com/group/boinc-team-founders>", "</a>") . "\n    </ul>\n    ";
    page_tail();
}
コード例 #3
0
page_head(tra("Request foundership of %1", $team->name));
$now = time();
// it should never happen, but just in case
//
if (!$team->userid) {
    $team->update("userid={$user->id}, ping_user=0, ping_time=0");
    echo tra("You are now founder of team %1.", $team->name);
    page_tail();
    exit;
}
if ($user->id == $team->ping_user) {
    echo "<p>" . tra("You requested the foundership of %1 on %2.", $team->name, date_str($team->ping_time)) . "\n    </p>";
    if (transfer_ok($team, $now)) {
        echo tra("60 days have elapsed since your request, and the founder has not responded. You may now assume foundership by clicking here:") . "<form method=\"post\" action=\"team_founder_transfer_action.php\">\n            <input type=\"hidden\" name=\"action\" value=\"finalize_transfer\">\n            <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Assume foundership") . "\">\n            </form>\n        ";
    } else {
        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))) . "</p>";
    }
} else {
    if (new_transfer_request_ok($team, $now)) {
        echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">";
        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 />\n                       Are you sure you want to request foundership?") . "</p>";
        echo "<input type=\"hidden\" name=\"action\" value=\"initiate_transfer\">\n            <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Request foundership") . "\">\n            </form>\n        ";
    } else {
        if ($team->ping_user) {
            if ($team->ping_user < 0) {
                $team->ping_user = -$team->ping_user;
            }
            $ping_user = BoincUser::lookup_id($team->ping_user);
            echo "<p>" . tra("Founder change has already been requested by %1 on %2.", user_links($ping_user), date_str($team->ping_time)) . "</p>";
        } else {
            echo "<p>" . tra("A foundership change was requested during the last 90 days, so new requests are not allowed. Please try again later.") . "</p>";
コード例 #4
0
$teamid = get_int("teamid");
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
    error_page(tra("no such team"));
}
require_founder_login($user, $team);
page_head(tra("Change founder of %1", $team->name));
if ($team->ping_user != 0) {
    if ($team->ping_user < 0) {
        $ping_user = BoincUser::lookup_id(-$team->ping_user);
        $x = date_str($team->ping_time);
        echo "<p>" . tra("Team member %1 requested this team's foundership on %2, but left the team, thus canceling the request.", user_links($ping_user), $x) . "</p>";
        $team->update("ping_user=0, ping_time=0");
    } else {
        $ping_user = BoincUser::lookup_id($team->ping_user);
        $x = date_str(transfer_ok_time($team));
        echo "<p>" . tra("Team member %1 has requested this team's foundership. This may be because you left the team or haven't had contact with the team for a long time.", user_links($ping_user)) . "</p>";
        echo "<p>\n            <form method=\"post\" action=\"team_founder_transfer_action.php\">\n            <input type=\"hidden\" name=\"action\" value=\"decline\">\n            <input type=\"hidden\" name=\"teamid\" value=\"" . $team->id . "\">\n            <input type=\"submit\" value=\"" . tra("decline request") . "\">\n            </form>\n            <p>\n            " . tra("If you don't decline the request by %1, %2 will have the option of assuming team foundership.<br /><br />\n                  To accept the request, assign foundership to %3 using the form below.", $x, $ping_user->name, $ping_user->name) . "\n            </p>\n            <hr>\n            <p>\n        ";
    }
} else {
    echo tra("No transfer request is pending.") . "<br /><br />";
}
echo tra("To assign foundership of this team to another member, check the box next to member name and click <strong>Change founder</strong> below.") . "<form method=post action=team_change_founder_action.php>\n    <input type=hidden name=teamid value={$team->id}>";
echo form_tokens($user->authenticator);
start_table();
echo "<tr>\n    <th>" . tra("New founder?") . "</th>\n    <th>" . tra("Name") . "</th>\n    <th>" . tra("Total credit") . "</th>\n    <th>" . tra("Recent average credit") . "</th>\n    </tr>\n";
$users = BoincUser::enum("teamid={$team->id}");
$navailable_users = 0;
foreach ($users as $user) {
    if ($user->id != $team->userid) {
        //don't show current founder
コード例 #5
0
page_head("Request foundership of {$team->name}");
$now = time();
// it should never happen, but just in case
//
if (!$team->userid) {
    $team->update("userid={$user->id}, ping_user=0, ping_time=0");
    echo "You are now founder of team {$team->name}.";
    page_tail();
    exit;
}
if ($user->id == $team->ping_user) {
    echo "<p>You requested the foundership of {$team->name}\r\n\t\ton " . date_str($team->ping_time) . ".\r\n\t";
    if (transfer_ok($team, $now)) {
        echo "\r\n\t\t\t60 days have elapsed since your request,\r\n\t\t\tand the founder has not responded.\r\n\t\t\tYou may now assume foundership by clicking here:\r\n\t\t\t<form method=\"post\" action=\"team_founder_transfer_action.php\">\r\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"finalize_transfer\">\r\n\t\t\t<input type=\"submit\" value=\"Assume foundership\">\r\n\t\t\t</form>\r\n\t\t";
    } else {
        echo "<p>\r\n\t\t\tThe founder was notified of your request.\r\n\t\t\tIf he/she does not respond by " . date_str(transfer_ok_time($team)) . "\r\n\t\t\tyou will be given an option to become founder.\r\n\t\t";
    }
} else {
    if (new_transfer_request_ok($team, $now)) {
        echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">";
        echo "<p>If the team founder is not active and you want to assume\r\n\t\t\tthe role of founder, click the button below.\r\n\t\t\tThe current founder will be sent an email detailing your request,\r\n\t\t\tand will be able to transfer foundership to you\r\n\t\t\tor to decline your request.\r\n\t\t\tIf the founder does not respond in 60 days,\r\n\t\t\tyou will be allowed to become the founder.\r\n\t\t\t<p>\r\n\t\t\tAre you sure you want to request foundership?\r\n\t\t";
        echo "<input type=\"hidden\" name=\"action\" value=\"initiate_transfer\">\r\n\t\t\t<input type=\"submit\" value=\"Request foundership\">\r\n\t\t\t</form>\r\n\t\t";
    } else {
        if ($team->ping_user) {
            if ($team->ping_user < 0) {
                $team->ping_user = -$team->ping_user;
            }
            $ping_user = BoincUser::lookup_id($team->ping_user);
            echo "<p>Founder change has already been requested by " . user_links($ping_user) . " on " . date_str($team->ping_time) . ".\r\n\t\t\t";
        } else {
            echo "<p>A foundership change was requested during the last 90 days,\r\n\t\t\t\t so new requests are not allowed.\r\n\t\t\t\t Please try again later.\r\n\t\t\t";