This commit is contained in:
E. S. 2024-04-14 00:46:59 +00:00
parent d5dccdc55c
commit 1b8d5934a6
3 changed files with 3 additions and 18 deletions

View File

@ -58,8 +58,6 @@ class MainHandler extends request_handler {
function GET_post() { function GET_post() {
global $config; global $config;
ensure_admin();
list($name, $input_lang) = input('name, lang'); list($name, $input_lang) = input('name, lang');
$lang = null; $lang = null;
@ -74,7 +72,7 @@ class MainHandler extends request_handler {
$lang = PostLanguage::getDefault(); $lang = PostLanguage::getDefault();
$post = posts::getByName($name); $post = posts::getByName($name);
if (!$post) if (!$post || (!$post->visible && !is_admin()))
not_found(); not_found();
if ($lang == PostLanguage::getDefault() && $input_lang == $lang->value) if ($lang == PostLanguage::getDefault() && $input_lang == $lang->value)
@ -149,8 +147,6 @@ class MainHandler extends request_handler {
} }
function GET_articles() { function GET_articles() {
ensure_admin();
list($lang) = input('lang'); list($lang) = input('lang');
if ($lang) { if ($lang) {
$lang = PostLanguage::tryFrom($lang); $lang = PostLanguage::tryFrom($lang);

View File

@ -432,15 +432,6 @@ HTML;
} }
function books($ctx) {
return <<<HTML
{$ctx->bc([
['text' => $ctx->lang('admin_title'), 'url' => '/admin/'],
['text' => $ctx->lang('admin_books')],
])}
HTML;
}
// ---------------------------------------------------- // ----------------------------------------------------

View File

@ -221,9 +221,7 @@ function renderHeader(SkinContext $ctx,
bool $show_subtitle): string { bool $show_subtitle): string {
$icons = svg(); $icons = svg();
$items = []; $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' => '/files/', 'label' => 'files', 'selected' => $section === 'files'];
$items[] = ['url' => '/info/', 'label' => 'about', 'selected' => $section === 'about']; $items[] = ['url' => '/info/', 'label' => 'about', 'selected' => $section === 'about'];
if (is_admin()) if (is_admin())