mirror of
https://github.com/friendica/friendica
synced 2025-04-27 01:10:14 +00:00
Relocate system user creation
This commit is contained in:
parent
d7fa58d81c
commit
b09ffa0697
2 changed files with 20 additions and 18 deletions
|
@ -144,6 +144,26 @@ class User
|
|||
$system['sprvkey'] = $system['uprvkey'] = $system['prvkey'];
|
||||
$system['spubkey'] = $system['upubkey'] = $system['pubkey'];
|
||||
$system['nickname'] = $system['nick'];
|
||||
|
||||
// Ensure that the user contains data
|
||||
$user = DBA::selectFirst('user', ['prvkey'], ['uid' => 0]);
|
||||
if (empty($user['prvkey'])) {
|
||||
$fields = [
|
||||
'username' => $system['name'],
|
||||
'nickname' => $system['nick'],
|
||||
'register_date' => $system['created'],
|
||||
'pubkey' => $system['pubkey'],
|
||||
'prvkey' => $system['prvkey'],
|
||||
'spubkey' => $system['spubkey'],
|
||||
'sprvkey' => $system['sprvkey'],
|
||||
'verified' => true,
|
||||
'page-flags' => User::PAGE_FLAGS_SOAPBOX,
|
||||
'account-type' => User::ACCOUNT_TYPE_RELAY,
|
||||
];
|
||||
|
||||
DBA::update('user', $fields, ['uid' => 0]);
|
||||
}
|
||||
|
||||
return $system;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue