if (get_str('show_all', true)) {
         $flags |= BOLT_FLAGS_SHOW_ALL;
     }
     if (get_str('debug', true)) {
         $flags |= BOLT_FLAGS_DEBUG;
     }
     $user->bossa->update("flags={$flags}");
     $user->bossa->flags = $flags;
     Header('Location: bossa_admin.php');
     exit;
 case 'show_user':
     show_bossa_user();
     exit;
 case 'show_batches':
     $app_id = get_int('app_id');
     show_batches($app_id);
     exit;
 case 'show_batch':
     $batch_id = get_int('batch_id');
     show_batch($batch_id);
     exit;
 case 'job_show_insts':
     $job_id = get_int('job_id');
     job_show_insts($job_id);
     exit;
 case 'hide':
     $app_id = get_int('app_id');
     $app = BossaApp::lookup_id($app_id);
     if (!$app) {
         error_page("no such app");
     }
Example #2
0
function handle_admin($user)
{
    $app_id = get_int("app_id");
    $user_submit = BoincUserSubmit::lookup_userid($user->id);
    if (!$user_submit) {
        error_page("no access");
    }
    if ($app_id) {
        if (!$user_submit->manage_all) {
            $usa = BoincUserSubmitApp::lookup("user_id = {$user->id} and app_id={$app_id}");
            if (!$usa) {
                error_page("no access");
            }
        }
        $app = BoincApp::lookup_id($app_id);
        if (!$app) {
            error_page("no such app");
        }
        page_head("Administer {$app->user_friendly_name}");
        $batches = BoincBatch::enum("app_id = {$app_id} order by id desc");
        show_batches($batches);
    } else {
        if (!$user_submit->manage_all) {
            error_page("no access");
        }
        page_head("Administer all apps");
        $batches = BoincBatch::enum("true order by id desc");
        show_batches($batches);
    }
    page_tail();
}
Example #3
0
function handle_admin($user)
{
    $app_id = get_int("app_id");
    check_admin_access($user, $app_id);
    if ($app_id) {
        $app = BoincApp::lookup_id($app_id);
        if (!$app) {
            error_page("no such app");
        }
        page_head("Administer batches for {$app->user_friendly_name}");
        $batches = BoincBatch::enum("app_id = {$app_id} order by id desc");
        show_batches($batches, PAGE_SIZE, null, $app);
    } else {
        page_head("Administer batches (all apps)");
        $batches = BoincBatch::enum("true order by id desc");
        show_batches($batches, PAGE_SIZE, null, null);
    }
    page_tail();
}
Example #4
0
    page_head("Batch {$batch->id}");
    $results = BoincResult::enum("batch={$batch->id} order by workunitid");
    $i = 0;
    result_table_start(true, true, null);
    foreach ($results as $result) {
        show_result_row($result, true, true, true, $i++);
    }
    end_table();
    page_tail();
}
function show_batches($user)
{
    $batches = BoincBatch::enum("user_id={$user->id}");
    page_head("Batches");
    start_table();
    table_header("Batch ID", "Submitted", "# jobs");
    foreach ($batches as $batch) {
        echo "<tr>\n            <td><a href=submit_status.php?action=show_batch&batch_id={$batch->id}>{$batch->id}</a></td>\n            <td>" . time_str($batch->create_time) . "</td>\n            <td>{$batch->njobs}</td>\n            </tr>\n        ";
    }
    end_table();
    page_tail();
}
$user = get_logged_in_user();
$action = get_str('action', true);
switch ($action) {
    case '':
        show_batches($user);
        break;
    case 'show_batch':
        show_batch($user);
}