From f0fc9788695f2642e452b2666a3e6b2d5887c778 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 16 Apr 2022 14:35:33 +0200 Subject: [PATCH 1/5] message site map --- core/module/config/config.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index 76de2cc9..55569f7d 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -209,11 +209,8 @@ class config extends common { // Valeurs en sortie $this->addOutput([ - /*'title' => 'Configuration', - 'view' => 'index',*/ 'redirect' => helper::baseUrl() . 'config', - 'notification' => $successSitemap ? 'Mises à jour des fichiers sitemap etsiteMaps.txt' : 'Echec d\'écriture, le site map n\'a pas été mis à jour', - 'state' => $successSitemap + 'notification' => $successSitemap ? 'La carte du site a été mise à jour' : 'Echec d\'écriture, la carte du site n\'a pas été mise à jour' ]); } From bf447031eb4f7509b166d3b1a8cd3fc7541dfb58 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 17 Apr 2022 14:29:47 +0200 Subject: [PATCH 2/5] =?UTF-8?q?bug=20cl=C3=A9=20de=20fonte=20vide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 562dfec8..edaff96c 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -1132,7 +1132,7 @@ class theme extends common { $f ['websafe'] = self::$fontsWebSafe; // Construit un tableau avec leur ID et leur famille foreach(['websafe', 'imported', 'files'] as $type) { - if(array_key_exists($type, $f)) { + if (is_array($f[$type])) { foreach ($f[$type] as $fontId => $fontValue ) { $fonts [$fontId] = $fontValue['name']; } From b840d235ad651db6ad759ff9929cb69c8d6b39ee Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 17 Apr 2022 14:47:06 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Theme=20admin=20fontes=20=20non=20charg?= =?UTF-8?q?=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/core.php b/core/core.php index e5f00d13..974765dc 100644 --- a/core/core.php +++ b/core/core.php @@ -2595,6 +2595,11 @@ class core extends common { // Version $css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/'; + // Fonts disponibles + $fontsAvailable ['files'] = $this->getData(['fonts', 'files']); + $fontsAvailable ['imported'] = $this->getData(['fonts', 'imported']); + $fontsAvailable ['websafe'] = self::$fontsWebSafe; + /** * Import des polices de caractères * A partir du CDN ou dans le dossier site/file/source/fonts From 3293522dd1a0717cfbb26f15cb52b5cc309935d2 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 18 Apr 2022 14:33:12 +0200 Subject: [PATCH 4/5] accessList doublon --- core/core.php | 1 - 1 file changed, 1 deletion(-) diff --git a/core/core.php b/core/core.php index 974765dc..d4c2c67c 100644 --- a/core/core.php +++ b/core/core.php @@ -65,7 +65,6 @@ class common { 'theme', 'config', 'edit', - 'config', 'translate' ]; public static $accessExclude = [ From 1b2991e6400e8040dfb820f67d97fa34df137a5b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 18 Apr 2022 14:51:10 +0200 Subject: [PATCH 5/5] Option qui redirige les pages d'administration vers le login --- core/core.php | 24 ++++++++++++------- core/include/update.inc.php | 3 +++ core/module/config/config.php | 5 ++-- core/module/config/view/connect/connect.php | 16 +++++++++---- core/module/install/ressource/defaultdata.php | 3 ++- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/core/core.php b/core/core.php index d4c2c67c..dc842da1 100644 --- a/core/core.php +++ b/core/core.php @@ -3097,15 +3097,23 @@ class core extends common { 'content' => template::speech('La page ' . $accessInfo['pageId'] . ' est ouverte par l\'utilisateur ' . $accessInfo['userName'] . '') ]); } else { - if ( $this->getData(['locale','page403']) !== 'none' - AND $this->getData(['page',$this->getData(['locale','page403'])])) - { - header('Location:' . helper::baseUrl() . $this->getData(['locale','page403'])); + // Redirige vers la page de connexion si page de gestion demandée + if ( $this->getData(['config', 'connect', 'redirectLogin']) === true + && in_array($this->geturl(0), self::$accessList) ) { + http_response_code(302); + header('Location:' . helper::baseUrl() . 'user/login/'); + exit(); } else { - $this->addOutput([ - 'title' => 'Accès interdit', - 'content' => template::speech('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)') - ]); + if ( $this->getData(['locale','page403']) !== 'none' + AND $this->getData(['page',$this->getData(['locale','page403'])])) + { + header('Location:' . helper::baseUrl() . $this->getData(['locale','page403'])); + } else { + $this->addOutput([ + 'title' => 'Accès interdit', + 'content' => template::speech('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)') + ]); + } } } } elseif ($this->output['content'] === '') { diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 1a54b74f..ec93c503 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -966,6 +966,9 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { $this->setData(['fonts', 'imported', $fontId, $fontValue]); } + // Redirection des pages d'administration vers la bannière de connexion + $this->setData(['config', 'connect', 'redirectLogin', true]); + // Transforme les URL en références relatives /* $baseUrl = $this->getData(['core', 'baseUrl']); diff --git a/core/module/config/config.php b/core/module/config/config.php index 55569f7d..3e93ecb1 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -275,8 +275,6 @@ class config extends common { } // Valeurs en sortie $this->addOutput([ - /*'title' => 'Configuration', - 'view' => 'index',*/ 'redirect' => helper::baseUrl() . 'config', 'notification' => $success === false ? 'Service inaccessible ou erreur d\'écriture de l\'image' : 'Image générée avec succès', 'state' => $success === false ? false : true @@ -506,7 +504,8 @@ class config extends common { 'captchaStrong' => $this->getInput('connectCaptchaStrong',helper::FILTER_BOOLEAN), 'autoDisconnect' => $this->getInput('connectAutoDisconnect',helper::FILTER_BOOLEAN), 'captchaType' => $this->getInput('connectCaptchaType'), - 'showPassword' => $this->getInput('connectShowPassword',helper::FILTER_BOOLEAN) + 'showPassword' => $this->getInput('connectShowPassword',helper::FILTER_BOOLEAN), + 'redirectLogin' => $this->getInput('connectRedirectLogin',helper::FILTER_BOOLEAN) ], 'i18n' => [ 'enable' => $this->getInput('localei18n',helper::FILTER_BOOLEAN), diff --git a/core/module/config/view/connect/connect.php b/core/module/config/view/connect/connect.php index eaec4452..f9606d37 100644 --- a/core/module/config/view/connect/connect.php +++ b/core/module/config/view/connect/connect.php @@ -11,16 +11,22 @@
-
+
+ $this->getData(['config', 'connect', 'showPassword']), + 'help' => 'Le survom d\'une icône de l\'écran de connexion affiche temporairement le mot de passe.' + ]); ?> +
+
$this->getData(['config', 'connect', 'autoDisconnect']), 'help' => 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.' ]); ?>
-
- $this->getData(['config', 'connect', 'showPassword']), - 'help' => 'Dans l\'écran de connexion, active une icône dont le survol affiche temporairement le mot de passe.' +
+ $this->getData(['config', 'connect', 'redirectLogin']), + 'help' => 'Cette redirection ne concerne que les pages d\'administration du site.' ]); ?>
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 29a397ba..29cbd3cb 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -38,7 +38,8 @@ class init extends common { 'captchaStrong' => false, "captchaType" => 'num', 'autoDisconnect' => true, - 'showPassword' => true + 'showPassword' => true, + 'redirectLogin' => true ], 'i18n' => [ 'enable'=> true,