From 8aa24e50ab23f2ae11bbc6f7f91bd1d3937c91d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Tue, 17 Sep 2024 18:23:32 +0200 Subject: [PATCH] =?UTF-8?q?1.12.08=20emp=C3=AAche=20la=20d=C3=A9connexion?= =?UTF-8?q?=20apr=C3=A8s=20la=20modification=20du=20compte=20connect=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/layout.class.php | 122 +++++++++++++++++++----------------- core/module/user/user.php | 1 + 2 files changed, 67 insertions(+), 56 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 56674cd..066ff21 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -82,17 +82,25 @@ class layout extends common $content = 'col' . $blocks[1]; $blockright = 'col' . $blocks[2]; } - // Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog - $pattern = ['config', 'edit', 'add', 'comment', 'data']; + // Toujours en pleine page pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog + $pattern = ['config', 'edit', 'add', 'comment', 'data', 'option', 'theme', 'comment', 'article', 'data', 'gallery', 'update', 'users', 'validate']; if ( (sizeof($blocks) === 1 || in_array($this->getUrl(1), $pattern)) ) { // Pleine page en mode configuration - if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') { + if ( + ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' + || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') + && in_array($this->getUrl(1), $pattern) === false + ) { $this->showNavButtons('top'); } $this->showContent(); - if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') { + if ( + ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' + || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') + && in_array($this->getUrl(1), $pattern) === false + ) { $this->showNavButtons('bottom'); } } else { @@ -352,11 +360,11 @@ class layout extends common $items .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>'; $items .= ' | '; if ( - $this->getUser('permission', 'filemanager') === true - && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' + $this->getUser('permission', 'filemanager') === true + && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' ) { $items .= '' . template::ico('folder', [ - 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent, + 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent, 'margin' => 'all', 'attr' => 'data-lity', 'help' => 'Fichiers du site' @@ -520,8 +528,10 @@ class layout extends common ) { // Affiche l'icône RFM - if ($this->getUser('permission', 'filemanager') === true - && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none') { + if ( + $this->getUser('permission', 'filemanager') === true + && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' + ) { $itemsRight .= '
  • ' . template::ico('folder', [ 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent, 'attr' => 'data-lity', @@ -931,7 +941,7 @@ class layout extends common } $leftItems .= '
  • '; } - + $leftItems .= '
  • ' . template::ico('cubes', [ 'href' => helper::baseUrl() . 'course', 'help' => 'Gérer les espaces' @@ -1016,53 +1026,53 @@ class layout extends common ) // Sur une page d'accueil or $this->getUrl(0) === '' + ) { + // Bouton Editer une page + if ( + $this->getUser('permission', 'page', 'edit') + and $this->geturl(1) !== 'edit' ) { - // Bouton Editer une page - if ( - $this->getUser('permission', 'page', 'edit') - and $this->geturl(1) !== 'edit' - ) { - $leftItems .= '
  • ' . template::ico('pencil', [ - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Éditer la page' - ]) . '
  • '; - } - // Bouton Editer le module d'une page - if ( - $this->getUser('permission', 'page', 'module') - and $this->geturl(1) !== 'edit' - and $this->getData(['page', $this->getUrl(0), 'moduleId']) - ) { - $leftItems .= '
  • ' . template::ico('gear', [ - 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'help' => 'Module de la page' - ]) . '
  • '; - } - // Bouton dupliquer une page - if ( - $this->getUser('permission', 'page', 'duplicate') - and $this->geturl(1) !== 'edit' - ) { - $leftItems .= '
  • ' . template::ico('clone', [ - 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Dupliquer la page' - ]) - . '
  • '; - } - // Bouton Effacer une page - if ( - $this->getUser('permission', 'page', 'delete') - and $this->geturl(1) !== 'edit' - - ) { - $leftItems .= '
  • ' . template::ico('trash', [ - 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Supprimer la page', - 'id' => 'pageDelete' - ]) - . '
  • '; - } + $leftItems .= '
  • ' . template::ico('pencil', [ + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Éditer la page' + ]) . '
  • '; } + // Bouton Editer le module d'une page + if ( + $this->getUser('permission', 'page', 'module') + and $this->geturl(1) !== 'edit' + and $this->getData(['page', $this->getUrl(0), 'moduleId']) + ) { + $leftItems .= '
  • ' . template::ico('gear', [ + 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'help' => 'Module de la page' + ]) . '
  • '; + } + // Bouton dupliquer une page + if ( + $this->getUser('permission', 'page', 'duplicate') + and $this->geturl(1) !== 'edit' + ) { + $leftItems .= '
  • ' . template::ico('clone', [ + 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Dupliquer la page' + ]) + . '
  • '; + } + // Bouton Effacer une page + if ( + $this->getUser('permission', 'page', 'delete') + and $this->geturl(1) !== 'edit' + + ) { + $leftItems .= '
  • ' . template::ico('trash', [ + 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Supprimer la page', + 'id' => 'pageDelete' + ]) + . '
  • '; + } + } } // Items de droite $rightItems = ''; @@ -1076,7 +1086,7 @@ class layout extends common ) { $rightItems .= '
  • ' . template::ico('folder', [ 'help' => 'Fichiers', - 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent, + 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent, 'attr' => 'data-lity' ]) . '
  • '; } diff --git a/core/module/user/user.php b/core/module/user/user.php index 536ebf2..6a2faa5 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -503,6 +503,7 @@ class user extends common 'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN), 'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT), 'tags' => $this->getInput('userEditTags', helper::FILTER_STRING_SHORT), + 'authKey' => $this->getData(['user', $this->getUrl(2), 'authKey']), ] ]); // Redirection spécifique si l'utilisateur change son mot de passe