Пример #1
0
function show_apps()
{
    $apps = BossaApp::enum();
    foreach ($apps as $app) {
        if ($app->hidden) {
            continue;
        }
        show_app($app);
    }
}
Пример #2
0
function show_finished_page($view_id, $prev_view_id)
{
    global $course;
    global $url_args;
    page_header("Course completed");
    if ($course->bossa_app_id) {
        require_once "../inc/bossa_db.inc";
        $app = BossaApp::lookup_id($course->bossa_app_id);
        echo "\n            Congratulations - you have completed the training for {$course->name}.\n            <p>\n            You may now\n            <a href=bossa_get_job.php?bossa_app_id={$course->bossa_app_id}>do work</a>.\n        ";
    } else {
        echo "Congratulations - you have completed this course.";
        $links[] = "<a href=bolt_sched.php?{$url_args}&action=prev&view_id={$view_id}><img src=img/prev.gif></a>";
        $up_link = "<a href=bolt_sched.php?{$url_args}&action=course_home&view_id={$view_id}>Course home page</a>";
        show_nav($links, $up_link, $view_id);
    }
    page_footer();
}
Пример #3
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/>.
require_once "../inc/util.inc";
require_once "../inc/bossa_db.inc";
require_once "../inc/bossa_impl.inc";
$user = get_logged_in_user();
$inst = BossaJobInst::lookup_id(get_int('bji'));
if (!$inst) {
    error_page("No such job instance");
}
if ($inst->user_id != $user->id) {
    error_page("Bad user ID");
}
if ($inst->finish_time) {
    error_page("You already finished this job");
}
$job = BossaJob::lookup_id($inst->job_id);
if (!$job) {
    error_page("No such job");
}
$app = BossaApp::lookup_id($job->app_id);
$file = "../inc/{$app->short_name}.inc";
require_once $file;
$trans = new BossaTransaction();
$now = time();
$inst->update("finish_time={$now}, timeout=0");
BossaUser::lookup($user);
job_finished($job, $inst, $user);
show_next_job($app, $user);
Пример #4
0
function show_bossa_user()
{
    $user_id = get_int('user_id');
    $app_id = get_int('app_id');
    $user = BoincUser::lookup_id("{$user_id}");
    BossaUser::lookup($user);
    $app = BossaApp::lookup_id($app_id);
    include_app_file($app_id);
    admin_page_head("{$user->name} ({$app->name})");
    $x = user_summary($user);
    if ($x) {
        echo "User info: {$x}<br>";
    }
    $insts = BossaJobInst::enum("user_id={$user_id}");
    start_table();
    table_header("Job", "Calibration?", "Start", "Duration", "Response");
    foreach ($insts as $inst) {
        $job = BossaJob::lookup_id($inst->job_id);
        table_row("{$inst->job_id} <a href=bossa_admin.php?action=job_show_insts&job_id={$inst->job_id}>(details)</a><br>" . job_summary($job), calibration_job_string($inst, $job), time_str($inst->create_time), job_duration($inst), instance_summary($inst->get_opaque_data()));
    }
    end_table();
    admin_page_tail();
}
Пример #5
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";
require_once "../inc/bossa_db.inc";
require_once "../inc/bossa_impl.inc";
$user = get_logged_in_user();
BossaUser::lookup($user);
$bossa_app_id = get_int('bossa_app_id');
$app = BossaApp::lookup_id($bossa_app_id);
if (!$app) {
    error_page("no such app: {$bossa_app_id}");
}
$trans = new BossaTransaction();
show_next_job($app, $user);
Пример #6
0
        return false;
    }
    foreach ($insts as $inst) {
        BossaDb::start_transaction();
        $inst = BossaJobInst::lookup_id($inst->id);
        // reread instance within transation
        if ($inst->transition_time < $now) {
            $job = BossaJob::lookup_id($inst->job_id);
            $user = BoincUser::lookup_id($inst->user_id);
            BossaUser::lookup($user);
            job_timed_out($job, $inst, $user);
        }
        $inst->update("timeout={$int_max}");
        BossaDb::commit();
    }
    return true;
}
$app_name = $argv[1];
$app = BossaApp::lookup("short_name='{$app_name}'");
if (!$app) {
    echo "No app named {$app_name}\n";
    exit;
}
$bs = "../inc/" . $app_name . ".inc";
require_once $bs;
while (1) {
    if (!do_pass()) {
        echo "Sleeping\n";
        sleep(10);
    }
}