2007-10-18 21:43:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/bossa_db.inc");
|
|
|
|
|
|
|
|
class Bossa {
|
|
|
|
static function script_init(&$user, &$bj, &$bji) {
|
|
|
|
db_init();
|
|
|
|
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
$bji = BossaJobInst::lookup_id(get_int('bji'));
|
|
|
|
if (!$bji) {
|
|
|
|
error_page("No such job instance");
|
|
|
|
}
|
|
|
|
if ($bji->user_id != $user->id) {
|
|
|
|
error_page("Bad user ID");
|
|
|
|
}
|
2008-02-11 23:38:31 +00:00
|
|
|
if ($bji->finish_time) {
|
|
|
|
error_page("You already finished this job");
|
|
|
|
}
|
2007-10-18 21:43:25 +00:00
|
|
|
$bj = BossaJob::lookup_id($bji->job_id);
|
|
|
|
if (!$bj) {
|
|
|
|
error_page("No such job");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static function show_next_job($bj) {
|
|
|
|
$url = "bossa_get_job.php?bossa_app_id=$bj->app_id";
|
|
|
|
Header("Location: $url");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|