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,