diff --git a/handler/MainHandler.php b/handler/MainHandler.php index 1a6ba11..f544c86 100644 --- a/handler/MainHandler.php +++ b/handler/MainHandler.php @@ -58,8 +58,6 @@ class MainHandler extends request_handler { function GET_post() { global $config; - ensure_admin(); - list($name, $input_lang) = input('name, lang'); $lang = null; @@ -74,7 +72,7 @@ class MainHandler extends request_handler { $lang = PostLanguage::getDefault(); $post = posts::getByName($name); - if (!$post) + if (!$post || (!$post->visible && !is_admin())) not_found(); if ($lang == PostLanguage::getDefault() && $input_lang == $lang->value) @@ -149,8 +147,6 @@ class MainHandler extends request_handler { } function GET_articles() { - ensure_admin(); - list($lang) = input('lang'); if ($lang) { $lang = PostLanguage::tryFrom($lang); diff --git a/skin/admin.phps b/skin/admin.phps index 24b8295..97b75c8 100644 --- a/skin/admin.phps +++ b/skin/admin.phps @@ -432,15 +432,6 @@ HTML; } -function books($ctx) { -return <<bc([ - ['text' => $ctx->lang('admin_title'), 'url' => '/admin/'], - ['text' => $ctx->lang('admin_books')], -])} - -HTML; -} // ---------------------------------------------------- @@ -700,4 +691,4 @@ return <<{$unsafe_data} HTML; -} \ No newline at end of file +} diff --git a/skin/base.phps b/skin/base.phps index 0695728..d3b13b0 100644 --- a/skin/base.phps +++ b/skin/base.phps @@ -221,9 +221,7 @@ function renderHeader(SkinContext $ctx, bool $show_subtitle): string { $icons = svg(); $items = []; -if (is_admin()) { - $items[] = ['url' => '/articles/'.($articles_lang ? '?lang='.$articles_lang : ''), 'label' => 'articles', 'selected' => $section === 'articles']; -} +$items[] = ['url' => '/articles/'.($articles_lang ? '?lang='.$articles_lang : ''), 'label' => 'articles', 'selected' => $section === 'articles']; $items[] = ['url' => '/files/', 'label' => 'files', 'selected' => $section === 'files']; $items[] = ['url' => '/info/', 'label' => 'about', 'selected' => $section === 'about']; if (is_admin())