Exemplo n.º 1
0
}
function handle_delete($job, $inst, $index)
{
    $output = $inst->get_opaque_data();
    $features = $output->features;
    array_splice($features, $index, 1);
    $output->features = $features;
    $inst->set_opaque_data($output);
    header("location: bossa_example4.php?bji={$inst->id}");
}
$bji = get_int("bji");
if (!bossa_lookup_job($bji, $job, $inst, $u)) {
    error_page("No such instance");
}
$user = get_logged_in_user();
if ($u->id != $user->id) {
    error_page("Not your job");
}
$action = get_str("action", true);
switch ($action) {
    case "add":
        handle_add($job, $inst);
        break;
    case "delete":
        $index = get_int("index");
        handle_delete($job, $inst, $index);
        break;
    default:
        job_show($job, $inst, $user);
        break;
}
Exemplo n.º 2
0
    }
    BoincFriend::delete($user->id, $destid);
    page_head(tra("Friendship cancelled"));
    echo tra("Your friendship with %1 has been cancelled.", $destuser->name);
    page_tail();
}
// "home page" has Requests area
// (icon) N friend request(s)
$user = get_logged_in_user();
$action = get_str('action', true);
if (!$action) {
    $action = post_str('action');
}
switch ($action) {
    case 'add':
        handle_add($user);
        break;
    case 'add_confirm':
        handle_add_confirm($user);
        break;
    case 'query':
        handle_query($user);
        break;
    case 'accept':
        handle_accept($user);
        break;
    case 'accepted':
        handle_accepted($user);
        break;
    case 'ignore':
        handle_ignore($user);