mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: allow setting priv_default
This commit is contained in:
1 parent
4a34a91848
commit
3aadb9511d
5 files changed
+8
-8
No files matched your search
@@ -4,9 +4,7 @@ import mysql from 'mysql';
|
||||
import 'hydrooj';
|
||||
import { buildContent } from 'hydrooj/dist/lib/content';
|
||||
|
||||
const {
|
||||
user, problem, builtin: { PRIV },
|
||||
} = global.Hydro.model;
|
||||
const { user, problem, system } = global.Hydro.model;
|
||||
|
||||
export async function run({
|
||||
host = 'localhost', port = 27017, name = 'vijos4', username, password,
|
||||
@@ -45,7 +43,7 @@ export async function run({
|
||||
|
||||
const [udocs] = await query('SELECT * FROM `users`');
|
||||
for (const udoc of udocs) {
|
||||
const uid = await user.create(udoc.email, udoc.nick, '', null, udoc.ip, udoc.defunct === 'Y' ? 0 : PRIV.PRIV_DEFAULT);
|
||||
const uid = await user.create(udoc.email, udoc.nick, '', null, udoc.ip, udoc.defunct === 'Y' ? 0 : system.get('default.priv'));
|
||||
uidMap[udoc.uid] = uid;
|
||||
await user.setById(uid, {
|
||||
nSubmit: udoc.submit,
|
||||
|
||||
Reference in new issue
Block a user