From 217f7dc706236f1edbff198893b54f3518742879 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 7 Jan 2021 20:57:59 +0100 Subject: [PATCH] edit/head: keep login containers only if editable Fix logout hiding for admins with missing edit stylesheet. --- article.inc.php | 2 +- page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/article.inc.php b/article.inc.php index f14de99..8e121d3 100644 --- a/article.inc.php +++ b/article.inc.php @@ -223,7 +223,7 @@ class ArchiveArticle # keep either login or logout parts depending on user level global $User; $userexists = $User && property_exists($User, 'login') && $User->login; - if (! ($userexists and $User->admin("edit {$this->link}")) ) { + if (! ($userexists and !empty($this->editable)) ) { # remove matching elements until first corresponding closing tag $hideclass = $userexists ? 'logout' : 'login'; $tagmatch = '<([a-z]+) class="'.$hideclass.'"[^>]*>'; diff --git a/page.php b/page.php index 3e3f4cc..f9dabf0 100644 --- a/page.php +++ b/page.php @@ -56,7 +56,7 @@ $Page->place += [ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']), ]; -if ($User->admin("edit {$Page->link}")) { +if ($Page->editable = $User->admin("edit {$Page->link}")) { include_once 'edit/head.inc.php'; } -- 2.30.0