diff --git a/checkin_notes b/checkin_notes
index 4e933d2dff..067d3ca2f0 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -1335,3 +1335,7 @@ David Feb 12 2008
lib/
common_defs.h
util.C,h
+
+David Feb 12 2008
+ lib/
+ str_util.h
diff --git a/doc/links.php b/doc/links.php
index 713a4a9811..f7b3a9e806 100644
--- a/doc/links.php
+++ b/doc/links.php
@@ -296,6 +296,7 @@ language("Slovak", array(
site("http://www.boinc.sk/", "www.boinc.sk")
));
language("Spanish", array(
+ site("http://foro.noticias3d.com/vbulletin/showthread.php?t=192297", "Noticias3D"),
site("http://elmajo.blogspot.com", "Computación Distribuida"),
site("http://efren-canarias.blogcindario.com/", "El Pais De La Computacion"),
site("http://www.canalboinc.org/modules/news/", "Canal BOINC"),
diff --git a/doc/logo.php b/doc/logo.php
index 9847e9ca67..9e71702f25 100644
--- a/doc/logo.php
+++ b/doc/logo.php
@@ -43,7 +43,7 @@ The colors are based on U.C. Berkeley's blue-and-gold colors.
Favicon (GIFF)
diff --git a/html/inc/bolt_db.inc b/html/inc/bolt_db.inc
index 12f682f805..859d2f5ac9 100644
--- a/html/inc/bolt_db.inc
+++ b/html/inc/bolt_db.inc
@@ -70,7 +70,7 @@ class BoltDb extends DbConn {
class BoltUser {
static $cache;
static function lookup_userid($id) {
- $db = BoincDb::get();
+ $db = BoltDb::get();
return $db->lookup('bolt_user', 'BoltUser', "user_id=$id");
}
static function insert($clause) {
diff --git a/html/inc/bossa_db.inc b/html/inc/bossa_db.inc
index 207dc2c12e..108eebe93c 100644
--- a/html/inc/bossa_db.inc
+++ b/html/inc/bossa_db.inc
@@ -3,6 +3,10 @@
require_once("../inc/db_conn.inc");
require_once("../inc/util.inc");
+define ('VALIDATE_STATE_INIT', 0);
+define ('VALIDATE_STATE_VALID', 1);
+define ('VALIDATE_STATE_INVALID', 2);
+
class BossaDb extends DbConn {
public static $instance;
@@ -28,15 +32,47 @@ class BossaDb extends DbConn {
}
}
+class BossaUser {
+ static $cache;
+ static function lookup_userid($id) {
+ $db = BossaDb::get();
+ return $db->lookup('bossa_user', 'BossaUser', "user_id=$id");
+ }
+ static function insert($clause) {
+ $db = BossaDb::get();
+ return $db->insert('bossa_user', $clause);
+ }
+ static function lookup(&$user) {
+ if (!$user) return;
+ if (isset($user->bossa)) return;
+ if (isset(self::$cache[$user->id])) {
+ $bossa = self::$cache[$user->id];
+ } else {
+ $bossa = self::lookup_userid($user->id);
+ if (!$bossa) {
+ self::insert("(user_id) values ($user->id)");
+ $bossa = self::lookup_userid($user->id);
+ }
+ self::$cache[$user->id] = $bossa;
+ }
+ $user->bossa = $bossa;
+ }
+ function update($clause) {
+ $db = BossaDb::get();
+ $clause = "$clause where user_id=$this->user_id";
+ return $db->update_aux('bossa_user', $clause);
+ }
+}
+
class BossaApp {
function insert($clause) {
$db = BossaDb::get();
return $db->insert('bossa_app', $clause);
}
- static function lookup_name($name) {
+ static function lookup_short_name($name) {
$db = BossaDb::get();
- return $db->lookup('bossa_app', 'BossaApp', "name='$name'");
+ return $db->lookup('bossa_app', 'BossaApp', "short_name='$name'");
}
static function lookup_id($id) {
@@ -54,7 +90,7 @@ class BossaJob {
function insert() {
$db = BossaDb::get();
$now = time();
- $query = "insert into DBNAME.bossa_job (create_time, name, app_id, info, batch, time_estimate, time_limit, nneeded) values ($now, '$this->name', $this->app_id, '$this->info', $this->batch, $this->time_estimate, $this->time_limit, $this->nneeded)";
+ $query = "insert into DBNAME.bossa_job (create_time, name, app_id, info, batch, time_estimate, time_limit, conf_needed) values ($now, '$this->name', $this->app_id, '$this->info', $this->batch, $this->time_estimate, $this->time_limit, $this->conf_needed)";
$result = $db->do_query($query);
if (!$result) {
echo "$query\n";
@@ -114,7 +150,7 @@ class BossaJobInst {
//
// TODO: put the following in a transaction
$db = BossaDb::get();
- $query = "select bossa_job.* from DBNAME.bossa_job left join DBNAME.bossa_job_inst on bossa_job_inst.job_id = bossa_job.id where bossa_job.nneeded>0 and bossa_job_inst.user_id is null limit 1";
+ $query = "select bossa_job.* from DBNAME.bossa_job left join DBNAME.bossa_job_inst on bossa_job_inst.job_id = bossa_job.id where bossa_job.conf_needed>0 and bossa_job_inst.user_id is null limit 1";
$result = $db->do_query($query);
if (!$result) return null;
$job = mysql_fetch_object($result, 'BossaJob');
@@ -130,7 +166,8 @@ class BossaJobInst {
return null;
}
- $job->update("nneeded=nneeded-1");
+ // TODO: replace "1"
+ $job->update("conf_needed=conf_needed-1");
return $ji;
}
diff --git a/html/inc/bossa_example.inc b/html/inc/bossa_example.inc
index 05c4385639..4a829ac5a3 100644
--- a/html/inc/bossa_example.inc
+++ b/html/inc/bossa_example.inc
@@ -31,7 +31,7 @@ function ellipse_handle($bj, $c) {
$res->cy /= count($c);
}
- $info = json_decode[$bj->info);
+ $info = json_decode($bj->info);
$info->result = $res;
$i = json_encode($info);
$bj->update("info='$i'");
diff --git a/html/ops/bossa_ops.php b/html/ops/bossa_admin.php
similarity index 65%
rename from html/ops/bossa_ops.php
rename to html/ops/bossa_admin.php
index b992f3c635..76a104fb09 100644
--- a/html/ops/bossa_ops.php
+++ b/html/ops/bossa_admin.php
@@ -13,17 +13,19 @@ function show_bapp($app) {
";
if ($app->hidden) {
- show_button("bossa_ops.php?action=unhide&app_id=$app->id", "Unhide", "Unhide this app");
+ show_button("bossa_admin.php?action=unhide&app_id=$app->id", "Unhide", "Unhide this app");
} else {
- show_button("bossa_ops.php?action=hide&app_id=$app->id", "Hide", "Hide this app");
+ show_button("bossa_admin.php?action=hide&app_id=$app->id", "Hide", "Hide this app");
+ echo " ";
+ show_button($app->short_name."_workgen.php?njobs=10", "Create jobs", "Create 10 new jobs");
}
}
function show_apps() {
$apps = BossaApp::enum();
start_table();
- row1("Existing apps", 4);
- table_header("Name/description", "Display script", "Backend script", "");
+ row1("Existing apps", 2);
+ table_header("Name/description", "");
foreach ($apps as $app) {
show_bapp($app);
}
@@ -32,7 +34,7 @@ function show_apps() {
function add_app_form() {
echo "
- |