Example #1
0
//
// 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/>.
// create, manage, or read a team message board
require_once "../inc/util.inc";
require_once "../inc/team.inc";
require_once "../inc/forum_db.inc";
if (DISABLE_TEAMS) {
    error_page("Teams are disabled");
}
check_get_args(array("tnow", "ttok", "teamid", "cmd"));
function create_confirm($user, $team)
{
    page_head(tra("Create Message Board"));
    echo tra("You may create a message board for use by %1.", $team->name) . "\n        <ul>\n        <li>" . tra("Only team members will be able to post.") . "\n        <li>" . tra("At your option, only members will be able to read.") . "\n        <li>" . tra("You and your Team Admins will have moderator privileges.") . "\n        </ul>\n    ";
    $tokens = url_tokens($user->authenticator);
    show_button("team_forum.php?teamid={$team->id}&cmd=create{$tokens}", tra("Create Message Board"), tra("Create a message board for %1", $team->name));
    page_tail();
}
function create_forum($user, $team)
{
    $f = BoincForum::lookup("parent_type=1 and category={$team->id}");
    if ($f) {
        error_page(tra("Team already has a message board"));
    }
    $id = BoincForum::insert("(category, parent_type) values ({$team->id}, 1)");
Example #2
0
// 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/>.
include_once "../inc/util.inc";
include_once "../inc/prefs.inc";
include_once "../inc/prefs_project.inc";
check_get_args(array("subset", "venue", "confirmed", "cols", "tnow", "ttok"));
$user = get_logged_in_user();
check_tokens($user->authenticator);
$subset = get_str("subset");
$venue = get_str("venue");
$confirmed = get_str("confirmed", true);
$columns = get_int("cols", true);
$c = $columns ? "&cols={$columns}" : "";
if ($confirmed) {
    if ($subset == "global") {
        $main_prefs = prefs_parse_global($user->global_prefs);
        $main_prefs->{$venue} = null;
        global_prefs_update($user, $main_prefs);
    } else {
        $main_prefs = prefs_parse_project($user->project_prefs);
        $main_prefs->{$venue} = null;
Example #3
0
//
// 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/util.inc";
require_once "../inc/cert.inc";
check_get_args(array("border"));
$user = get_logged_in_user();
$team = BoincTeam::lookup_id($user->teamid);
if (!$team) {
    error_page("no team");
}
$join = gmdate('j F Y', $team->create_time);
$today = gmdate('j F Y', time(0));
credit_to_ops($team->total_credit, $ops, $unit);
$border = get_str("border", true);
if ($border == "no") {
    $border = 0;
} else {
    $border = 8;
}
$credit = credit_string($team->total_credit, false);
Example #4
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/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/team.inc";
if (DISABLE_TEAMS) {
    error_page("Teams are disabled");
}
check_get_args(array("format", "team_id", "team_ids", "team_name"));
$format = get_str("format", true);
$team_id = get_int("team_id", true);
$team_ids = get_str("team_ids", true);
BoincDb::get(true);
if ($team_id || $team_ids || $format == 'xml') {
    require_once '../inc/xml.inc';
    xml_header();
    $retval = db_init_xml();
    if ($retval) {
        xml_error($retval);
    }
}
if ($team_id) {
    $team = BoincTeam::lookup_id($team_id);
    if ($team) {
// 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/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/team.inc";
check_get_args(array("tnow", "ttok"));
$user = get_logged_in_user(true);
check_tokens($user->authenticator);
$teamid = post_int("teamid");
$team = BoincTeam::lookup_id($teamid);
require_team($team);
if (!$team->joinable) {
    error_page(tra("The team %1 is not joinable.", $team->name));
}
if ($user->teamid == $team->id) {
    page_head(tra("Already a member"));
    echo tra("You are already a member of %1.", $team->name);
} else {
    $success = user_join_team($team, $user);
    if ($success) {
        page_head(tra("Joined %1", $team->name));
Example #6
0
// 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/util.inc";
check_get_args(array("field"));
$field = get_str("field");
switch ($field) {
    case "result_server_state":
        page_head(tra("Server states"));
        echo "\n        <p>\n        " . tra("A tasks's <b>server state</b> indicates whether the task has been sent to a computer, and if so whether the computer has finished it. Possible values are:") . "\n        <p>\n    ";
        start_table();
        row2_plain("<b>" . tra("Inactive") . "</b>", tra("The task is not ready to send (for example, because its input files are unavailable)"));
        row2_plain("<b>" . tra("Unsent") . "</b>", tra("The task is ready to send, but hasn't been sent yet."));
        row2_plain("<b>" . tra("In Progress") . "</b>", tra("The task has been sent; waiting for completion."));
        row2_plain("<b>" . tra("Over") . "</b>", tra("The task has been sent to a computer and either it has timed out or the computer has reported its completion."));
        break;
    case "result_outcome":
        page_head(tra("Outcomes"));
        echo "\n        <p>\n        " . tra("A tasks's <b>outcome</b> is defined if its server state is <b>over</b>. Possible values are:") . "\n        <p>\n    ";
        start_table();
Example #7
0
// 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/db.inc";
require_once "../inc/util.inc";
require_once "../inc/account.inc";
check_get_args(array("next_url"));
$next_url = sanitize_local_url(get_str('next_url', true));
$next_url = urldecode($next_url);
$u = "login_form.php?next_url=" . $next_url;
redirect_to_secure_url($u);
$user = get_logged_in_user(false);
if ($user) {
    page_head("Already logged in");
    row2("You are logged in as {$user->name}", ".  <a href=\"logout.php?" . url_tokens($user->authenticator) . "\">Log out</a>");
    page_tail();
    exit;
}
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>
Example #8
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/boinc_db.inc';
require_once '../inc/util.inc';
require_once '../inc/account.inc';
require_once '../inc/countries.inc';
require_once '../inc/translation.inc';
require_once '../inc/recaptchalib.php';
check_get_args(array("next_url", "teamid"));
$next_url = sanitize_local_url(get_str('next_url', true));
redirect_to_secure_url("create_account_form.php?next_url={$next_url}");
$config = get_config();
if (parse_bool($config, "disable_account_creation")) {
    error_page("This project is not accepting new accounts");
}
if (parse_bool($config, "no_web_account_creation")) {
    error_page("This project has disabled Web account creation");
}
page_head(tra("Create an account"), null, null, null, recaptcha_get_head_extra());
if (!no_computing()) {
    echo "<p>\n        <b>" . tra("NOTE: If you use the BOINC Manager, don't use this form. Just run BOINC, select Add Project, and enter an email address and password.") . "</b></p>\n    ";
}
$teamid = get_int("teamid", true);
if ($teamid) {
// 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/profile.inc";
require_once "../inc/uotd.inc";
if (DISABLE_PROFILES) {
    error_page("Profiles are disabled");
}
check_get_args(array("cmd", "pic"));
$option = get_str('cmd', true);
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);
Example #10
0
// 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/>.
// Forum index
// shows the categories and the forums in each category
require_once '../inc/forum.inc';
require_once '../inc/pm.inc';
require_once '../inc/time.inc';
check_get_args(array("read", "return", "tnow", "ttok"));
$user = get_logged_in_user(false);
// Process request to mark all posts as read
//
if (get_int("read", true) == 1) {
    if ($user) {
        check_tokens($user->authenticator);
        BoincForumPrefs::lookup($user);
        $now = time();
        $user->prefs->update("mark_as_read_timestamp={$now}");
        Header("Location: " . get_str("return", true));
    }
}
function show_forum_summary($forum, $i)
{
    switch ($forum->parent_type) {
Example #11
0
//
// 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/boinc_db.inc";
require_once "../inc/xml.inc";
xml_header();
$retval = db_init_xml();
if ($retval) {
    xml_error($retval);
}
check_get_args(array("account_key"));
$auth = get_str("account_key");
$user = BoincUser::lookup_auth($auth);
if (!$user) {
    xml_error(ERR_DB_NOT_FOUND);
}
$name = urlencode($user->name);
$country = urlencode($user->country);
$postal_code = urlencode($user->postal_code);
$url = urlencode($user->url);
$weak_auth = weak_auth($user);
$cpid = md5($user->cross_project_id . $user->email_addr);
$ret = "<id>{$user->id}</id>\n<name>{$name}</name>\n<country>{$country}</country>\n<weak_auth>{$weak_auth}</weak_auth>\n<postal_code>{$postal_code}</postal_code>\n<cpid>{$cpid}</cpid>\n<has_profile>{$user->has_profile}</has_profile>\n<create_time>{$user->create_time}</create_time>\n<global_prefs>\n{$user->global_prefs}\n</global_prefs>\n<project_prefs>\n{$user->project_prefs}\n</project_prefs>\n<url>{$url}</url>\n<send_email>{$user->send_email}</send_email>\n<show_hosts>{$user->show_hosts}</show_hosts>\n<teamid>{$user->teamid}</teamid>\n<venue>{$user->venue}</venue>";
if ($user->teamid) {
    $team = BoincTeam::lookup_id_nocache($user->teamid);
    if ($team->userid == $user->id) {
// 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";
require_once "../inc/team.inc";
if (DISABLE_TEAMS) {
    error_page("Teams are disabled");
}
check_get_args(array("id"));
$user = get_logged_in_user();
$teamid = get_int("id");
$team = BoincTeam::lookup_id($teamid);
if (!$team->joinable) {
    error_page(tra("The team %1 is not joinable.", $team->name));
}
$team_name = $team->name;
page_head(tra("Join %1", $team_name));
echo " <p><b>" . tra("Please note:") . "</b>\n    <ul>\n    <li>" . tra("Joining a team gives its founder access to your email address.") . "\n    <li>" . tra("Joining a team does not affect your account's credit.") . "\n    </ul>\n    <hr>\n    <form method=\"post\" action=\"team_join_action.php\">";
echo form_tokens($user->authenticator);
echo "\n    <input type=\"hidden\" name=\"teamid\" value=\"{$teamid}\">\n    <input type=\"submit\" value=\"" . tra("Join team") . "\">\n    </form>\n";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
Example #13
0
// 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/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/prefs.inc";
check_get_args(array("hostid", "venue"));
$user = get_logged_in_user();
$venue = get_str("venue");
check_venue($venue);
$hostid = get_int("hostid");
$host = BoincHost::lookup_id($hostid);
if (!$host) {
    error_page("No such host");
}
if ($host->userid != $user->id) {
    error_page("Not your host");
}
$retval = $host->update("venue='{$venue}'");
if ($retval) {
    page_head(tra("Host venue updated"));
    if ($venue == '') {
Example #14
0
// 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/>.
// This file allows you to create a new thread in a forum
// At first it displays an input box and when you submit
// it will apply the changes by calling methods on the forum
require_once '../inc/forum_email.inc';
require_once '../inc/forum.inc';
require_once '../inc/bbcode_html.inc';
require_once '../inc/akismet.inc';
require_once '../inc/news.inc';
check_get_args(array("id", "title", "force_title", "tnow", "ttok", "export"));
$logged_in_user = get_logged_in_user();
BoincForumPrefs::lookup($logged_in_user);
check_banished($logged_in_user);
$forumid = get_int("id");
$forum = BoincForum::lookup_id($forumid);
if (DISABLE_FORUMS && !is_admin($logged_in_user)) {
    error_page("Forums are disabled");
}
if (!user_can_create_thread($logged_in_user, $forum)) {
    error_page(tra("Only project admins may create a thread here. However, you may reply to existing threads."));
}
check_post_access($logged_in_user, $forum);
$title = post_str("title", true);
if (!$title) {
    $title = get_str("title", true);
// 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/forum.inc";
require_once "../inc/forum_email.inc";
if (DISABLE_FORUMS) {
    error_page("Forums are disabled");
}
check_get_args(array("id", "action", "tnow", "ttok"));
function mod_comment()
{
    $x = "";
    $reason = post_str('reason', true);
    if ($reason) {
        $x .= "\nModerator comment: {$reason}\n";
    }
    return $x;
}
function hide_explanation()
{
    switch (post_int("category", true)) {
        case 1:
            $c = "Obscene";
            break;
Example #16
0
// 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/util.inc";
require_once "../inc/user.inc";
require_once "../inc/boinc_db.inc";
check_get_args(array("code", "userid"));
$code = get_str("code");
$userid = get_int('userid');
$user = BoincUser::lookup_id($userid);
if (!$user) {
    error_page("no such user");
}
if (salted_key($user->authenticator) != $code) {
    error_page("invalid code");
}
$result = $user->update("send_email=0");
if ($result) {
    page_head("Removed from mailing list");
    echo "\n        No further emails will be sent to {$user->email_addr}.\n        <p>\n        To resume getting emails,\n        <a href=" . url_base() . "prefs_edit.php?subset=project>edit your project preferences</a>.\n    ";
    page_tail();
}
Example #17
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/cache.inc";
require_once "../inc/util.inc";
require_once "../inc/user.inc";
require_once "../inc/boinc_db.inc";
check_get_args(array("sort_by", "offset"));
$config = get_config();
$users_per_page = parse_config($config, "<users_per_page>");
if (!$users_per_page) {
    $users_per_page = 20;
}
define('ITEM_LIMIT', 10000);
function get_top_participants($offset, $sort_by)
{
    global $users_per_page;
    $db = BoincDb::get(true);
    if ($sort_by == "total_credit") {
        $sort_order = "total_credit desc";
    } else {
        $sort_order = "expavg_credit desc";
    }
Example #18
0
//
// You should edit the following variables in config.xml to suit your needs:
//
// <www_host>    hostname of web server (default: same as <host>)
// <sched_host>  hostname of scheduling server (default: same as <host>)
// <uldl_host>   hostname of upload/download server (default: same as <host>)
// <uldl_pid>    pid file of upload/download server httpd.conf
//               (default: /etc/httpd/run/httpd.pid)
// <ssh_exe>     path to ssh (default: /usr/bin/ssh)
// <ps_exe>      path to ps (which supports "w" flag) (default: /bin/ps)
///////////////////////////////////////////////////////////////////////////////
require_once "../inc/util.inc";
require_once "../inc/xml.inc";
require_once "../inc/cache.inc";
require_once "../inc/translation.inc";
check_get_args(array("xml"));
$xml = get_int("xml", true);
// daemon status outputs: 1 (running) 0 (not running) or -1 (disabled)
//
function daemon_status($host, $pidname, $progname, $disabled)
{
    global $ssh_exe, $ps_exe, $project_host, $project_dir;
    if ($disabled == 1) {
        return -1;
    }
    $path = "{$project_dir}/pid_{$host}/{$pidname}";
    if ($host != $project_host) {
        $command = "{$ssh_exe} {$host} {$project_dir}/bin/pshelper {$path}";
        $foo = exec($command);
        $running = 1;
        if ($foo) {
Example #19
0
//
// 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/>.
// This file allows people to subscribe to threads.
// Whenever someone posts to the thread
// the subscribers will receive a notification email
require_once '../inc/forum.inc';
if (DISABLE_FORUMS) {
    error_page("Forums are disabled");
}
check_get_args(array("action", "thread", "tnow", "ttok"));
$action = get_str('action');
$threadid = get_int('thread');
$thread = BoincThread::lookup_id($threadid);
$forum = BoincForum::lookup_id($thread->forum);
function show_title($forum, $thread)
{
    switch ($forum->parent_type) {
        case 0:
            $category = BoincCategory::lookup_id($forum->category);
            show_forum_title($category, $forum, $thread);
            break;
        case 1:
            show_team_forum_title($forum, $thread);
            break;
    }
Example #20
0
// 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/boinc_db.inc";
require_once "../inc/email.inc";
require_once "../inc/pm.inc";
require_once "../inc/forum.inc";
require_once "../inc/akismet.inc";
check_get_args(array("replyto", "deleted", "userid", "action", "sent", "id", "tnow", "ttok"));
$replyto = get_int("replyto", true);
$userid = get_int("userid", true);
function show_block_link($userid)
{
    echo " <a href=\"pm.php?action=block&amp;id={$userid}\">";
    show_image(REPORT_POST_IMAGE, tra("Block messages from this user"), tra("Block user"), REPORT_POST_IMAGE_HEIGHT);
    echo "</a>";
}
$action = sanitize_tags(get_str("action", true));
if (!$action) {
    $action = sanitize_tags(post_str("action", true));
}
if (!$action) {
    $action = "inbox";
}
// 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/boinc_db.inc";
require_once "../inc/util.inc";
if (DISABLE_PROFILES) {
    error_page("Profiles are disabled");
}
check_get_args(array("search_string", "offset"));
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";
}
$search_string = get_str('search_string');
$search_string = sanitize_tags($search_string);
$search_string = BoincDb::escape_string($search_string);
$offset = get_int('offset', true);
if (!$offset) {
    $offset = 0;
}
$count = 10;
page_head(tra("Profiles containing '%1'", $search_string));
$profiles = BoincProfile::enum("match(response1, response2) against ('{$search_string}') limit {$offset},{$count}");
Example #22
0
// 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/>.
// validate a user's credentials, and log them in by sending a cookie.
// This handles several cases:
//
// 1) login via web form w/ email addr and password
// 2) login via web form w/ authenticator
// 3) login via a URL sent in email (e.g. to reset password)
require_once "../inc/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/email.inc";
require_once "../inc/user.inc";
require_once "../inc/ldap.inc";
check_get_args(array("id", "t", "h", "key"));
// login with email addr / passwd
//
function login_with_email($email_addr, $passwd, $next_url, $perm)
{
    $user = BoincUser::lookup_email_addr($email_addr);
    if (!$user) {
        page_head("No such account");
        echo "No account with email address <b>{$email_addr}</b> exists.\n            Please go back and try again.\n        ";
        page_tail();
        exit;
    }
    if (substr($user->authenticator, 0, 1) == 'x') {
        error_page("This account has been administratively disabled.");
    }
    // allow authenticator as password
// 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/>.
// Users are taken here after creating an account via the Wizard.
// They've already entered an email address and password.
// Now get a name, country, and zip code
require_once '../inc/boinc_db.inc';
require_once '../inc/util.inc';
require_once '../inc/countries.inc';
check_get_args(array("auth"));
$auth = get_str("auth");
$user = BoincUser::lookup_auth($auth);
if (!$user) {
    error_page("no such account");
}
page_head(tra("Finish account setup"));
echo "\n    <form action=account_finish_action.php method=post>\n";
start_table();
row2(tra("Name") . "<br><span class=\"description\">" . tra("Identifies you on our web site. Use your real name or a nickname.") . "</span>", "<input name=\"name\" size=\"30\" value=\"{$user->name}\">");
row2_init(tra("Country") . "<br><span class=\"description\">" . tra("Select the country you want to represent, if any.") . "</span>", "<select name=\"country\">");
print_country_select();
echo "</select></td></tr>\n";
row2(tra("Postal or ZIP Code") . "<br><span class=\"description\">" . tra("Optional") . "</span>", "<input name=\"postal_code\" size=\"20\">");
row2("", "<input type=\"submit\" value=\"OK\">");
end_table();
Example #24
0
// 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/profile.inc";
check_get_args(array("userid"));
$userid = get_int('userid');
$user = BoincUser::lookup_id($userid);
if (!$user) {
    error_page(tra("No such user"));
}
if (!$user->has_profile) {
    // check whether user.has_profile is out of synch w/ profile table
    //
    $profile = BoincProfile::lookup("userid={$user->id}");
    if ($profile) {
        $user->update("has_profile=1");
        $user->has_profile = 1;
    } else {
        error_page(tra("This user has no profile"));
    }
Example #25
0
<?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/util.inc";
check_get_args(array("st"));
$st = get_str("st", true);
page_head(tra("PayPal - Transaction Completed"));
if ($st == "Completed") {
    echo "<div>" . tra("Thank you for donating!") . "<br>\n";
    echo tra("Your donation for has been completed.") . "<br>\n";
    echo tra("Your donation will be added to the progress bar after confirmation by PayPal.") . "</div>";
} else {
    echo "<strong>" . tra("You have canceled your donation.") . "</strong>";
}
page_tail();
Example #26
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/>.
// show the results of ops/analyze_coproc_log.php
// DEPRECATED
require_once "../inc/util.inc";
require_once "../inc/boinc_db.inc";
check_get_args(array("mode"));
function filename($mode)
{
    switch ($mode) {
        case 'host':
            return "cuda_hosts.dat";
        case 'user':
            return "cuda_users.dat";
        case 'team':
            return "cuda_teams.dat";
        case 'model':
            return "cuda_models.dat";
        case 'day':
            return "cuda_days.dat";
    }
}
// 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/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/team.inc";
check_get_args(array());
$user = get_logged_in_user();
$name = post_str("name", true);
if (strlen($name) == 0) {
    error_page(tra("You must choose a non-blank team name"));
}
$new_team = lookup_team_name($name);
if ($new_team) {
    error_page(tra("A team named %1 already exists - try another name", htmlentities($name)));
}
$url = post_str("url", true);
$type = post_str("type", true);
$name_html = post_str("name_html", true);
$description = post_str("description", true);
$country = post_str("country", true);
if ($country == "") {
Example #28
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/>.
// Show results with pending credit for a user
require_once "../inc/util.inc";
require_once "../inc/boinc_db.inc";
require_once "../inc/xml.inc";
check_get_args(array("format", "authenticator"));
BoincDb::get(true);
$config = get_config();
if (!parse_bool($config, "show_results")) {
    error_page("This feature is turned off temporarily");
}
$format = get_str("format", true);
if ($format == "xml") {
    xml_header();
    $auth = BoincDb::escape_string(get_str('authenticator'));
    $user = BoincUser::lookup("authenticator='{$auth}'");
    if (!$user) {
        echo "<error>" . xml_error(-136) . "</error>\n";
        exit;
    }
    $sum = 0;
Example #29
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/cache.inc";
require_once "../inc/util.inc";
require_once "../inc/boinc_db.inc";
require_once "../inc/team.inc";
check_get_args(array("teamid"));
$teamid = get_int("teamid");
$team = BoincTeam::lookup_id($teamid);
$get_from_db = false;
$user = get_logged_in_user(false);
// always show fresh copy to admins; they might be editing info
//
if (is_team_admin($user, $team)) {
    $get_from_db = true;
}
if ($user->id == $team->ping_user) {
    $get_from_db = true;
}
// Cache the team record, its forum record, its new members,
// its admins, and its member counts
$cache_args = "teamid={$teamid}";
Example #30
0
// 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/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/team.inc";
check_get_args(array("tnow", "ttok", "userid", "email_addr", "teamid", "action"));
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    ";
}
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();