コード例 #1
0
ファイル: notices.php プロジェクト: CalvinZhu/boinc
function notices_rss_start()
{
    $t = gmdate('D, d M Y H:i:s', time()) . " GMT";
    header("Expires: {$t}");
    header("Last-Modified: {$t}");
    header("Content-Type: application/xml");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n        <rss version=\"2.0\">\n        <channel>\n        <title>" . PROJECT . " notices</title>\n        <link>" . secure_url_base() . "</link>\n        <description>Notices</description>\n        <lastBuildDate>{$t}</lastBuildDate>\n    ";
}
コード例 #2
0
ファイル: notify.php プロジェクト: CalvinZhu/boinc
function send_notify_email($userid, $message)
{
    $user = BoincUser::lookup_id($userid);
    $subject = "Daily notification summary from " . PROJECT;
    $body = "The following events occurred in the past day at " . PROJECT . ".\nFor details, visit your Account page at\n" . secure_url_base() . "home.php\n\n{$message}\n---------------\nTo change your email preferences for " . PROJECT . ", visit:\n" . secure_url_base() . "edit_forum_preferences_form.php\n\nDo not reply to this email.\n";
    send_email($user, $subject, $body);
    echo "sending to {$user->email_addr}\n";
}
コード例 #3
0
ファイル: mail_passwd.php プロジェクト: CalvinZhu/boinc
function email_sent_message($email_addr)
{
    if (defined('EMAIL_FROM')) {
        $email_from = EMAIL_FROM;
    } else {
        $email_from = secure_url_base();
    }
    page_head("Email sent");
    echo "\n        Instructions have been emailed to {$email_addr}.\n        <p>\n        If the email doesn't arrive in a few minutes,\n        your ISP may be blocking it as spam.\n        In this case please contact your ISP and\n        ask them to not block email from {$email_from}.\n    ";
}
コード例 #4
0
function send_founder_transfer_email($team, $user, $founder)
{
    // send founder a private message for good measure
    $subject = "Team founder transfer request";
    $body = "Team member " . $user->name . " has asked that you\ntransfer foundership of {$team->name}.\nPlease go [url=" . secure_url_base() . "team_change_founder_form.php?teamid={$team->id}]here[/url] to grant or decline the request.\n    \nIf you do not respond within 60 days, " . $user->name . " will\nbe allowed to become the team founder.\n";
    pm_send_msg($user, $founder, $subject, $body, false);
    $subject = PROJECT . " team founder transfer";
    $body = "Team member " . $user->name . " has asked that you\ntransfer foundership of {$team->name} in " . PROJECT . ".\nPlease visit\n" . secure_url_base() . "team_change_founder_form.php?teamid=" . $team->id . "\nto grant or decline the request.\n    \nIf you do not respond within 60 days, " . $user->name . " will\nbe allowed to become the team founder.\n    \nPlease do not respond to this email.\nThe mailbox is not monitored and the email\nwas sent using an automated system.";
    return send_email($founder, $subject, $body);
}
コード例 #5
0
    $destid = post_int('threadid');
    $new_thread = BoincThread::lookup_id($destid);
    if (!$new_thread) {
        error_page("No such thread");
    }
    $new_forum = BoincForum::lookup_id($new_thread->forum);
    if ($forum->parent_type != $new_forum->parent_type) {
        error_page(tra("Can't move to different category type"));
    }
    if ($forum->parent_type != 0) {
        if ($forum->category != $new_forum->category) {
            error_page(tra("Can't move to different category"));
        }
    }
    $result = move_post($post, $thread, $forum, $new_thread, $new_forum);
    $explanation = "Old thread: {$thread->title}\n" . secure_url_base() . "forum_thread.php?id={$thread->id}\nNew thread: {$new_thread->title}\n" . secure_url_base() . "forum_thread.php?id={$new_thread->id}&postid={$post->id}\n";
    $explanation .= mod_comment();
    $action_name = "moved to another thread";
} elseif ($action == "banish_user") {
    $auth = false;
    if (defined("MODERATORS_CAN_BANISH") && $user->prefs->privilege(S_MODERATOR)) {
        $auth = true;
    } else {
        if ($user->prefs->privilege(S_ADMIN)) {
            $auth = true;
        }
    }
    if (!$auth) {
        error_page(tra("Not authorized to banish users"));
    }
    $userid = post_int('userid');
コード例 #6
0
// 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/>.
require_once "../inc/util.inc";
check_get_args(array());
$user = get_logged_in_user(false);
page_head(tra("Change password"));
echo "\n    <form method=post action=" . secure_url_base() . "edit_passwd_action.php>\n";
if ($user) {
    echo "\n        <input type=hidden name=auth value={$user->authenticator}>\n    ";
    start_table();
} else {
    start_table();
    row1(tra("You can identify yourself using either") . "<ul>" . "<li>" . tra("your email address and old password") . "<li>" . tra("your account key") . "</ul>");
    row2(tra("Email address"), "<input name=email_addr size=40>");
    row2(tra("Current password"), "<input type=password name=old_passwd size=40>");
    row2(tra("<b>OR</b>: Account key") . "<br><font size=-2><a href=get_passwd.php>" . tra("Get account key by email") . "</a>", "<input name=auth size=40>");
}
row2(tra("New password"), "<input type=password name=passwd size=40>");
row2(tra("New password, again"), "<input type=password name=passwd2 size=40>");
row2("", "<input type=submit value='" . tra("Change password") . "'>");
end_table();
echo "</form>\n";
コード例 #7
0
            $xmlFragment .= "\n            </platform>";
        }
        $xmlFragment .= "\n    </platforms>\n";
        set_cached_data(3600, serialize($xmlFragment), "project_config_platform_xml");
    }
    echo $xmlFragment;
}
$config = get_config();
$long_name = parse_config($config, "<long_name>");
$min_passwd_length = parse_config($config, "<min_passwd_length>");
if (!$min_passwd_length) {
    $min_passwd_length = 6;
}
$disable_account_creation = parse_bool($config, "disable_account_creation");
$master_url = parse_config($config, "<master_url>");
echo "<project_config>\n    <name>{$long_name}</name>\n    <master_url>{$master_url}</master_url>\n    <web_rpc_url_base>" . secure_url_base() . "</web_rpc_url_base>\n";
$local_revision = @trim(file_get_contents("../../local.revision"));
if ($local_revision) {
    echo "<local_revision>{$local_revision}</local_revision>\n";
}
if (web_stopped()) {
    echo "\n        <error_num>" . ERR_PROJECT_DOWN . "</error_num>\n        <web_stopped>1</web_stopped>\n    ";
} else {
    echo "    <web_stopped>0</web_stopped>\n";
}
if ($disable_account_creation || defined('INVITE_CODES')) {
    echo "    <account_creation_disabled/>\n";
}
if (defined('INVITE_CODES')) {
    echo "    <invite_code_required/>\n";
}
コード例 #8
0
require_once "../inc/db.inc";
require_once "../inc/util.inc";
check_get_args(array("next_url"));
$next_url = sanitize_local_url(get_str('next_url', true));
$u = "login_form.php?next_url=" . urlencode($next_url);
redirect_to_secure_url($u);
$user = get_logged_in_user(false);
page_head(tra("Log in"));
if (0) {
    echo '
    <a href="openid_login.php?openid_identifier=https://www.google.com/accounts/o8/id"><img src=img/google-button.png></a>
    <a href="openid_login.php?openid_identifier=http://yahoo.com"><img src=img/yahoo-button.png></a>
    <br>
';
}
echo "\n    <form name=\"f\" method=\"post\" action=\"" . secure_url_base() . "/login_action.php\">\n    <input type=\"hidden\" name=\"next_url\" value=\"{$next_url}\">\n";
start_table();
row2(tra("Email address:") . '<br><span class="note"><a href="get_passwd.php">' . tra("forgot email address?") . "</a></span>", "<input name=email_addr type=\"text\" size=40 tabindex=1>");
row2(tra("Password:"******"note"><a href="get_passwd.php">' . tra("forgot password?") . "</a></span>", '<input type="password" name="passwd" size="40" tabindex="2">');
row2(tra("Stay logged in"), '<input type="checkbox" name="stay_logged_in" checked>');
$x = urlencode($next_url);
$config = get_config();
if (parse_bool($config, "disable_account_creation") || parse_bool($config, "no_web_account_creation")) {
    $create_acct = "";
} else {
    $create_acct = tra("or %1create an account%2.", "<a href=\"create_account_form.php?next_url={$x}\">", "</a>");
}
row2("", "<input type=\"submit\" name=\"mode\" value=\"" . tra("Log in") . "\" tabindex=\"3\"><br><br>" . $create_acct);
if ($user) {
    row1("Log out");
    row2("You are logged in as {$user->name}", "<a href=\"logout.php?" . url_tokens($user->authenticator) . "\">Log out</a>");
コード例 #9
0
ファイル: mass_email.php プロジェクト: CalvinZhu/boinc
            break;
        case 6:
            $userids = post_str('userids');
            $query = "select * from user where id in ({$userids})";
            break;
        default:
            // should never happen!
            exit_error("Got impossible value of receiver from selection!");
    }
    // FOR DEBUGGING
    //$query .= " LIMIT 10";
    $result = _mysql_query($query);
    while ($user = _mysql_fetch_object($result)) {
        // TODO: might want to also replace TOTAL_CREDIT, RAC, and similar.
        $body_to_send = str_replace("USERNAME", $user->name, $body);
        $body_to_send .= "\n\nTo opt out of future emails from " . PROJECT . ", please edit your project preferences at " . secure_url_base() . "prefs.php?subset=project\n";
        $retval = send_email($user, $subject, $body_to_send);
        if ($retval) {
            // send_email returns TRUE on success
            echo "Sent email to {$user->name} [{$user->id}] at {$user->email_addr} <br>";
        } else {
            echo "<font color=RED>send_email() to {$user->name} [{$user->id}] at {$user->email_addr} failed with error {$retval}</font><br>";
        }
        // try to get output on the screen for feedback.  May not help...
        flush();
    }
    exit;
}
echo "<form method=\"post\" action=\"mass_email.php\">\n";
echo "<p>\n";
start_table();
コード例 #10
0
ファイル: edit_email_form.php プロジェクト: CalvinZhu/boinc
// 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/>.
require_once "../inc/util.inc";
require_once "../inc/email.inc";
check_get_args(array());
redirect_to_secure_url("edit_email_form.php");
$user = get_logged_in_user();
page_head(tra("Change email address"));
$email_text = "";
if (is_valid_email_addr($user->email_addr)) {
    $email_text = $user->email_addr;
}
echo "<form method=post action=" . secure_url_base() . "/edit_email_action.php>\n";
start_table();
row1(tra("Change the email address of your account"));
row2(tra("New email address") . "<br><p class=\"text-muted\">" . tra("Must be a valid address of the form 'name@domain'") . "</p>", "<input name=email_addr size=50 type=text value='{$email_text}'>");
// we need the password here not for verification,
// but because we store it salted with email address,
// which is about to change.
row2(tra("Password") . "<br><a href=" . secure_url_base() . "/edit_passwd_form.php><p class=\"text-muted\">" . tra("No password?") . "</p></a>", "<input type=password name=passwd>");
row2("", "<input class=\"btn btn-default\" type=submit value='" . tra("Change email address") . "'>");
end_table();
echo "</form>\n";
page_tail();
コード例 #11
0
ファイル: notify_rss.php プロジェクト: CalvinZhu/boinc
require_once "../inc/pm.inc";
require_once "../inc/friend.inc";
require_once "../inc/notify.inc";
require_once "../project/project.inc";
$userid = get_int('userid');
$auth = get_str('auth');
$user = BoincUser::lookup_id($userid);
if (!$user) {
    xml_error();
}
if (notify_rss_auth($user) != $auth) {
    xml_error();
}
$notifies = BoincNotify::enum("userid = {$userid} order by create_time desc");
if (count($notifies)) {
    $last_mod_time = $notifies[0]->create_time;
} else {
    $last_mod_time = time();
}
$create_date = gmdate('D, d M Y H:i:s', $last_mod_time) . ' GMT';
header("Expires: " . gmdate('D, d M Y H:i:s', time()) . " GMT");
header("Last-Modified: " . $create_date);
header("Content-Type: application/xml");
$description = "Community notifications";
$channel_image = secure_url_base() . "rss_image.gif";
$language = "en-us";
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n    <rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n    <channel>\n    <title>" . PROJECT . "</title>\n    <link>" . secure_url_base() . "</link>\n    <atom:link href=\"" . secure_url_base() . "notify_rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n    <description>" . $description . "</description>\n    <copyright>" . COPYRIGHT_HOLDER . "</copyright>\n    <lastBuildDate>" . $create_date . "</lastBuildDate>\n    <language>" . $language . "</language>\n    <image>\n        <url>" . $channel_image . "</url>\n        <title>" . PROJECT . "</title>\n        <link>" . secure_url_base() . "</link>\n    </image>\n";
foreach ($notifies as $notify) {
    show_notify_rss_item($notify);
}
echo "\n    </channel>\n    </rss>\n";
コード例 #12
0
ファイル: uotd_gadget.php プロジェクト: ChristianBeer/boinc
<?php

// 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/>.
require_once "../inc/xml.inc";
require_once "../project/project.inc";
xml_header();
echo "\n<Module>\n  <ModulePrefs\n     title=\"" . PROJECT . " User of the Day\" \n     author=\"BOINC project\"\n     author_email=\"" . SYS_ADMIN_EMAIL . "\"\n     author_affiliation=\"" . COPYRIGHT_HOLDER . "\"\n     author_location=\"Unknown\"\n     description=\"Shows today's User of the Day for the BOINC-based distributed\n                   computing project " . PROJECT . "\"\n     height=\"100\"\n  /> \n  <Content type=\"url\" href=\"" . secure_url_base() . "user_profile/uotd_gadget.html\" /> \n</Module>\n";
コード例 #13
0
// 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/>.
require_once "../inc/util.inc";
require_once "../inc/email.inc";
check_get_args(array());
redirect_to_secure_url("edit_email_form.php");
$user = get_logged_in_user();
page_head(tra("Change email address"));
$email_text = "";
if (is_valid_email_addr($user->email_addr)) {
    $email_text = $user->email_addr;
}
echo "<form method=post action=" . secure_url_base() . "/edit_email_action.php>\n";
start_table();
row1(tra("Change the email address of your account"));
row2(tra("New email address") . "<br><span class=note>" . tra("Must be a valid address of the form 'name@domain'") . "</span>", "<input name=email_addr size=50 type=text value='{$email_text}'>");
// we need the password here not for verification,
// but because we store it salted with email address,
// which is about to change.
row2(tra("Password") . "<br><a href=" . secure_url_base() . "/edit_passwd_form.php><span class=note>" . tra("No password?") . "</span></a>", "<input type=password name=passwd>");
row2("", "<input type=submit value='" . tra("Change email address") . "'>");
end_table();
echo "</form>\n";
page_tail();
コード例 #14
0
function build_alpha_summary_page($characters_used)
{
    print_debug_msg("Beginning to build alphabetical summary pages...");
    global $alphabet;
    $filename = PROFILE_PATH . "profile_alpha.html";
    open_output_buffer();
    foreach ($alphabet as $character) {
        if (isset($characters_used[$character])) {
            echo "<a href=\"" . secure_url_base() . PROFILE_URL . "profile_{$character}_1.html\">{$character}</a>&nbsp;";
            unset($characters_used[$character]);
        } else {
            echo "{$character} ";
        }
    }
    // Link to the 'Other' page if necessary.
    if (!empty($characters_used)) {
        echo "<a href=\"" . secure_url_base() . PROFILE_URL . "profile_other_1.html\">Other</a>&nbsp;";
    }
    close_output_buffer($filename);
}