示例#1
0
function batches_action($app)
{
    $batches = BoincBatch::enum("app_id={$app->id}");
    $abort_all = get_str("abort_all", true);
    foreach ($batches as $batch) {
        if ($abort_all || get_str("abort_{$batch->id}", true)) {
            abort_batch($batch);
        }
    }
    page_head("Update successful");
    echo "\n        <a href=manage_app.php?app_id={$app->id}>Return to application management page</a>\n    ";
    page_tail();
}
示例#2
0
function handle_abort_batch($user)
{
    $batch_id = get_int('batch_id');
    $batch = BoincBatch::lookup_id($batch_id);
    if (!$batch) {
        error_page("no such batch");
    }
    check_access($user, $batch);
    abort_batch($batch);
    page_head("Batch aborted");
    echo "<p><a href=submit.php>Return to job control page</a>\n";
    page_tail();
}
示例#3
0
function handle_abort_batch($r)
{
    xml_start_tag("abort_batch");
    list($user, $user_submit) = authenticate_user($r, null);
    $batch = get_batch($r);
    if ($batch->user_id != $user->id) {
        xml_error(-1, "not owner");
    }
    abort_batch($batch);
    echo "<success>1</success>\n        </abort_batch>\n    ";
}
function handle_abort_batch($r)
{
    list($user, $user_submit) = authenticate_user($r, null);
    $batch_id = (int) $r->batch_id;
    $batch = BoincBatch::lookup_id($batch_id);
    if (!$batch) {
        error("no such batch");
    }
    if ($batch->user_id != $user->id) {
        error("not owner");
    }
    abort_batch($batch);
    echo "<success>1</success>";
}