mirror of
https://github.com/friendica/friendica
synced 2025-04-26 22:30:18 +00:00
Centralize config.admin_email management in Model\User
This commit is contained in:
parent
cbe8d463b1
commit
fe547b7851
11 changed files with 134 additions and 134 deletions
|
@ -86,7 +86,7 @@ class Instance extends BaseDataTransferObject
|
|||
$this->uri = $baseUrl->get();
|
||||
$this->title = $config->get('config', 'sitename');
|
||||
$this->short_description = $this->description = $config->get('config', 'info');
|
||||
$this->email = $config->get('config', 'admin_email');
|
||||
$this->email = implode(',', User::getAdminEmailList());
|
||||
$this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')';
|
||||
$this->urls = null; // Not supported
|
||||
$this->stats = new Stats($config, $database);
|
||||
|
@ -98,13 +98,10 @@ class Instance extends BaseDataTransferObject
|
|||
$this->invites_enabled = false;
|
||||
$this->contact_account = [];
|
||||
|
||||
if (!empty($config->get('config', 'admin_email'))) {
|
||||
$adminList = explode(',', str_replace(' ', '', $config->get('config', 'admin_email')));
|
||||
$administrator = User::getByEmail($adminList[0], ['nickname']);
|
||||
if (!empty($administrator)) {
|
||||
$adminContact = $database->selectFirst('contact', ['id'], ['nick' => $administrator['nickname'], 'self' => true]);
|
||||
$this->contact_account = DI::mstdnAccount()->createFromContactId($adminContact['id']);
|
||||
}
|
||||
$administrator = User::getFirstAdmin(['nickname']);
|
||||
if ($administrator) {
|
||||
$adminContact = $database->selectFirst('contact', ['uri-id'], ['nick' => $administrator['nickname'], 'self' => true]);
|
||||
$this->contact_account = DI::mstdnAccount()->createFromUriId($adminContact['uri-id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue