<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
/** @var Cookie */
private $cookie;
- public function __construct(Cookie $cookie, SystemMessages $systemMessages, Emailer $emailer, Database $database, IManageConfigValues $config, App\Page $page, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+ public function __construct(Cookie $cookie, SystemMessages $systemMessages, Emailer $emailer, Database $database, IManageConfigValues $config, IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($session, $page, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->session = $session;
$this->config = $config;
$this->database = $database;
$this->emailer = $emailer;
}
// send notification to admins so that they can clean up the backups
- $admin_mails = explode(',', $this->config->get('config', 'admin_email'));
- foreach ($admin_mails as $mail) {
- $admin = $this->database->selectFirst('user', ['uid', 'language', 'email', 'username'], ['email' => trim($mail)]);
- if (!$admin) {
- continue;
- }
-
- $l10n = $this->l10n->withLang($admin['language']);
+ foreach (User::getAdminListForEmailing(['uid', 'language', 'email']) as $admin) {
+ $l10n = $this->l10n->withLang($admin['language'] ?: 'en');
$email = $this->emailer
->newSystemMail()