1.12.08 empêche la déconnexion après la modification du compte connecté

This commit is contained in:
Fred Tempez 2024-09-17 18:23:32 +02:00
parent 89e6e12748
commit 8aa24e50ab
2 changed files with 67 additions and 56 deletions

View File

@ -82,17 +82,25 @@ class layout extends common
$content = 'col' . $blocks[1]; $content = 'col' . $blocks[1];
$blockright = 'col' . $blocks[2]; $blockright = 'col' . $blocks[2];
} }
// Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog // 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']; $pattern = ['config', 'edit', 'add', 'comment', 'data', 'option', 'theme', 'comment', 'article', 'data', 'gallery', 'update', 'users', 'validate'];
if ( if (
(sizeof($blocks) === 1 || (sizeof($blocks) === 1 ||
in_array($this->getUrl(1), $pattern)) in_array($this->getUrl(1), $pattern))
) { // Pleine page en mode configuration ) { // 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->showNavButtons('top');
} }
$this->showContent(); $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'); $this->showNavButtons('bottom');
} }
} else { } else {
@ -353,10 +361,10 @@ class layout extends common
$items .= '<wbr>&nbsp;|&nbsp;'; $items .= '<wbr>&nbsp;|&nbsp;';
if ( if (
$this->getUser('permission', 'filemanager') === true $this->getUser('permission', 'filemanager') === true
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
) { ) {
$items .= '<wbr>' . template::ico('folder', [ $items .= '<wbr>' . 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', 'margin' => 'all',
'attr' => 'data-lity', 'attr' => 'data-lity',
'help' => 'Fichiers du site' 'help' => 'Fichiers du site'
@ -520,8 +528,10 @@ class layout extends common
) { ) {
// Affiche l'icône RFM // Affiche l'icône RFM
if ($this->getUser('permission', 'filemanager') === true if (
&& $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'
) {
$itemsRight .= '<li>' . template::ico('folder', [ $itemsRight .= '<li>' . 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,
'attr' => 'data-lity', 'attr' => 'data-lity',
@ -1016,53 +1026,53 @@ class layout extends common
) )
// Sur une page d'accueil // Sur une page d'accueil
or $this->getUrl(0) === '' or $this->getUrl(0) === ''
) {
// Bouton Editer une page
if (
$this->getUser('permission', 'page', 'edit')
and $this->geturl(1) !== 'edit'
) { ) {
// Bouton Editer une page $leftItems .= '<li>' . template::ico('pencil', [
if ( 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
$this->getUser('permission', 'page', 'edit') 'help' => 'Éditer la page'
and $this->geturl(1) !== 'edit' ]) . '</li>';
) {
$leftItems .= '<li>' . template::ico('pencil', [
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'help' => 'Éditer la page'
]) . '</li>';
}
// 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 .= '<li>' . template::ico('gear', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'help' => 'Module de la page'
]) . '</li>';
}
// Bouton dupliquer une page
if (
$this->getUser('permission', 'page', 'duplicate')
and $this->geturl(1) !== 'edit'
) {
$leftItems .= '<li>' . template::ico('clone', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
'help' => 'Dupliquer la page'
])
. '</li>';
}
// Bouton Effacer une page
if (
$this->getUser('permission', 'page', 'delete')
and $this->geturl(1) !== 'edit'
) {
$leftItems .= '<li>' . template::ico('trash', [
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
'help' => 'Supprimer la page',
'id' => 'pageDelete'
])
. '</li>';
}
} }
// 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 .= '<li>' . template::ico('gear', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'help' => 'Module de la page'
]) . '</li>';
}
// Bouton dupliquer une page
if (
$this->getUser('permission', 'page', 'duplicate')
and $this->geturl(1) !== 'edit'
) {
$leftItems .= '<li>' . template::ico('clone', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
'help' => 'Dupliquer la page'
])
. '</li>';
}
// Bouton Effacer une page
if (
$this->getUser('permission', 'page', 'delete')
and $this->geturl(1) !== 'edit'
) {
$leftItems .= '<li>' . template::ico('trash', [
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
'help' => 'Supprimer la page',
'id' => 'pageDelete'
])
. '</li>';
}
}
} }
// Items de droite // Items de droite
$rightItems = ''; $rightItems = '';
@ -1076,7 +1086,7 @@ class layout extends common
) { ) {
$rightItems .= '<li>' . template::ico('folder', [ $rightItems .= '<li>' . template::ico('folder', [
'help' => 'Fichiers', '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' 'attr' => 'data-lity'
]) . '</li>'; ]) . '</li>';
} }

View File

@ -503,6 +503,7 @@ class user extends common
'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN), 'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN),
'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT), 'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT),
'tags' => $this->getInput('userEditTags', 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 // Redirection spécifique si l'utilisateur change son mot de passe