示例#1
0
function show_assigns()
{
    admin_page_head("Assignments");
    $asgns = BoincAssignment::enum();
    if (count($asgns)) {
        start_table();
        table_header("Assignment ID/time", "target", "workunit", "result");
        foreach ($asgns as $asgn) {
            show_assign($asgn);
        }
        end_table();
    } else {
        echo "No assignments";
    }
    admin_page_tail();
}
示例#2
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/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
// show summary of results that have been received or timed out recently
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Result summary");
show_result_summary();
admin_page_tail();
$cvs_version_tracker[] = "\$Id: result_summary.php 15758 2008-08-05 22:43:14Z davea \$";
//Generated automatically - do not edit
// (3) script is safe to run multiple times and on databases with no errors
//	 As supplied in cvs it is 'read only' and will only report problems
//	 the user database.  It won't correct them, until it is edited by hand
//	 to enable it to write changes to the database.
// (4) Just to be safe, back up your user database before running this script.
require_once "../inc/util_ops.inc";
require_once "../inc/db_ops.inc";
// activate/deactivate script
if (1) {
    echo "\r\nThis script needs to be activated before it can be run.\r\nOnce you understand what the script does you can change the\r\nif (1) to if (0) at the top of the file to activate it.\r\nBe sure to deactivate the script after using it to make sure\r\nit is not accidentally run.\r\n";
    exit;
}
db_init();
$confirm = $_GET['confirm'];
$update_needed = false;
admin_page_head("Repair emails and CPID=0");
echo "<br>\r\n\tScript for repairing user database if some email addresses in lower case and/or some CPID=0<br>\r\n\t<b>Attention this runs an expensive query on the database</b><br><br>\n";
$query = "select count(*) from user";
if (!($result = mysql_query($query))) {
    echo "No rows found in USER database table";
    exit;
}
$users_array = mysql_fetch_array($result);
mysql_free_result($result);
$number_of_users = $users_array[0];
echo "Found {$number_of_users} users<br/>";
$query = "select id, email_addr,cross_project_id  from user";
$result = mysql_query($query);
// loop over all users
while ($user = mysql_fetch_object($result)) {
    $id = $user->id;
// 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_ops.inc";
db_init();
admin_page_head("Failures grouped by app version and host");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$main_query = "\nSELECT\n       app_version_id,\n       app_version_num,\n       hostid AS Host_ID,\n       case\n           when INSTR(host.os_name, 'Darwin') then 'Darwin'\n           when INSTR(host.os_name, 'Linux') then 'Linux'\n           when INSTR(host.os_name, 'Windows') then 'Windows'\n           when INSTR(host.os_name, 'SunOS') then 'SunOS'\n           when INSTR(host.os_name, 'Solaris') then 'Solaris'\n           when INSTR(host.os_name, 'Mac') then 'Mac'\n           else 'Unknown'\n       end AS OS_Name,\n       case\n           when INSTR(host.os_name, 'Linux') then \n               case\n                   when INSTR(LEFT(host.os_version, 6), '-') then LEFT(host.os_version, (INSTR(LEFT(host.os_version, 6), '-') - 1))\n                   else LEFT(host.os_version, 6)\n               end\n           else host.os_version\n       end AS OS_Version,\n       host.nresults_today AS Results_Today, \n       COUNT(*) AS error_count\nFROM   result\n           left join host on result.hostid = host.id \nWHERE\n       appid = '{$query_appid}' and\n       server_state = '5' and\n       outcome = '3' and \n       received_time > '{$query_received_time}'\nGROUP BY\n       app_version_id,\n       hostid\norder by error_count desc\n";
$result = _mysql_query($main_query);
start_table();
table_header("App version", "Host ID", "OS Version", "Results today", "Error count");
while ($res = _mysql_fetch_object($result)) {
    table_row(app_version_desc($res->app_version_id), "<a href=" . URL_BASE . "show_host_detail.php?hostid={$res->Host_ID}>{$res->Host_ID}</a>", $res->OS_Version, $res->Results_Today, "<a href=db_action.php?table=result&detail=low&hostid={$res->Host_ID}&app_version_id={$res->app_version_id}&server_state=5&outcome=3>{$res->error_count}</a>");
}
_mysql_free_result($result);
end_table();
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例#5
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/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
require_once "../inc/db_ops.inc";
require_once "../inc/util_ops.inc";
require_once "../inc/uotd.inc";
require_once "../project/project.inc";
$config = get_config();
$cgi_url = parse_config($config, "<cgi_url>");
$stripchart_cgi_url = parse_config($config, "<stripchart_cgi_url>");
db_init();
$title = "Project Management";
admin_page_head($title);
// Notification area
echo "<ul>\n";
echo "<li>";
if (file_exists("../../local.revision")) {
    $local_rev = file_get_contents("../../local.revision");
}
if ($local_rev) {
    echo "Currently used SVN revision: " . $local_rev . "; ";
}
if (file_exists("../cache/remote.revision") && time() < filemtime("../cache/remote.revision") + 24 * 60 * 60) {
    $remote_rev = file_get_contents("../cache/remote.revision");
} else {
    // Get latest revision
    if (isset($project_http_proxy)) {
        $context = stream_context_create(array('http' => array('request_fulluri' => true, 'proxy' => $project_http_proxy)));
//
// 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/>.
// cancel a WU:
// - mark unsent results as OVER, outcome DIDNT_NEED
// - set CANCELLED bit in WU error mask
//
require_once "../inc/db.inc";
require_once "../inc/util_ops.inc";
db_init();
$wuid1 = get_int('wuid1');
$wuid2 = get_int('wuid2');
$unsent_only = get_str('unsent_only', true);
if ($wuid1 < 1 || $wuid2 < $wuid1) {
    error_page("<h2>Workunit IDs fail to satisfy the conditions:<p> 0 < ID1 <= ID2");
}
if ($unsent_only) {
    cancel_wus_if_unsent($wuid1, $wuid2);
} else {
    cancel_wus($wuid1, $wuid2);
}
admin_page_head("Cancel jobs");
echo " canceled jobs with {$wuid1} <= workunit ID <= {$wuid2}</h2>";
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
//
// 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_ops.inc";
db_init();
admin_page_head("Failure summary by (app version, error)");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$q = new SqlQueryString();
$q->process_form_items();
$main_query = "\nSELECT\n    app_version_id,\n    app_version.plan_class,\n    case\n        when INSTR(host.os_name, 'Darwin') then 'Darwin'\n        when INSTR(host.os_name, 'Linux') then 'Linux'\n        when INSTR(host.os_name, 'Windows') then 'Windows'\n        when INSTR(host.os_name, 'SunOS') then 'SunOS'\n        when INSTR(host.os_name, 'Solaris') then 'Solaris'\n        when INSTR(host.os_name, 'Mac') then 'Mac'\n        else 'Unknown'\n    end AS OS_Name,\n    exit_status,\n    COUNT(*) AS error_count\nFROM   result\n        left join host on result.hostid = host.id\n        left join app_version on result.app_version_id = app_version.id\nWHERE\n    result.appid = '{$query_appid}' and\n    server_state = '5' and\n    outcome = '3' and\n    received_time > '{$query_received_time}'\nGROUP BY\n    app_version_id,\n    exit_status\norder by error_count desc\n";
$urlquery = $q->urlquery;
$result = _mysql_query($main_query);
start_table();
table_header("App version", "Exit Status", "Error Count");
while ($res = _mysql_fetch_object($result)) {
    $exit_status_condition = "exit_status={$res->exit_status}";
    table_row(app_version_desc($res->app_version_id), link_results(exit_status_string($res->exit_status), $urlquery, "{$exit_status_condition}", ""), $res->error_count);
}
_mysql_free_result($result);
end_table();
// 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/forum.inc';
require_once '../inc/util_ops.inc';
db_init();
admin_page_head('Manage special users');
start_table("align=\"center\"");
row1("Current special users", '9');
echo "<tr><td>User</td>";
for ($i = 0; $i <= 6; $i++) {
    echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n";
}
echo "</tr>";
$result = mysql_query("SELECT prefs.userid, prefs.special_user, user.id, user.name \n    FROM forum_preferences as prefs, user \n    WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id");
for ($i = 1; $i <= mysql_num_rows($result); $i++) {
    $foo = mysql_fetch_object($result);
    echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n";
    echo "<input type=\"hidden\" name=\"userid\" value=\"{$foo->userid}\"\n        <tr><td>{$foo->name} ({$foo->id})</td>\n    ";
    for ($j = 0; $j <= 6; $j++) {
        $bit = substr($foo->special_user, $j, 1);
        echo "<td><input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\"";
// 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_ops.inc";
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Manage special users action");
$bitset = '';
for ($i = 0; $i < S_NFLAGS; $i++) {
    if (post_int("role" . $i, TRUE) == '1') {
        $bitset = str_pad($bitset, $i + 1, '1');
    } else {
        $bitset = str_pad($bitset, $i + 1, '0');
    }
}
if ($bitset == "0000000") {
    $bitset = '';
}
$userid = post_int("userid");
$query = "UPDATE forum_preferences SET special_user='******' WHERE userid='{$userid}'";
_mysql_query($query);
if (_mysql_affected_rows() == 1) {
//
// 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_ops.inc";
db_init();
admin_page_head("Result summary per app version");
//   modified by Bernd Machenschalk 2007
//
//   1. distinguish between Darwin x86 and Darwin PPC
//   2. lists the "fail rates" for individual client states to allow for
//      distinguishing between download errors, computing errors and aborts
//   3. optionally list individual "unknown" OS by name
//   4. optionally list "unofficial" application versions
//
//   3. and 4. are probably rather confusing on open-source projects like SETI,
//   but I found them helpful e.g. on Einstein
$query_appid = get_int('appid');
$query_nsecs = get_int('nsecs');
$query_received_time = time() - $query_nsecs;
$query_all_versions = get_str('allversions', true);
$query_all_platforms = get_str('allplatforms', true);
示例#11
0
文件: mass_email.php 项目: happyj/qcn
function exit_error($message)
{
    echo "Error: {$message} <br>";
    exit;
}
// These are set to large values because otherwise the script has
// a tendency to just stop after some time.
//
ini_set("memory_limit", "20M");
set_time_limit(3600);
$receiver = 0;
$receiver = post_int('receiver', true);
$subject = post_str('subject', true);
$body = post_str('body', true);
$body = stripslashes($body);
admin_page_head("Send mass email");
if ($receiver > 0) {
    db_init();
    switch ($receiver) {
        case 1:
            // all users
            $query = "select * from user where send_email > 0";
            break;
        case 2:
            // unsuccessful users
            $week_ago = time(0) - 7 * 86400;
            $query = "select user.id,user.name,user.email_addr from user left join result on user.id=result.userid where send_email>0 and total_credit=0 and user.create_time<{$week_ago} and isnull(result.id)";
            break;
        case 3:
            // successful users
            $query = "select * from user where send_email>0 and total_credit>0";
示例#12
0
                }
            }
        }
    }
}
// Process a delete request.  Empty user will trigger search form.
//
if (isset($_POST['delete_user']) && !empty($user)) {
    delete_user($user);
}
// Now update from whatever might have been set above
if (!empty($user)) {
    BoincForumPrefs::lookup($user);
}
// Output:
admin_page_head("User Management: {$user->name}");
echo "<h2>User Management</h2>\n";
if (!defined("POST_REPORT_EMAILS")) {
    echo "<p><font color='RED'>\n   There is no addministrative e-mail address defined for reporting problems\nor abuse in the forums.  Please define POST_REPORT_EMAILS in project.inc\n        </font></p>\n";
}
echo "<form name='manage_user' action=manage_user.php method='POST'>\n    <input type='hidden' name='userid' value='" . $user->id . "'>\n";
start_table();
if (empty($user->id)) {
    if (!empty($search_name)) {
        echo "No match found. ";
        if (!empty($matches)) {
            echo " Partial matches are: <blockquote> {$matches} </blockquote>\n";
        }
    }
    echo " Enter user name:\n        <blockquote>\n         <input type='text' name='search_text' >\n         <input type='submit' name='search_submit' value='Search'>\n        </form>\n    ";
    admin_page_tail();
示例#13
0
function show_form()
{
    admin_page_head("Revalidate jobs");
    echo "\n        This form lets you re-validate jobs.\n        Use this if you changed your validator to a more permissive policy,\n        and you want to rerun it on some jobs\n        (e.g. to grant credit to instances previously marked as invalid).\n        <p>\n        <form method=get action=revalidate.php>\n        <p>\n        Enter a SQL 'where' clause indicating which workunits\n        you want to revalidate\n        (e.g., <b>id >= 1000 and id < 2000</b>).\n        <p>\n        where <input name=clause size=60>\n        <p>\n        <input type=submit value=OK>\n        </form>\n    ";
    admin_page_tail();
}
示例#14
0
$appid_filter = "";
$appid_title = "";
$appid = get_int("appid", true);
if ($appid) {
    $appid_filter = " appid = {$appid} AND ";
    $app = BoincApp::lookup_id($appid);
    $appid_title = " for " . $app->name;
}
// the following variables are using the cache that is created by the variables above
// hide already canceled WUs
$hide_canceled = get_str("hide_canceled", true);
// hide WU that have only download errors
$hide_dlerr = get_str("hide_dlerr", true);
// refresh cache from DB
$refresh_cache = get_int("refresh_cache", true);
admin_page_head("All-error Workunits" . $appid_title);
function print_wu($row)
{
    echo "<tr>\n";
    echo "<td align=\"left\" valign=\"top\">";
    if (!in_rops()) {
        echo "<input type=\"checkbox\" name=\"WU[]\" value=\"" . $row->id . "\">\n";
    }
    echo "<a href=db_action.php?table=workunit&detail=high&id=";
    echo $row->id;
    echo ">";
    echo $row->id;
    echo "</a></td>\n";
    echo "<td align=\"left\" valign=\"top\">" . $row->name . "</td>\n";
    echo "<td align=\"left\" valign=\"top\">" . $row->appid . "</td>\n";
    echo "<td align=\"left\" valign=\"top\">" . $row->min_quorum . "</td>\n";
// 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/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Pass percentage by platform");
/*
   modified by Bernd Machenschalk 2007
   1. distinguish between Darwin x86 and Darwin PPC
   2. lists the "fail rates" for individual client states to allow for
	  distinguishing between download errors, computing errors and aborts
   3. optionally list individual "unknown" OS by name
   4. optionally list "unofficial" application versions
   3. and 4. are probably rather confusing on open-source projects like SETI,
   but I found them helpful e.g. on Einstein
*/
$query_appid = $_GET['appid'];
$query_nsecs = $_GET['nsecs'];
$query_received_time = time() - $query_nsecs;
$query_all_versions = $_GET['allversions'];
$query_all_platforms = $_GET['allplatforms'];
示例#16
0
function clear()
{
    global $course_id;
    admin_page_head("Deleting course data");
    BoltEnrollment::delete_aux("course_id = {$course_id}");
    BoltView::delete_aux("course_id = {$course_id}");
    BoltResult::delete_aux("course_id = {$course_id}");
    BoltXsetResult::delete_aux("course_id = {$course_id}");
    BoltSelectFinished::delete_aux("course_id = {$course_id}");
    BoltRefreshRec::delete_aux("course_id = {$course_id}");
    BoltQuestion::delete_aux("course_id = {$course_id}");
    echo "\n\t\tCourse data deleted.\n\t";
    admin_page_tail();
}
示例#17
0
if (!file_exists("../../stop_daemons")) {
    admin_error_page("Project must be stopped");
}
// PFC is based on workunit.rsc_fpops_est.
// If this was bad, all PFC info is bad.
// So we need to zero it out everywhere
//
function reset_app($app)
{
    $avs = BoincAppVersion::enum("appid={$app->id}");
    foreach ($avs as $av) {
        $av->update("pfc_n=0, pfc_avg=0, pfc_scale=0, et_n=0, et_avg=0, et_var=0, et_q=0, expavg_credit=0, expavg_time=0");
        BoincHostAppVersion::update_aux("pfc_n=0, pfc_avg=0 where app_version_id={$av->id}");
    }
    $app->update("min_avg_pfc = 0");
}
$appid = get_int("appid");
$app = BoincApp::lookup_id($appid);
if (!$app) {
    admin_error_page("no such app");
}
$confirmed = get_int("confirmed", true);
if ($confirmed) {
    reset_app($app);
    admin_page_head("Application reset completed");
    admin_page_tail();
} else {
    admin_page_head("Confirm: reset {$app->name}");
    echo "\n        This operation will zero out the statistics used to calculate credit.\n        It may take a while to regenerate these statistics.\n        Are you sure you want to do this?\n        <p>\n        <a href=app_reset.php?appid={$appid}&confirmed=1>Yes</a>\n    ";
    admin_page_tail();
}
示例#18
0
// 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_ops.inc";
require_once "../inc/cache.inc";
// User - configuarble variables
// seconds to cache this page
$cache_sec = 300;
// Number that determines how many client errors are necessary for a WU to show up in this list.
// This number is added to min_quorum of the WU, so a value of 1 means that there must be more than
// (min_quorum + 1) errors for a WU to show up in this list.
$notification_level = 1;
start_cache($cache_sec);
admin_page_head("All-error Workunits");
db_init();
function print_wu($id, $name, $quorum, $errors)
{
    echo "<tr>\n";
    echo "<td align=\"left\" valign=\"top\">";
    echo "<a href=db_action.php?table=workunit&detail=high&id=";
    echo $id;
    echo ">";
    echo $id;
    echo "</a></td>\n";
    echo "<td align=\"left\" valign=\"top\">";
    echo $name;
    echo "</td>\n";
    echo "<td align=\"left\" valign=\"top\">";
    echo $quorum;
// 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/forum.inc";
require_once "../inc/text_transform.inc";
require_once "../inc/profile.inc";
require_once "../inc/util_ops.inc";
require_once "../project/project.inc";
db_init();
function buttons($i)
{
    echo "\n        <input type=\"radio\" name=\"user{$i}\" value=\"0\"> skip <br>\n        <input type=\"radio\" name=\"user{$i}\" value=\"1\" checked=\"checked\"> accept <br>\n        <input type=\"radio\" name=\"user{$i}\" value=\"-1\"> reject\n    ";
}
admin_page_head("screen profiles");
if (function_exists('profile_screen_query')) {
    $query = profile_screen_query();
} else {
    if (profile_screening()) {
        $query = "select * from profile, user where profile.userid=user.id " . " and has_picture>0 " . " and verification=0 " . " limit 20";
    } else {
        $query = "select * from profile, user where profile.userid=user.id " . " and has_picture>0 " . " and verification=0 " . " and uotd_time is null " . " and expavg_credit>1 " . " and (response1 <> '' or response2 <> '') " . " order by recommend desc limit 20";
    }
}
$result = _mysql_query($query);
$n = 0;
echo "<form action=profile_screen_action.php>\n";
start_table();
$found = false;
while ($profile = _mysql_fetch_object($result)) {
示例#20
0
function clear_batch($batch_id)
{
    admin_page_head("Deleting instances");
    if (BossaJobInst::delete_aux("batch_id={$batch_id}")) {
        echo "Job instances deleted.";
        $jobs = BossaJob::enum("batch_id={$batch_id}");
        foreach ($jobs as $job) {
            $job->update("priority_0=1");
        }
    } else {
        echo "Database error.";
    }
    $jobs = BossaJob::enum("batch_id={$batch_id}");
    foreach ($jobs as $job) {
        $job->update("state=1");
    }
    admin_page_tail();
}
示例#21
0
    $y = round($x, 2);
    $host_content .= "\n    Total Disk Space: {$y} GB";
    $x = $host->d_free / (1024 * 1024 * 1024);
    $y = round($x, 2);
    $host_content .= "\n    Free Disk Space: {$y} GB\n    Avg network bandwidth (upstream): {$host->n_bwup} bytes/sec\n    Avg network bandwidth (downstream): {$host->n_bwdown} bytes/sec";
    $x = $host->avg_turnaround / 86400;
    $host_content .= "\n    Average turnaround: " . round($x, 2) . " days\n    Number of RPCs: {$host->rpc_seqno}\n    Last RPC: " . time_str($host->rpc_time) . "\n    % of time client on: " . 100 * $host->on_frac . " %\n    % of time host connected: " . 100 * $host->connected_frac . " %\n    % of time user active: " . 100 * $host->active_frac . " %\n    # of results today: " . $host->nresults_today;
    $subject = PROJECT . " notice for {$user->name}";
    $body = PROJECT . " notification:\n\nDear {$user->name}\nYour machine (host # {$host->id}) described below appears to have a misconfigured BOINC\ninstallation.  Could you please have a look at it?\n\nSincerely,\n        The " . PROJECT . " team\n";
    $body .= "\n\nThis is the content of our database:\n" . $host_content . "\n\nFor further information and assistance with " . PROJECT . " go to {$master_url}";
    echo nl2br($body) . "<br><br>";
    return send_email($user, $subject, $body);
}
$hostid = get_int("hostid", true);
if (!$hostid) {
    admin_page_head("Misconfigured Host");
    echo "This script sends an email to the owner of the supplied host which says that something gone wrong with his configuration.<br>";
    echo "<br><form method=\"get\" action=\"problem_host.php\">\n    Host ID: \n    <input type=\"text\" size=\"5\" name=\"hostid\">\n    <input class=\"btn btn-default\" type=\"submit\" value=\"Send Email\">\n    </form>\n    ";
} else {
    $host = BoincHost::lookup_id($hostid);
    if (!$host) {
        echo "<h2>No host with that ID</h2>\n\t \t<center>Please <a href=\"problem_host.php\">try again</a></center>";
    } else {
        $user = BoincUser::lookup_id($host->userid);
        echo "<a href=\"problem_host.php\">Do another?</a><br><br>";
        send_problem_email($user, $host);
        echo "Email to " . $user->email_addr . " has been sent.<br>";
    }
}
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//
// 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_ops.inc";
$cancel = post_int('cancel', true);
$hide_canceled = post_str('hide_canceled', true);
$hide_dlerr = post_str('hide_dlerr', true);
$appid = post_int('appid', true);
$WU = post_arr('WU', true);
$back = post_str('back', true);
$clause = post_str('clause', true);
$limit = post_int('limit', true);
if (!$limit || $limit == 0) {
    $limit = 20;
}
admin_page_head("Cancel Workunits");
// check for WUs to cancel
//
$WUs = "";
if ($cancel && $cancel == 1) {
    if ($WU) {
        foreach ($WU as $key => $value) {
            if ($WUs != "") {
                $WUs = $WUs . ",";
            }
            $WUs = $WUs . $value;
        }
    }
}
// cancel WUs (if not in rops)
//
示例#23
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/>.
// show details of an app
require_once '../inc/util_ops.inc';
$appid = get_int("appid");
$app = BoincApp::lookup_id($appid);
if (!$app) {
    admin_error_page("no such app");
}
admin_page_head("Details for {$app->name} ({$app->user_friendly_name})");
start_table();
row2("Min average efficiency", $app->min_avg_pfc);
echo "\n    <p>\n    In the list below, 'Credit scale factor' should\n    be roughly 1 for CPU versions, 0.1 for GPU versions.\n    If values are far outside this range,\n    you may have bad FLOPs estimates.\n    In this case, you may want to\n    <ol>\n    <li> <a href=job_times.php?appid={$appid}>Get a better FLOPs estimate</a>\n    <li> <a href=app_reset.php?appid={$appid}>reset credit statistics for this application</a>.\n    </ol>\n";
end_table();
echo "<h2>App versions</h2>\n";
$avs = BoincAppVersion::enum("appid={$appid}");
$avs = current_versions($avs);
foreach ($avs as $av) {
    $platform = BoincPlatform::lookup_id($av->platformid);
    start_table();
    row2("ID", $av->id);
    row2("Platform", $platform->name);
    row2("Plan class", $av->plan_class);
    row2("Version num", $av->version_num);
    row2("Jobs validated", $av->pfc_n);
示例#24
0
<?php

// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010 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/>.
// transition all WUs
require_once "../inc/boinc_db.inc";
require_once "../inc/util_ops.inc";
$db = BoincDb::get();
$now = time();
$db->do_query("update " . $db->db_name . ".workunit set transition_time = {$now}");
admin_page_head("Transition WUs");
echo "The transition time of all WUs has been set to now.\n    Monitor the transitioner log to see what happens.\n";
admin_page_tail();
示例#25
0
        $field = "max_core_version_" . $id;
        $new_v = $_POST[$field];
        $old_v = $item->max_core_version;
        if ($new_v != $old_v) {
            $cmd = "UPDATE app_version SET max_core_version={$new_v} WHERE id={$id}";
            $commands .= "<P><pre>{$cmd}</pre>\n";
            mysql_query($cmd);
        }
    }
    mysql_free_result($result);
    touch("../../reread_db");
}
/***************************************************\
 * Display the DB contents in a form
 \***************************************************/
admin_page_head("Manage Application Versions");
if ($commands) {
    echo $commands;
}
// show the last DB commands given
$self = $_SERVER['PHP_SELF'];
echo "<form action='{$self}' method='POST'>\n";
// Application Version table:
echo "<P>\n";
start_table("center");
row1("<b>" . PROJECT . " Application Versions</b>", 8);
echo "<TR><TH>ID #</TH>\r\n\t  <TH>Appllication</TH>\r\n\t  <TH>Version</TH>\r\n\t  <TH>Platform</TH>\r\n\t  <TH>minimum<br>core version</TH>\r\n\t  <TH>maximum<br>core version</TH>\r\n\t  <TH>deprecated?</TH>\r\n\t  <TH>DELETE?<sup>*</sup>\r\n\t</TH>\r\n\t   </TR>\n";
$q = "SELECT * FROM app_version ORDER BY appid, version_num, platformid";
$result = mysql_query($q);
$Nrow = mysql_num_rows($result);
for ($j = 1; $j <= $Nrow; $j++) {
示例#26
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/forum.inc';
require_once '../inc/util_ops.inc';
db_init();
admin_page_head('Manage user privileges');
start_table("align=\"center\"");
row1("Current special users", '9');
echo "<tr><td>User</td>";
for ($i = 0; $i < S_NFLAGS; $i++) {
    echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n";
}
echo "</tr>";
$result = _mysql_query("SELECT prefs.userid, prefs.special_user, user.id, user.name \n    FROM forum_preferences as prefs, user \n    WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id");
for ($i = 1; $i <= _mysql_num_rows($result); $i++) {
    $foo = _mysql_fetch_object($result);
    echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n";
    echo "<input type=\"hidden\" name=\"userid\" value=\"{$foo->userid}\"\n        <tr><td>{$foo->name} ({$foo->id})</td>\n    ";
    for ($j = 0; $j < S_NFLAGS; $j++) {
        $bit = substr($foo->special_user, $j, 1);
        echo "<td><input type=\"checkbox\" name=\"role" . $j . "\" value=\"1\"";
示例#27
0
<?php

require_once "../inc/countries.inc";
require_once "../inc/utilidades.inc";
require_once "../inc/util_ops.inc";
require_once "../inc/db_ops.inc";
db_init();
admin_page_head(tra("Simulation Model Creation/Deletion"));
echo " <script src=\"http://code.jquery.com/jquery-latest.js\"></script> ";
echo "\n  <style>\n  </style>\n\n<script> \n\n\n</script>";
echo "<form method=get action=emLanzaFormModelo.php>";
start_table();
row1("CREATE / DELETE", '9');
row2(tra("MODEL NUMBER %1 to Create OR Delete %2", "<br><span class=note>", "</span>"), "<input name=modelNumber type=text size=10 >");
row2("", "<input type=submit value='Go!'>");
row1("List of Actual Models ", '9');
echo "<tr><td>Model ID</td>";
echo "<td width=\"15\">" . "Model Name     " . "</td>\n";
echo "</tr>";
row1("", '9');
$models = get_mysql_model("SELECT modelo_id, nombre FROM modelo order by modelo_id ASC ");
foreach ($models as $model) {
    $model_id = $model["modelo_id"];
    $model_name = $model["nombre"];
    echo "<tr><td>" . $model_id . "</td>";
    echo "<td>\n\t\t\t<a href=\"emListModeloDetail.php?model=" . $model_id . "\">" . $model_name . "</a>\n\t\t\t</td>\n\t\t\t";
    echo " </tr>";
}
end_table();
echo "</form>\n";
/*
示例#28
0
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
require_once "../inc/forum.inc";
require_once "../inc/profile.inc";
db_init();
/***********************************************************************\
 * Action: Process form info & controls
\***********************************************************************/
$limit = get_int('limit', true);
if (!$limit > 0) {
    $limit = 30;
}
/***********************************************************************\
 * Display the page:
\***********************************************************************/
admin_page_head("New Users");
echo "<h2>Recently joined:</h2>\n";
echo "These are the most recent " . $limit . " users to join the project.<br>\n";
echo "Clicking on a name opens a user management page <i>in another window or tab</i>\n";
echo "<form name=\"new_user_limit\" action=\"?\" method=\"GET\">\n";
echo "<label for=\"limit\">Limit displayed users to</label>\n";
echo "<input type=\"text\" value=\"" . $limit . "\" name=\"limit\" id=\"limit\" size=\"5\">";
echo "<input class=\"btn btn-default\" type=\"submit\" value=\"Display\">\n";
echo "</form>\n";
$query = "SELECT * FROM user ORDER BY create_time DESC LIMIT {$limit}";
$result = _mysql_query($query);
if (_mysql_num_rows($result) < 1) {
    echo "There are no new users.";
    admin_page_tail();
}
start_table();
// 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/>.
//
// This file was modified by contributors of "BOINC Web Tweak" project.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Result Failure Summary by Host");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$main_query = "\r\nSELECT\r\n\t   app_version_num AS App_Version,\r\n\t   hostid AS Host_ID,\r\n\t   case\r\n\t\t   when INSTR(host.os_name, 'Darwin') then 'Darwin'\r\n\t\t   when INSTR(host.os_name, 'Linux') then 'Linux'\r\n\t\t   when INSTR(host.os_name, 'Windows') then 'Windows'\r\n\t\t   when INSTR(host.os_name, 'SunOS') then 'SunOS'\r\n\t\t   when INSTR(host.os_name, 'Solaris') then 'Solaris'\r\n\t\t   when INSTR(host.os_name, 'Mac') then 'Mac'\r\n\t\t   else 'Unknown'\r\n\t   end AS OS_Name,\r\n\t   case\r\n\t\t   when INSTR(host.os_name, 'Linux') then \r\n\t\t\t   case\r\n\t\t\t\t   when INSTR(LEFT(host.os_version, 6), '-') then LEFT(host.os_version, (INSTR(LEFT(host.os_version, 6), '-') - 1))\r\n\t\t\t\t   else LEFT(host.os_version, 6)\r\n\t\t\t   end\r\n\t\t   else host.os_version\r\n\t   end AS OS_Version,\r\n\t   host.nresults_today AS Results_Today, \r\n\t   COUNT(*) AS error_count\r\nFROM   result\r\n\t\t   left join host on result.hostid = host.id \r\nWHERE\r\n\t   appid = '{$query_appid}' and\r\n\t   server_state = '5' and\r\n\t   outcome = '3' and \r\n\t   received_time > '{$query_received_time}'\r\nGROUP BY\r\n\t   app_version_num DESC,\r\n\t   hostid,\r\n\t   OS_Name,\r\n\t   OS_Version,\r\n\t   host.nresults_today\r\n";
$result = mysql_query($main_query);
echo "<table>\n";
echo "<tr><th>App Version</th><th>Host ID</th><th>OS Name</th><th>OS Version</th><th>Results Today</th><th>Error Count</th></tr>\n";
while ($res = mysql_fetch_object($result)) {
    echo "<tr>";
    echo "<td align=\"left\" valign=\"top\">";
    echo $res->App_Version;
    echo "</td>";
    echo "<td align=\"left\" valign=\"top\">";
    echo $res->Host_ID;
    echo "</td>";
    echo "<td align=\"left\" valign=\"top\">";
示例#30
0
<?php

require_once "../inc/util_ops.inc";
require_once "../inc/user.inc";
admin_page_head("Add User");
$email = get_str('email', true);
$name = get_str('name', true);
if ($email && $name) {
    $user = make_user_ldap(urldecode($email), urldecode($name));
    if ($user) {
        echo "User created with ID ";
        echo $user->id;
    } else {
        echo "ERROR: couldn't create user, probably email address already in DB";
    }
} else {
    $page = $_SERVER["REQUEST_URI"];
    echo "<form action=\"{$page}\" method=\"get\" enctype=\"application/x-www-form-urlencoded\">\n";
    echo '<p>User name: ';
    echo '<input name="name" type="text" size="100" maxlength="200">';
    echo '</p><p>Email address:: ';
    echo '<input name="email" type="text" size="100" maxlength="200">';
    echo '</p>';
    echo '<input type="submit" value="Create user">';
    echo "</form>\n";
}