fix: 2cd81ab055
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-15 17:17:14 +08:00
parent e8103b7b9a
commit 353ee59c07
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 4 additions and 3 deletions

View File

@ -375,6 +375,7 @@ class UOJUser {
$extra = []; $extra = [];
} }
mergeConfig($extra, [ mergeConfig($extra, [
'school' => null,
'permissions' => UOJContext::getMeta('users_default_permissions'), 'permissions' => UOJContext::getMeta('users_default_permissions'),
'social' => [ 'social' => [
'codeforces' => null, 'codeforces' => null,
@ -391,7 +392,7 @@ class UOJUser {
'username_color' => isSuperUser($user) ? '#9d3dcf' : '#0d6efd', 'username_color' => isSuperUser($user) ? '#9d3dcf' : '#0d6efd',
]); ]);
if ($key == null) { if ($key === null) {
return $extra; return $extra;
} }

View File

@ -14,14 +14,14 @@ return function ($type) {
DB::update([ DB::update([
"update user_info", "update user_info",
"set", [ "set", [
"extra" => json_encode($extra, JSON_UNESCAPED_UNICODE) "extra" => json_encode($extra, JSON_UNESCAPED_UNICODE),
], ],
"where", [ "where", [
"username" => $user['username'] "username" => $user['username']
] ]
]); ]);
echo "Updated user {$user['username']}. \n"; echo "Updated user {$user['username']} ({$extra['school']}).\n";
} }
} }
}; };