Ensure to never delete the "0" user

This commit is contained in:
Michael 2020-11-18 05:24:04 +00:00
parent 81a03b137b
commit d7fa58d81c
2 changed files with 12 additions and 2 deletions

View file

@ -1058,7 +1058,12 @@ class DBStructure
DBA::insert('user', ['uid' => 0]);
$lastid = DBA::lastInsertId();
if ($lastid != 0) {
DBA::update('user', ['uid' => 0], ['uid' => $lastid]);
$user = [
"verified" => true,
"page-flags" => User::PAGE_FLAGS_SOAPBOX,
"account-type" => User::ACCOUNT_TYPE_RELAY,
];
DBA::update('user', $user, ['uid' => $lastid]);
}
}