Masque les icônes de gestion dans le cours

This commit is contained in:
Fred Tempez 2023-11-15 14:41:50 +01:00
parent 6463037734
commit 6a8e432b10
2 changed files with 17 additions and 2 deletions

View File

@ -1046,7 +1046,10 @@ class layout extends common
'attr' => 'data-lity'
]) . '</li>';
}
if ($this->getUser('group') >= self::GROUP_ADMIN) {
if (
self::$siteContent === 'home'
&& $this->getUser('group') >= self::GROUP_ADMIN
) {
$rightItems .= '<li>' . template::ico('puzzle', [
'help' => 'Modules',
'href' => helper::baseUrl() . 'plugin'

View File

@ -884,6 +884,12 @@ class core extends common
exit();
}
if ($access === false) {
// Bascule sur le site d'accueil
if ($_SESSION['ZWII_SITE_CONTENT'] !== 'home') {
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
header('Location:' . helper::baseUrl() . $this->getUrl());
exit();
}
http_response_code(403);
if ($accessInfo['userName']) {
$this->addOutput([
@ -905,6 +911,12 @@ class core extends common
}
}
} elseif ($this->output['content'] === '') {
// Bascule sur le site d'accueil pour afficher la page d'erreur
if ($_SESSION['ZWII_SITE_CONTENT'] !== 'home') {
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
header('Location:' . helper::baseUrl() . $this->getUrl());
exit();
}
http_response_code(404);
if (
$this->getData(['config', 'page404']) !== 'none'