userCanManage(Auth::user()) || UOJResponse::page403(); $managers_form = newAddDelCmdForm( 'managers', 'validateUserAndStoreByUsername', function ($type, $username, &$vdata) { $user = $vdata['user'][$username]; if ($type == '+') { DB::insert([ "insert into problems_permissions", "(problem_id, username)", "values", DB::tuple([UOJProblem::info('id'), $user['username']]) ]); } else if ($type == '-') { DB::delete([ "delete from problems_permissions", "where", [ "problem_id" => UOJProblem::info('id'), "username" => $user['username'] ] ]); } } ); $managers_form->runAtServer(); if (isSuperUser(Auth::user())) { $update_uploader_form = new UOJForm('update_uploader'); $update_uploader_form->appendHTML( HTML::tag( 'div', ['class' => 'col-auto'], HTML::tag('label', ['class' => 'col-form-label'], '上传者') ) ); $update_uploader_form->addInput( 'new_uploader_username', [ 'div_class' => 'col-auto', 'default_value' => UOJProblem::info('uploader') ?: 'root', 'validator_php' => function ($username, &$vdata) { if (!UOJUser::query($username)) { return '用户不存在'; } $vdata['username'] = $username; return ''; }, ] ); $update_uploader_form->config['form']['class'] = 'mt-2 row g-3 align-items-center'; $update_uploader_form->config['submit_container']['class'] = 'col-auto'; $update_uploader_form->config['submit_button']['class'] = 'btn btn-warning'; $update_uploader_form->config['submit_button']['text'] = '修改上传者'; $update_uploader_form->config['confirm']['smart'] = true; $update_uploader_form->handle = function (&$vdata) { DB::update([ "update problems", "set", ["uploader" => $vdata['username']], "where", ["id" => UOJProblem::info('id')] ]); }; $update_uploader_form->runAtServer(); } ?>

getTitle() ?> 管理

UOJProblem::info('id')] ]); foreach ($res as $row) { $row_id++; echo '', '', '', ''; } ?>
# 用户名
', $row_id, '', UOJUser::getLink($row['username']), '

命令格式:命令一行一个,+mike表示把mike加入管理者,-mike表示把mike从管理者中移除

printHTML(); ?>
printHTML(); ?>