Ejemplo n.º 1
0
function show_admin($user, $admin)
{
    $admin_user = BoincUser::lookup_id($admin->userid);
    $tokens = url_tokens($user->authenticator);
    $date = date_str($admin->create_time);
    echo "<tr>\n        <td>" . user_links($admin_user) . "</td>\n        <td>{$date}</td>\n        <td>\n    ";
    show_button("team_admins.php?teamid={$admin->teamid}&action=remove&userid={$admin_user->id}" . $tokens, tra("Remove"), tra("Remove Team Admin status from this member"));
    echo "</td></tr>\n    ";
}
Ejemplo n.º 2
0
function show_user($user)
{
    echo "\n        <tr class=row1>\n        <td>", user_links($user), " (ID {$user->id})</td>\n    ";
    if ($user->teamid) {
        $team = BoincTeam::lookup_id($user->teamid);
        echo "\n            <td> <a href=team_display.php?teamid={$team->id}>{$team->name}</a> </td>\n        ";
    } else {
        echo "<td><br></td>";
    }
    echo "\n        <td align=right>", format_credit($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}
Ejemplo n.º 3
0
function show_delta($delta)
{
    global $xml;
    $user = BoincUser::lookup_id($delta->userid);
    $when = time_str($delta->timestamp);
    $what = $delta->joining ? "joined" : "quit";
    if ($xml) {
        echo "    <action>\n        <id>{$user->id}</id>\n        <name>{$user->name}</name>\n        <action>{$what}</action>\n        <total_credit>{$delta->total_credit}</total_credit>\n        <when>{$when}</when>\n    </action>\n";
    } else {
        echo "<tr>\n           <td>{$when}</td>\n           <td>", user_links($user), " (ID {$user->id})</td>\n           <td>{$what}</td>\n           <td>{$delta->total_credit}</td>\n           </tr>\n        ";
    }
}
Ejemplo n.º 4
0
function show_user_row($user, $i)
{
    echo '
		<tr class="row1">
		<td>$i</td>
		<td>' . user_links($user) . '</td>
		<td class="right">' . format_credit_large($user->expavg_credit) . '</td>
		<td class="right">' . format_credit_large($user->total_credit) . '</td>
		<td>' . $user->country . '</td>
		<td>' . time_str($user->create_time) . '</td>
		</tr>
	';
}
Ejemplo n.º 5
0
function show_row($item, $apps, $is_team, $i)
{
    $j = $i % 2;
    if ($is_team) {
        $team = BoincTeam::lookup_id($item->teamid);
        if (!$team) {
            return;
        }
        $x = "<td>" . team_links($team) . "</td>\n";
    } else {
        $user = BoincUser::lookup_id($item->userid);
        if (!$user) {
            return;
        }
        $x = "<td>" . user_links($user, BADGE_HEIGHT_MEDIUM) . "</td>\n";
    }
    echo "<tr class=row{$j}>";
    echo "<td>{$i}</td>\n";
    echo $x;
    foreach ($apps as $app) {
        if ($app->id == $item->appid) {
            $c = $item;
        } else {
            if ($is_team) {
                $c = BoincCreditTeam::lookup("teamid={$item->teamid} and appid={$app->id}");
            } else {
                $c = BoincCreditUser::lookup("userid={$item->userid} and appid={$app->id}");
            }
            if (!$c) {
                $c = new StdClass();
                $c->expavg = 0;
                $c->total = 0;
            }
        }
        echo "<td align=right>" . format_credit($c->expavg) . "</td><td align=right>" . format_credit_large($c->total) . "</td>\n";
    }
    echo "</tr>\n";
}
Ejemplo n.º 6
0
function do_read($logged_in_user)
{
    $id = get_int("id");
    $message = BoincPrivateMessage::lookup_id($id);
    if (!$message || $message->userid != $logged_in_user->id) {
        error_page(tra("no such message"));
    }
    page_head(tra("Private messages") . " : " . $message->subject);
    pm_header();
    $sender = BoincUser::lookup_id($message->senderid);
    start_table();
    echo "<tr><th>" . tra("Subject") . "</th><td>" . $message->subject . "</td></tr>";
    echo "<tr><th>" . tra("Sender") . "</th><td>" . user_links($sender, BADGE_HEIGHT_SMALL);
    show_block_link($message->senderid);
    echo "</td></tr>";
    echo "<tr><th>" . tra("Date") . "</th><td>" . time_str($message->date) . "</td></tr>";
    echo "<tr><th>" . tra("Message") . "</th><td>" . output_transform($message->content, $options) . "</td></tr>";
    echo "<tr><td class=\"pm_footer\"></td><td>\n";
    echo "<a href=\"pm.php?action=new&amp;replyto={$id}\">" . tra("Reply") . "</a>\n";
    echo " &middot; <a href=\"pm.php?action=delete&amp;id={$id}\">" . tra("Delete") . "</a>\n";
    echo " &middot; <a href=\"pm.php?action=inbox\">" . tra("Inbox") . "</a>\n";
    end_table();
    if ($message->opened == 0) {
        $message->update("opened=1");
    }
}
if (!$team) {
    error_page("no such team");
}
require_admin($logged_in_user, $team);
page_head(tra("Remove members from %1", $team->name));
echo "\n    <form method=\"post\" action=\"team_remove_inactive_action.php\">\n    <input type=\"hidden\" name=\"id\" value=\"" . $team->id . "\">\n";
start_table();
echo "<tr>\n    <th>" . tra("Remove?") . "</th>\n    <th>" . tra("Name (ID)") . "</th>\n    <th>" . tra("Total credit") . "</th>\n    <th>" . tra("Recent average credit") . "</th>\n    </tr>\n";
$users = BoincUser::enum("teamid={$team->id}");
$ninactive_users = 0;
foreach ($users as $user) {
    if ($user->id == $logged_in_user->id) {
        continue;
    }
    if ($user->id == $team->userid) {
        continue;
    }
    $user_total_credit = format_credit($user->total_credit);
    $user_expavg_credit = format_credit($user->expavg_credit);
    echo "\n        <tr>\n        <td align=center><input type=checkbox name=remove_{$ninactive_users} value={$user->id}>\n        <td>" . user_links($user) . " ({$user->id})</td>\n        <td>{$user_total_credit}</td>\n        <td>{$user_expavg_credit}</td>\n        </tr>\n    ";
    $ninactive_users++;
}
end_table();
if ($ninactive_users == 0) {
    echo "<p>" . tra("No members are eligible for removal.") . "</p>";
} else {
    echo "<input type=hidden name=ninactive_users value={$ninactive_users}>";
    echo "<input type=submit value=\"" . tra("Remove users") . "\">";
}
echo "</form>";
page_tail();
Ejemplo n.º 8
0
$plain = get_int("plain", true);
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
    error_page(tra("no such team"));
}
require_founder_login($user, $team);
if ($plain) {
    header("Content-type: text/plain");
} else {
    page_head(tra("%1 Email List", $team->name));
    start_table();
    table_header(array(tra("Member list of %1", $team->name), "colspan=\"6\""));
    table_header(tra("Name"), tra("Email address"), tra("Total credit"), tra("Recent average credit"), tra("Country"));
}
$users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid={$team->id}");
foreach ($users as $user) {
    if ($plain) {
        $e = $user->send_email ? "<{$user->email_addr}>" : "";
        echo "{$user->name} {$e}\n";
    } else {
        $e = $user->send_email ? "{$user->email_addr}" : "";
        table_row(user_links($user, BADGE_HEIGHT_MEDIUM), $e, format_credit($user->total_credit), format_credit($user->expavg_credit), $user->country);
    }
}
if (!$plain) {
    end_table();
    echo "<p><a href=\"team_email_list.php?teamid=" . $teamid . "&amp;plain=1\">" . tra("Show as plain text") . "</a></p>";
    page_tail();
}
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
        $team = BoincTeam::lookup_id($user->teamid);
        $now = time();
        if ($user->id == $team->ping_user && transfer_ok($team, $now)) {
            page_head(tra("Assumed foundership of %1", $team->name));
            $team->update("userid={$user->id}, ping_user=0, ping_time=0");
            echo tra("Congratulations, you are now the founder of team %1. Go to %2Your Account page%3 to find the Team Admin options.", $team->name, "<a href=\"" . URL_BASE . "home.php\">", "</a>");
        } else {
            error_page(tra("Foundership request not allowed now"));
        }
        break;
    case "decline":
        $teamid = post_int("teamid");
        $team = BoincTeam::lookup_id($teamid);
        require_founder_login($user, $team);
        page_head(tra("Decline founder change request"));
        if ($team->ping_user) {
            $ping_user = BoincUser::lookup_id($team->ping_user);
            $team->update("ping_user=0");
            send_founder_transfer_decline_email($team, $ping_user);
            echo "<p>" . tra("The foundership request from %1 has been declined.", user_links($ping_user)) . "</p>";
        } else {
            echo "<p>" . tra("There were no foundership requests.") . "</p>";
        }
        break;
    default:
        error_page(tra("undefined action %1", $action));
}
echo "<a href='team_display.php?teamid={$team->id}'>" . tra("Return to team page") . "</a>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
Ejemplo n.º 10
0
function handle_query($user)
{
    $target_userid = get_int('target_userid', true);
    if ($target_user && $target_userid != $user->id) {
        $target_user = BoincUser::lookup_id($target_userid);
        page_head(tra("Please log in as %1", $target_user->name));
        echo tra("You must log in as %1 to view this friend request", $target_user->name);
        page_tail();
        exit;
    }
    $srcid = get_int('userid');
    $srcuser = BoincUser::lookup_id($srcid);
    if (!$srcuser) {
        error_page("No such user");
    }
    $friend = BoincFriend::lookup($srcid, $user->id);
    if (!$friend) {
        error_page("Request not found");
    }
    page_head(tra("Friend request"));
    echo time_str($friend->create_time) . "<p>\n";
    $x = user_links($srcuser, true);
    echo tra("%1 has requested friendship with you.", $x);
    if (strlen($friend->message)) {
        echo "<p>" . tra("%1 says: %2", $srcuser->name, $friend->message) . "</p>";
    }
    echo "<p>";
    show_button("friend.php?action=accept&userid=" . $srcid, tra("Accept friendship"), tra("Click accept if %1 is in fact a friend", $srcuser->name));
    show_button("friend.php?action=ignore&userid=" . $srcid, tra("Decline"), tra("Click decline if %1 is not a friend", $srcuser->name));
    echo "    <p>\n    ";
    page_tail();
}
Ejemplo n.º 11
0
if ($option) {
    select_profile($option);
    exit;
}
page_head(tra("Profiles"));
echo "\n    <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n    <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
    $user = BoincUser::lookup_id($profile->userid);
    echo uotd_thumbnail($profile, $user);
    echo user_links($user) . "<br>";
    $resp = output_transform($profile->response1);
    $resp = sanitize_tags($resp);
    echo sub_sentence($resp, ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n    <ul>\n    <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . URL_BASE . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . URL_BASE . "user_profile/profile_country.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>", "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
    echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
    include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n    <form action=\"profile_search_action.php\" method=\"GET\">\n    <input type=\"text\" name=\"search_string\">\n    <input type=\"submit\" value=\"" . tra("Search") . "\">\n    </form>\n");
end_table();
    $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
    row1(tra("Message display"));
    row2(tra("What to display"), "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> " . tra("Hide avatar images") . "<br>\n    <input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> " . tra("Hide signatures") . "<br>\n    <input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> " . tra("Show images as links") . "<br>\n    <input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> " . tra("Open links in new window/tab") . "<br>\n    <input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> " . tra("Highlight special users") . "<br>\n    <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> " . tra("Display this many messages per page") . "<br />\n    ");
    row2(tra("How to sort"), tra("Threads:") . " " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>" . tra("Posts:") . " " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\n    <input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> " . tra("Jump to first new post in thread automatically") . "<br>\n    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">" . tra("Don't move sticky posts to top") . "<br>\n    ");
}
// DISABLE_FORUMS
// ------------ Message filtering  -----------
row1(tra("Message filtering"));
$filtered_userlist = get_ignored_list($user);
$forum_filtered_userlist = "";
for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
    $id = (int) $filtered_userlist[$i];
    if ($id) {
        $filtered_user = BoincUser::lookup_id($id);
        if (!$filtered_user) {
            echo "Missing user {$id}";
            continue;
        }
        $forum_filtered_userlist .= "<input class=\"btn btn-default\" type=\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"" . tra("Remove") . "\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>";
    }
}
row2(tra("Filtered users") . "<br><p class=\"text-muted\">" . tra("Ignore message board posts and private messages from these users.") . "</p>", "{$forum_filtered_userlist}\n        <input type=\"text\" name=\"forum_filter_user\" size=12> " . tra("User ID (For instance: 123456789)") . "\n        <br><input class=\"btn btn-default\" type=\"submit\" name=\"add_user_to_filter\" value=\"" . tra("Add user to filter") . "\">\n    ");
row1(tra("Update"));
row2(tra("Click here to update preferences"), "<input class=\"btn btn-primary\" type=submit value=\"" . tra("Update") . "\">");
echo "</form>\n";
row1(tra("Reset"));
row2(tra("Or click here to reset preferences to the defaults"), "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input class=\"btn btn-warning\" type=\"submit\" value=\"" . tra("Reset") . "\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>");
end_table();
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
Ejemplo n.º 13
0
    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>";
        }
    }
}
echo "<p><a href=\"team_display.php?teamid=" . $team->id . "\">" . tra("Return to team page") . "</a>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
Ejemplo n.º 14
0
function show_user_row($user, $i)
{
    $j = $i % 2;
    echo "\n        <tr class=row{$j}>\n        <td>{$i}</td>\n        <td>", user_links($user, BADGE_HEIGHT_MEDIUM), "</td>\n        <td align=right>", format_credit_large($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}
Ejemplo n.º 15
0
if ($option) {
    select_profile($option);
    exit;
}
page_head(tra("Profiles"));
echo "\n    <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n    <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
    $user = BoincUser::lookup_id($profile->userid);
    echo uotd_thumbnail($profile, $user);
    echo user_links($user, BADGE_HEIGHT_MEDIUM) . "<br>";
    $resp = output_transform($profile->response1);
    $resp = sanitize_tags($resp);
    echo sub_sentence($resp, ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n    <ul>\n    <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>", "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
    echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
    include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n    <form action=\"profile_search_action.php\" method=\"GET\">\n    <input type=\"text\" name=\"search_string\">\n    <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Search") . "\">\n    </form>\n");
end_table();
}
$forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
$forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
row1("Message display");
row2("What to display", "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> Hide avatar images<br>\r\n\t<input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> Hide signatures<br>\r\n\t<input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> Show images as links<br>\r\n\t<input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> Open links in new window/tab<br>\r\n\t<input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> Highlight special users<br>\r\n\t");
row2("How to sort", "Threads: " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>Posts: " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\r\n\t<input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> Jump to first new post in thread automatically<br>\r\n\t<input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">Do not reorder sticky posts<br>\r\n\t<input type=\"text\" name=\"forum_minimum_wrap_postcount\" size=3 value=\"" . $forum_minimum_wrap_postcount . "\"> If a thread contains more than this number of posts<br />\r\n\t<input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> only display the first one and this many of the last ones<br />\r\n\t");
// ------------ Message filtering  -----------
row1("Message filtering");
$filtered_userlist = get_ignored_list($user);
$forum_filtered_userlist = "";
for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
    $id = (int) $filtered_userlist[$i];
    if ($id) {
        $filtered_user = BoincUser::lookup_id($id);
        if (!$filtered_user) {
            echo "Missing user {$id}";
            continue;
        }
        $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"Remove\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>";
    }
}
row2("Filtered users" . "<br><span class=note>Ignore message board posts and private messages from these users.</span>", "{$forum_filtered_userlist}\r\n\t<br>\r\n\t\t<input type=\"text\" name=\"forum_filter_user\" size=12> User ID (For instance: 123456789)\r\n\t\t<br><input type=\"submit\" name=\"add_user_to_filter\" value=\"Add user to filter\">\r\n\t");
row1("Update");
row2("Click here to update message board preferences", "<input type=submit value=\"Update\">");
echo "</form>\n";
row1("Reset");
row2("Or click here to reset preferences to the defaults", "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input type=\"submit\" value=\"Reset\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>");
end_table();
page_tail();
$cvs_version_tracker[] = "\$Id: edit_forum_preferences_form.php 17418 2009-03-01 23:32:15Z davea \$";
//Generated automatically - do not edit
Ejemplo n.º 17
0
function show_forum($forum, $start, $sort_style, $user)
{
    $page_nav = page_links("forum_forum.php?id={$forum->id}&amp;sort={$sort_style}", $forum->threads, THREADS_PER_PAGE, $start);
    echo $page_nav;
    start_forum_table(array("", tra("Threads"), tra("Posts"), tra("Author"), tra("Views"), "<nobr>" . tra("Last post") . "</nobr>"));
    $sticky_first = !$user || !$user->prefs->ignore_sticky_posts;
    // Show hidden threads if logged in user is a moderator
    //
    $show_hidden = is_moderator($user, $forum);
    $threads = get_forum_threads($forum->id, $start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first);
    if ($user) {
        $subs = BoincSubscription::enum("userid={$user->id}");
    }
    // Run through the list of threads, displaying each of them
    //
    $n = 0;
    $i = 0;
    foreach ($threads as $thread) {
        $owner = BoincUser::lookup_id($thread->owner);
        if (!$owner) {
            continue;
        }
        $unread = thread_is_unread($user, $thread);
        //if ($thread->status==1){
        // This is an answered helpdesk thread
        if ($user && is_subscribed($thread, $subs)) {
            echo '<tr class="row_hd' . $n . '">';
        } else {
            // Just a standard thread.
            echo '<tr class="row' . $n . '">';
        }
        echo "<td width=\"1%\" class=\"threadicon\"><nobr>";
        if ($thread->hidden) {
            show_image(IMAGE_HIDDEN, tra("This thread is hidden"), tra("hidden"));
        } else {
            if ($unread) {
                if ($thread->sticky) {
                    if ($thread->locked) {
                        show_image(NEW_IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked, and you haven't read it yet"), tra("sticky/locked/unread"));
                    } else {
                        show_image(NEW_IMAGE_STICKY, tra("This thread is sticky and you haven't read it yet"), tra("sticky/unread"));
                    }
                } else {
                    if ($thread->locked) {
                        show_image(NEW_IMAGE_LOCKED, tra("You haven't read this thread yet, and it's locked"), tra("unread/locked"));
                    } else {
                        show_image(NEW_IMAGE, tra("You haven't read this thread yet"), tra("unread"));
                    }
                }
            } else {
                if ($thread->sticky) {
                    if ($thread->locked) {
                        show_image(IMAGE_STICKY_LOCKED, tra("This thread is sticky and locked"), tra("sticky/locked"));
                    } else {
                        show_image(IMAGE_STICKY, tra("This thread is sticky"), tra("sticky"));
                    }
                } else {
                    if ($thread->locked) {
                        show_image(IMAGE_LOCKED, tra("This thread is locked"), tra("locked"));
                    } else {
                        show_image(IMAGE_POST, tra("You read this thread"), tra("read"));
                    }
                }
            }
        }
        echo "</nobr></td>";
        $title = cleanup_title($thread->title);
        //$titlelength = 9999;
        //if (strlen($title) > $titlelength) {
        //    $title = substr($title, 0, $titlelength)."...";
        //}
        echo "<td class=\"threadline\"><a href=\"forum_thread.php?id={$thread->id}\"><b>{$title}</b></a><br></td>";
        $n = ($n + 1) % 2;
        echo '
            <td class="numbers">' . ($thread->replies + 1) . '</td>
            <td>' . user_links($owner, BADGE_HEIGHT_SMALL) . '</td>
            <td class="numbers">' . $thread->views . '</td>
            <td class="lastpost">' . time_diff_str($thread->timestamp, time()) . '</td>
            </tr>
        ';
        flush();
    }
    end_table();
    echo "<br>{$page_nav}";
    // show page links
}
Ejemplo n.º 18
0
$plain = get_int("plain", true);
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
    error_page(tra("no such team"));
}
require_founder_login($user, $team);
if ($plain) {
    header("Content-type: text/plain");
} else {
    page_head(tra("%1 Email List", $team->name));
    start_table();
    table_header(array(tra("Member list of %1", $team->name), "colspan=\"6\""));
    table_header(tra("Name"), tra("Email address"), tra("Total credit"), tra("Recent average credit"), tra("Country"));
}
$users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid={$team->id}");
foreach ($users as $user) {
    if ($plain) {
        $e = $user->send_email ? "<{$user->email_addr}>" : "";
        echo "{$user->name} {$e}\n";
    } else {
        $e = $user->send_email ? "{$user->email_addr}" : "";
        table_row(user_links($user), $e, format_credit($user->total_credit), format_credit($user->expavg_credit), $user->country);
    }
}
if (!$plain) {
    end_table();
    echo "<p><a href=\"team_email_list.php?teamid=" . $teamid . "&amp;plain=1\">" . tra("Show as plain text") . "</a></p>";
    page_tail();
}
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
$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
        $user_total_credit = format_credit($user->total_credit);
Ejemplo n.º 20
0
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
    error_page("No such team");
}
require_founder_login($user, $team);
page_head("Change founder of {$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>Team member " . user_links($ping_user) . " requested this team's foundership on {$x}, but left the team, thus canceling the request.</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>Team member " . user_links($ping_user) . " has requested this team's foundership.\r\n\t\t\tThis may be because you left the team or haven't had contact with the team for a long time.</p>";
        echo '<p>
			<form method="post" action="team_founder_transfer_action.php">
			<input type="hidden" name="action" value="decline">
			<input type="hidden" name="teamid" value="' . $team->id . '">
			To decline the request, <input type="submit" value="click here">
			</form></p>
			<p>If you don\'t decline the request by $x, $ping_user->name will have the option of assuming team foundership.</p>
			<p>To accept the request, assign foundership to $ping_user->name using the form below.</p>
			<hr/>
			<p>
		';
    }
} else {
    echo "No transfer request is pending.</p><p>";
}
Ejemplo n.º 21
0
function show_user_row($user, $i)
{
    echo "\n        <tr class=row1>\n        <td>{$i}</td>\n        <td>", user_links($user), "</td>\n        <td align=right>", format_credit_large($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}
        $team = BoincTeam::lookup_id($user->teamid);
        $now = time();
        if ($user->id == $team->ping_user && transfer_ok($team, $now)) {
            page_head("Assumed foundership of " . $team->name);
            $team->update("userid={$user->id}, ping_user=0, ping_time=0");
            echo "\r\n\t\t\tCongratulations, you are now the founder of team " . $team->name . "\r\n\t\t\tGo to <a href=\"" . URL_BASE . "home.php\">Your Account page</a>\r\n\t\t\tto find the Team Admin options.\r\n\t\t";
        } else {
            error_page("Foundership request not allowed now");
        }
        break;
    case "decline":
        $teamid = post_int("teamid");
        $team = lookup_team($teamid);
        require_founder_login($user, $team);
        page_head("Decline founder change request");
        if ($team->ping_user) {
            $ping_user = BoincUser::lookup_id($team->ping_user);
            $team->update("ping_user=0");
            send_founder_transfer_decline_email($team, $ping_user);
            echo "<p>The foundership request from " . user_links($ping_user) . " has been declined.\r\n\t\t";
        } else {
            echo "<p>There were no foundership requests.";
        }
        break;
    default:
        error_page("undefined action {$action}");
}
echo "<a href='team_display.php?teamid={$team->id}'>Return to team page</a>";
page_tail();
$cvs_version_tracker[] = "\$Id: team_founder_transfer_action.php 16664 2008-12-09 22:41:29Z davea \$";
//Generated automatically - do not edit
Ejemplo n.º 23
0
function show_forum($forum, $start, $sort_style, $user)
{
    $gotoStr = "";
    $nav = show_page_nav($forum, $start);
    if ($nav) {
        $gotoStr = "<div align=\"right\">{$nav}</div><br />";
    }
    echo $gotoStr;
    // Display the navbar
    start_forum_table(array("", tra("Threads"), tra("Posts"), tra("Author"), tra("Views"), "<nobr>" . tra("Last post") . "</nobr>"));
    $sticky_first = !$user || !$user->prefs->ignore_sticky_posts;
    // Show hidden threads if logged in user is a moderator
    //
    $show_hidden = is_moderator($user, $forum);
    $threads = get_forum_threads($forum->id, $start, THREADS_PER_PAGE, $sort_style, $show_hidden, $sticky_first);
    if ($user) {
        $subs = BoincSubscription::enum("userid={$user->id}");
    }
    // Run through the list of threads, displaying each of them
    $n = 0;
    $i = 0;
    foreach ($threads as $thread) {
        $owner = BoincUser::lookup_id($thread->owner);
        $unread = thread_is_unread($user, $thread);
        //if ($thread->status==1){
        // This is an answered helpdesk thread
        if ($user && is_subscribed($thread, $subs)) {
            echo '<tr class="row_hd' . $n . '">';
        } else {
            echo '<tr class="row' . $n . '">';
        }
        echo '<td width="1%"><nobr>';
        if ($user && $thread->rating() > $user->prefs->high_rating_threshold) {
            show_image(EMPHASIZE_IMAGE, "This message has a high average rating", "Highly rated");
        }
        if ($user && $thread->rating() < $user->prefs->low_rating_threshold) {
            show_image(FILTER_IMAGE, "This message has a low average rating", "Low rated");
        }
        if ($thread->hidden) {
            echo "[hidden]";
        }
        if ($unread) {
            if ($thread->sticky) {
                if ($thread->locked) {
                    show_image(NEW_IMAGE_STICKY_LOCKED, "This thread is sticky and locked, and you haven't read it yet", "sticky/locked/unread");
                } else {
                    show_image(NEW_IMAGE_STICKY, "This thread is sticky and you haven't read it yet", "sticky/unread");
                }
            } else {
                if ($thread->locked) {
                    show_image(NEW_IMAGE_LOCKED, "You haven't read this thread yet, and it's locked", "unread/locked");
                } else {
                    show_image(NEW_IMAGE, "You haven't read this thread yet", "unread");
                }
            }
        } else {
            if ($thread->sticky) {
                if ($thread->locked) {
                    show_image(IMAGE_STICKY_LOCKED, "This thread is sticky and locked", "sticky/locked");
                } else {
                    show_image(IMAGE_STICKY, "This thread is sticky", "sticky");
                }
            } else {
                if ($thread->locked) {
                    show_image(IMAGE_LOCKED, "This thread is locked", "locked");
                }
            }
        }
        echo "</nobr></td>";
        $titlelength = 48;
        $title = $thread->title;
        if (strlen($title) > $titlelength) {
            $title = substr($title, 0, $titlelength) . "...";
        }
        $title = cleanup_title($title);
        echo '<td class="threadline">
			<a href="forum_thread.php?id=' . $thread->id . '"><strong>' . $title . '</strong></a>
			<br /></td>';
        $n = ($n + 1) % 2;
        echo '<td class="numbers leftborder">' . ($thread->replies + 1) . '</td>
			<td class="author leftborder">' . user_links($owner) . '</td>
			<td class="numbers leftborder">' . $thread->views . '</td>
			<td class="lastpost leftborder">' . time_diff_str($thread->timestamp, time()) . '</td>
			</tr>';
        flush();
    }
    end_table();
    echo "<br />{$gotoStr}";
    // show page links
}
Ejemplo n.º 24
0
function handle_query($user)
{
    $srcid = get_int('userid');
    $srcuser = BoincUser::lookup_id($srcid);
    if (!$srcuser) {
        error_page(tra("No such user"));
    }
    $friend = BoincFriend::lookup($srcid, $user->id);
    if (!$friend) {
        error_page(tra("Request not found"));
    }
    page_head(tra("Friend request"));
    $x = user_links($srcuser, true);
    echo tra("%1 has added you as a friend.", $x);
    if (strlen($friend->message)) {
        echo "<p>" . tra("%1 says: %2", $srcuser->name, $friend->message) . "</p>";
    }
    echo "\n\t\t<p><ul class=\"actionlist\">";
    show_actionlist_button("friend.php?action=accept&userid=" . $srcid, tra("Accept friendship"), tra("Click accept if %1 is in fact a friend", $srcuser->name));
    show_actionlist_button("friend.php?action=ignore&userid=" . $srcid, tra("Decline"), tra("Click decline if %1 is not a friend", $srcuser->name));
    echo "\t<p>\n\t";
    page_tail();
}
function show_profile_link2($profile, $n)
{
    $user = BoincUser::lookup_id($profile->userid);
    echo "<tr><td>" . user_links($user) . "</td><td>" . date_str($user->create_time) . "</td><td>{$user->country}</td><td>" . (int) $user->total_credit . "</td><td>" . (int) $user->expavg_credit . "</td></tr>\n";
}
Ejemplo n.º 26
0
    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";
        }
    }
}
echo "<p><a href=\"team_display.php?teamid=" . $team->id . "\">Return to team page</a>";
page_tail();
$cvs_version_tracker[] = "\$Id: team_founder_transfer_form.php 15992 2008-09-12 20:23:41Z boincadm \$";
//Generated automatically - do not edit