示例#1
0
function edit_form($user, $team, $forum, $first)
{
    page_head(tra("Team Message Board"));
    echo "\n        <form action=team_forum.php method=post>\n        <input type=hidden name=teamid value={$team->id}>\n        <input type=hidden name=cmd value=edit_action>\n    ";
    echo form_tokens($user->authenticator);
    start_table();
    if (!strlen($forum->title)) {
        $forum->title = $team->name;
    }
    if (!strlen($forum->description)) {
        $forum->description = tra("Discussion among members of %1", $team->name);
    }
    row2(tra("Title"), "<input name=title size=80 value=\"{$forum->title}\">");
    row2(tra("Description"), "<textarea name=description>{$forum->description}</textarea>");
    row2(tra("Minimum time between posts (seconds)"), "<input name=post_min_interval value={$forum->post_min_interval}>");
    row2(tra("Minimum total credit to post"), "<input name=post_min_total_credit value={$forum->post_min_total_credit}>");
    row2(tra("Minimum average credit to post"), "<input name=post_min_expavg_credit value={$forum->post_min_expavg_credit}>");
    row2("", "<input class=\"btn btn-default\" type=submit value=" . tra("Submit") . ">");
    end_table();
    echo "\n        </form>\n    ";
    if (!$first) {
        echo "\n            <p>\n            <a href=team_forum.php?teamid={$team->id}&cmd=remove_confirm{$tokens}>\n            " . tra("Remove your team's message board.") . "</a>\n        ";
    }
    page_tail();
}
示例#2
0
function edit_form($user, $team, $forum, $first)
{
    page_head("Team forum");
    echo '
		<form action="team_forum.php" method="post">
		<input type="hidden" name="teamid" value="$team->id">
		<input type="hidden" name="cmd" value="edit_action">
	';
    echo form_tokens($user->authenticator);
    start_table();
    if (!strlen($forum->title)) {
        $forum->title = $team->name;
    }
    if (!strlen($forum->description)) {
        $forum->description = "Discussion among members of {$team->name}";
    }
    row2('Title', '<input name="title" value="$forum->title">');
    row2('Description', '<textarea name="description">$forum->description</textarea>');
    row2('Minimum time between posts (seconds)', '<input name="post_min_interval" value="$forum->post_min_interval">');
    row2('Minimum total credit to post', '<input name="post_min_total_credit" value="$forum->post_min_total_credit">');
    row2('Minimum average credit to post', '<input name="post_min_expavg_credit" value="$forum->post_min_expavg_credit">');
    row2('', '<input type="submit" value="OK">');
    end_table();
    echo "</form>";
    if (!$first) {
        echo '<p><a href="team_forum.php?teamid=$team->id&amp;cmd=remove_confirm$tokens">Remove your team\'s message board.</a></p>';
    }
    page_tail();
}
示例#3
0
function show_admins($user, $teamid)
{
    page_head(tra("Add or remove Team Admins"));
    echo tra("You can select team members as 'Team Admins'. Team Admins can:") . "\n        <ul>\n        <li>" . tra("Edit team information (name, URL, description, country)") . "\n        <li>" . tra("View the team's join/quit history") . "\n        <li>" . tra("Moderate the team forum, if any (admins get email notification of moderation events and red X reports)") . "\n        </ul>\n        " . tra("Team Admins cannot:") . "\n        <ul>\n        <li>" . tra("Change the team founder") . "\n        <li>" . tra("Remove members") . "\n        <li>" . tra("Add or remove Team Admins") . "\n        </ul>\n        " . tra("If a Team Admin quits the team, they cease to be a Team Admin.") . "\n        <br /><br />" . tra("We recommend that you select only people you know and trust very well as Team Admins.");
    $admins = BoincTeamAdmin::enum("teamid={$teamid}");
    start_table();
    if (count($admins) == 0) {
        row1(tra("There are currently no Team Admins"));
    } else {
        row1(tra("Current Team Admins"), 3);
        table_header(tra("Name"), tra("Became Team Admin on"), "");
        foreach ($admins as $admin) {
            show_admin($user, $admin);
        }
    }
    end_table();
    echo "\n        <p>\n        <form action=team_admins.php>\n        <input type=hidden name=action value=add>\n        <input type=hidden name=teamid value={$teamid}>\n    ";
    echo form_tokens($user->authenticator);
    start_table();
    row1(tra("Add Team Admin"));
    row2(tra("Email address of team member:"), "<input name=email_addr>");
    row2("", "<input type=submit action value=\"" . tra("Add") . "\">");
    end_table();
    echo "</form>";
    page_tail();
}
示例#4
0
function show_admins($user, $teamid)
{
    page_head("Add or remove Team Admins");
    echo "\n\t\tYou can select team members as 'Team Admins'.\n\t\tTeam Admins can:\n\t\t<ul>\n\t\t<li>Edit team information (name, URL, description, country).</li>\n\t\t<li>View the team's join/quit history.</li>\n\t\t<li>Moderate the team forum, if any (admins get emails notification of moderation events and red X reports).</li>\n\t\t</ul>\n\t\tTeam Admins cannot:\n\t\t<ul>\n\t\t<li>Change the team founder.</li>\n\t\t<li>Remove members.</li>\n\t\t<li>Add or remove Team Admins.</li>\n\t\t</ul>\n\t\tIf a Team Admin quits the team, they cease to be a Team Admin.\n\t\t<p>\n\t\tWe recommend that you select only people\n\t\tyou know and trust very well as Team Admins.\n\t";
    $admins = BoincTeamAdmin::enum("teamid={$teamid}");
    start_table();
    if (count($admins) == 0) {
        row1("There are currently no Team Admins");
    } else {
        row1("Current Team Admins", 3);
        table_header("Name", "Became Team Admin on", "");
        foreach ($admins as $admin) {
            show_admin($user, $admin);
        }
    }
    end_table();
    echo '
		<p>
		<form action="team_admins.php">
		<input type="hidden" name="action" value="add">
		<input type="hidden" name="teamid" value="$teamid">
	';
    echo form_tokens($user->authenticator);
    start_table();
    row1("Add Team Admin");
    row2('Email address of team member:', '<input name="email_addr">');
    row2('', '<input type="submit" action value="Add">');
    end_table();
    echo "</form>";
    page_tail();
}
示例#5
0
 function acquire_poll($url)
 {
     // acquire request token and access token for future requests
     $token_string = request_token();
     $token_string2 = access_token($token_string);
     $tokens = form_tokens($token_string, $token_string2);
     
     // retrieve poll's 16-character id
     $id = extract_id($url);
     
     // access this poll
     $poll = access_poll($id, $tokens);
     
     // format poll data
     $xml_array = parse($poll);
     
     // store tokens for future use in submitting poll
     $xml_array['tokens'] = $tokens;
     
     return $xml_array;
 }
    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
        $user_total_credit = format_credit($user->total_credit);
        $user_expavg_credit = format_credit($user->expavg_credit);
        $selected = $user->id == $team->ping_user ? "selected" : "";
        echo '
            <tr>
            <td align="center"><input type="radio" name="userid" value="' . $user->id . '">
            <td>' . $user->name . '</td>
            <td align=right>' . $user_total_credit . '</td>
示例#7
0
文件: pm.php 项目: CalvinZhu/boinc
function do_block($logged_in_user)
{
    $id = get_int("id");
    $user = BoincUser::lookup_id($id);
    if (!$user) {
        error_page(tra("No such user"));
    }
    page_head(tra("Really block %1?", $user->name));
    echo "<div>" . tra("Are you really sure you want to block user %1 from sending you private messages?", $user->name) . "<br>\n";
    echo tra("Please note that you can only block a limited amount of users.") . "</div>\n";
    echo "<div>" . tra("Once the user has been blocked you can unblock it using forum preferences page.") . "</div>\n";
    echo "<form action=\"pm.php\" method=\"POST\">\n";
    echo form_tokens($logged_in_user->authenticator);
    echo "<input type=\"hidden\" name=\"action\" value=\"confirmedblock\">\n";
    echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
    echo "<input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Add user to filter") . "\">\n";
    echo "<a href=\"pm.php?action=inbox\">" . tra("No, cancel") . "</a>\n";
    echo "</form>\n";
}
require_once '../inc/forum_banishment_vote.inc';
$config = get_config();
$logged_in_user = get_logged_in_user();
BoincForumPrefs::lookup($logged_in_user);
if (!get_str('action')) {
    error_page("You must specify an action...");
}
if (!$logged_in_user->prefs->privilege(S_MODERATOR)) {
    // Can't moderate without being moderator
    error_page("You are not authorized to banish users.");
}
$userid = get_int('userid');
$user = BoincUser::lookup_id($userid);
page_head('Banishment Vote');
echo "<form action=\"forum_banishment_vote_action.php?userid=" . $userid . "\" method=\"POST\">\n";
echo form_tokens($logged_in_user->authenticator);
start_table();
row1("Banishment Vote");
if (get_str('action') == "start") {
    if (!$user) {
        error_page("no user");
    }
    $x = $user->banished_until;
    if ($x > time()) {
        error_page("User is already banished");
    }
    //display input that selects reason
    echo "<input type=hidden name=action value=start>";
    echo "<input type=\"hidden\" name=\"userid\" value=\"" . $userid . "\">\n";
    row1("Are you sure you want to banish " . $user->name . "?\n\t\tThis will prevent " . $user->name . " from posting for chosen time period.<br />\n\t\tIt should be done only if " . $user->name . "\n\t\thas consistently exhibited trollish behavior.");
    row2("", "Select the reason category, optionally write a longer description of why the user should be banished.");
示例#9
0
function show_message_row($thread, $parent_post)
{
    global $g_logged_in_user;
    global $content;
    global $preview;
    $x1 = "Message:" . html_info() . post_warning();
    $x2 = "";
    if ($parent_post) {
        $x2 .= " reply to <a href=#" . $parent_post->id . ">Message ID " . $parent_post->id . "</a>:";
    }
    $x2 .= "<form action=forum_reply.php?thread=" . $thread->id;
    if ($parent_post) {
        $x2 .= "&post=" . $parent_post->id;
    }
    $x2 .= " method=\"post\">\n";
    $x2 .= form_tokens($g_logged_in_user->authenticator);
    $x2 .= "<textarea name=\"content\" rows=\"18\" cols=\"80\">";
    $no_quote = get_int("no_quote", true) == 1;
    if ($preview) {
        $x2 .= htmlspecialchars($content);
    } else {
        if (!$no_quote) {
            if ($parent_post) {
                $x2 .= quote_text(htmlspecialchars($parent_post->content), 80) . "\n";
            }
        }
    }
    if (!$g_logged_in_user->prefs->no_signature_by_default) {
        $enable_signature = "checked=\"true\"";
    } else {
        $enable_signature = "";
    }
    $x2 .= "</textarea><p>\r\n\t\t<input type=\"submit\" name=\"preview\" value=\"" . tra("Preview") . "\">\r\n\t\t<input type=\"submit\" value=\"Post reply\">\r\n\t\t<input name=\"add_signature\" id=\"add_signature\" value=\"add_it\" " . $enable_signature . " type=\"checkbox\">\r\n\t\t<label for=\"add_signature\">Add my signature to this reply</label>\r\n\r\n\t\t</form>\r\n\t";
    row2($x1, $x2);
}
示例#10
0
function show_message_row($thread, $parent_post)
{
    global $logged_in_user, $bbcode_html;
    global $content, $preview;
    $x1 = tra("Message:") . html_info() . post_warning();
    $x2 = "";
    if ($parent_post) {
        $x2 .= " " . tra("reply to %1Message ID%2:", "<a href=#" . $parent_post->id . ">", " " . $parent_post->id . "</a>");
    }
    $x2 .= "<form action=forum_reply.php?thread=" . $thread->id;
    if ($parent_post) {
        $x2 .= "&post=" . $parent_post->id;
    }
    $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
    $x2 .= form_tokens($logged_in_user->authenticator);
    $x2 .= $bbcode_html . "<textarea name=\"content\" rows=\"18\" cols=\"80\">";
    $no_quote = get_int("no_quote", true) == 1;
    if ($preview) {
        $x2 .= htmlspecialchars($content);
    } else {
        if (!$no_quote) {
            if ($parent_post) {
                $x2 .= quote_text(htmlspecialchars($parent_post->content)) . "\n";
            }
        }
    }
    if (!$logged_in_user->prefs->no_signature_by_default) {
        $enable_signature = "checked=\"true\"";
    } else {
        $enable_signature = "";
    }
    $x2 .= "</textarea><p>\n        <input type=\"submit\" name=\"preview\" value=\"" . tra("Preview") . "\">\n        <input type=\"submit\" value=\"" . tra("Post reply") . "\">\n        &nbsp;&nbsp;&nbsp;\n        <input type=\"checkbox\" name=\"add_signature\" id=\"add_signature\" value=\"add_it\" " . $enable_signature . ">\n        <label for=\"add_signature\">" . tra("Add my signature to this reply") . "</label>\n\n        </form>\n    ";
    row2($x1, $x2);
}