]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Update src/Module/Api/Friendica/Photoalbum/Index.php
[friendica.git] / src / App.php
index c91ca4c4f29f40ff5d4617d74d7c1ba5dde8d141..623a5b63a20a29b463bf78231394a503c07139bb 100644 (file)
@@ -27,6 +27,7 @@ use Friendica\App\BaseURL;
 use Friendica\Capabilities\ICanCreateResponses;
 use Friendica\Core\Config\Factory\Config;
 use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Model\User;
 use Friendica\Module\Maintenance;
 use Friendica\Security\Authentication;
 use Friendica\Core\Config\ValueObject\Cache;
@@ -68,7 +69,6 @@ class App
        private $theme_info = [
                'videowidth'        => 425,
                'videoheight'       => 350,
-               'events_in_profile' => true
        ];
 
        private $user_id       = 0;
@@ -164,14 +164,16 @@ class App
         * Check if current user has admin role.
         *
         * @return bool true if user is an admin
+        * @throws Exception
         */
        public function isSiteAdmin(): bool
        {
-               $admin_email = $this->config->get('config', 'admin_email');
-
-               $adminlist = explode(',', str_replace(' ', '', $admin_email));
-
-               return $this->session->getLocalUserId() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
+               return
+                       $this->session->getLocalUserId()
+                       && $this->database->exists('user', [
+                               'uid'   => $this->getLoggedInUserId(),
+                               'email' => User::getAdminEmailList()
+                       ]);
        }
 
        /**
@@ -259,8 +261,8 @@ class App
        /**
         * Set workerqueue information
         *
-        * @param array $queue 
-        * @return void 
+        * @param array $queue
+        * @return void
         */
        public function setQueue(array $queue)
        {
@@ -334,9 +336,9 @@ class App
         * @param L10n                        $l10n     The translator instance
         * @param App\Arguments               $args     The Friendica Arguments of the call
         * @param IManagePersonalConfigValues $pConfig  Personal configuration
-        * @param IHandleUserSessions         $sessions The (User)Session handler
+        * @param IHandleUserSessions         $session  The (User)Session handler
         */
-       public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $sessions)
+       public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session)
        {
                $this->database = $database;
                $this->config   = $config;
@@ -347,7 +349,7 @@ class App
                $this->l10n     = $l10n;
                $this->args     = $args;
                $this->pConfig  = $pConfig;
-               $this->session  = $sessions;
+               $this->session  = $session;
 
                $this->load();
        }