]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseAdmin.php
Merge pull request #11872 from annando/warnings
[friendica.git] / src / Module / BaseAdmin.php
index 5d5841f994662aea0b1b15c68d0f9219f6615eea..713c44cc200ccfb5c413159d86f3bfb0943a593f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -43,7 +43,10 @@ require_once 'boot.php';
 abstract class BaseAdmin extends BaseModule
 {
        /**
+        * Checks admin access and throws exceptions if not logged-in administrator
+        *
         * @param bool $interactive
+        * @return void
         * @throws HTTPException\ForbiddenException
         * @throws HTTPException\InternalServerErrorException
         */
@@ -59,7 +62,7 @@ abstract class BaseAdmin extends BaseModule
                        }
                }
 
-               if (!is_site_admin()) {
+               if (!DI::app()->isSiteAdmin()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('You don\'t have access to administration pages.'));
                }
 
@@ -68,7 +71,7 @@ abstract class BaseAdmin extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                self::checkAdminAccess(true);