Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage_privileges, badge_assign.php: fix DB inserts #4046

Merged
merged 1 commit into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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