Skip to content

Commit

Permalink
Merge pull request #4046 from BOINC/dpa_defaults
Browse files Browse the repository at this point in the history
manage_privileges, badge_assign.php: fix DB inserts
  • Loading branch information
Rytiss authored Oct 3, 2020
2 parents 11af93e + e725f9b commit 4c82f6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion html/inc/util_ops.inc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ function get_badge($name, $title, $image_url) {
$b = BoincBadge::lookup("name='$name'");
if ($b) return $b;
$now = time();
$id = BoincBadge::insert("(create_time, name, title, image_url) values ($now, '$name', '$title', 'img/$image_url')");
$id = BoincBadge::insert("(create_time, type, name, title, description, image_url, level, tags, sql_rule) values ($now, 0, '$name', '$title', '', 'img/$image_url', '', '', '')");
$b = BoincBadge::lookup_id($id);
if ($b) return $b;
die("can't create badge $name\n");
Expand Down
4 changes: 2 additions & 2 deletions tools/manage_privileges
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if ($argv[3] === "all") {
}
} else {
if ($grant) {
BoincUserSubmit::insert("set user_id=$user->id, manage_all=1");
BoincUserSubmit::insert("set user_id=$user->id, quota=0, logical_start_time=0, submit_all=0, manage_all=1, max_jobs_in_progress=0");
} else {
die("User $user->id does not have global manage access\n");
}
Expand All @@ -150,7 +150,7 @@ if ($argv[3] === "all") {
if ($grant) {
$bus = BoincUserSubmit::lookup_userid($user->id);
if (!$bus) {
BoincUserSubmit::insert("set user_id=$user->id");
BoincUserSubmit::insert("set user_id=$user->id, quota=0, logical_start_time=0, submit_all=0, manage_all=0, max_jobs_in_progress=0");
}
BoincUserSubmitApp::insert("set user_id=$user->id, app_id=$app->id, manage=1");
} else {
Expand Down

0 comments on commit 4c82f6d

Please sign in to comment.