X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FBaseAdmin.php;h=0535996301a4232659f72b6afcbf079105198ea9;hb=e7384288766f342da98b7d0ada082db516501ac6;hp=a7b38a50330bac94c2505927ff4f167b68d5eb76;hpb=a9af0ca26e55b748fb22c9a41be867217c634fad;p=friendica.git diff --git a/src/Module/BaseAdmin.php b/src/Module/BaseAdmin.php index a7b38a5033..0535996301 100644 --- a/src/Module/BaseAdmin.php +++ b/src/Module/BaseAdmin.php @@ -1,6 +1,6 @@ t('Please login to continue.')); + Session::set('return_path', DI::args()->getQueryString()); + DI::baseUrl()->redirect('login'); + } else { + throw new HTTPException\UnauthorizedException(DI::l10n()->t('Please login to continue.')); + } } - // do not allow a page manager to access the admin panel at all. - if (!empty($_SESSION['submanage'])) { - return; - } - } - - public static function rawContent(array $parameters = []) - { - if (!is_site_admin()) { - return ''; + if (!DI::app()->isSiteAdmin()) { + throw new HTTPException\ForbiddenException(DI::l10n()->t('You don\'t have access to administration pages.')); } if (!empty($_SESSION['submanage'])) { - return ''; + throw new HTTPException\ForbiddenException(DI::l10n()->t('Submanaged account can\'t access the administration pages. Please log back in as the main account.')); } - - return ''; } - public static function content(array $parameters = []) + protected function content(array $request = []): string { - if (!is_site_admin()) { - notice(DI::l10n()->t('Please login to continue.')); - Session::set('return_path', DI::args()->getQueryString()); - DI::baseUrl()->redirect('login'); - } - - if (!empty($_SESSION['submanage'])) { - throw new ForbiddenException(DI::l10n()->t('Submanaged account can\'t access the administation pages. Please log back in as the main account.')); - } + self::checkAdminAccess(true); // Header stuff DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/settings_head.tpl'), []); @@ -95,6 +88,7 @@ abstract class BaseAdmin extends BaseModule ]], 'configuration' => [DI::l10n()->t('Configuration'), [ 'site' => ['admin/site' , DI::l10n()->t('Site') , 'site'], + 'storage' => ['admin/storage' , DI::l10n()->t('Storage') , 'storage'], 'users' => ['admin/users' , DI::l10n()->t('Users') , 'users'], 'addons' => ['admin/addons' , DI::l10n()->t('Addons') , 'addons'], 'themes' => ['admin/themes' , DI::l10n()->t('Themes') , 'themes'], @@ -121,6 +115,7 @@ abstract class BaseAdmin extends BaseModule 'webfinger' => ['webfinger' , DI::l10n()->t('check webfinger') , 'webfinger'], 'itemsource' => ['admin/item/source' , DI::l10n()->t('Item Source') , 'itemsource'], 'babel' => ['babel' , DI::l10n()->t('Babel') , 'babel'], + 'debug/ap' => ['debug/ap' , DI::l10n()->t('ActivityPub Conversion') , 'debug/ap'], ]], ];