From 1a6ce51080ab87a1b3aa452a0d61c80dc8a9ad57 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 13 Aug 2020 14:11:33 +0200 Subject: [PATCH] page 403 --- core/core.php | 15 ++++-- core/module/config/config.php | 1 + core/module/config/view/index/index.php | 46 +++++++++++++------ core/module/install/ressource/defaultdata.php | 4 +- 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/core/core.php b/core/core.php index 7cb527f6..586d17da 100755 --- a/core/core.php +++ b/core/core.php @@ -1360,8 +1360,9 @@ class common { if ($this->getData(['core', 'dataVersion']) < 10300) { // Options de barre de membre simple $this->setData(['config','page404','none']); + $this->setData(['config','page403','none']); $this->setData(['core', 'dataVersion', 10300]); - } + } } } @@ -1952,10 +1953,14 @@ class core extends common { 'content' => template::speech('La page ' . $accessInfo['pageId'] . ' est ouverte par l\'utilisateur ' . $accessInfo['userName'] . '') ]); } else { - $this->addOutput([ - 'title' => 'Erreur 403', - 'content' => template::speech('Vous n\'êtes pas autorisé à accéder à cette page...') - ]); + if ( $this->getData(['config','page404']) === 'none') { + $this->addOutput([ + 'title' => 'Erreur 403', + 'content' => template::speech('Vous n\'êtes pas autorisé à accéder à cette page...') + ]); + } else { + header('Location:' . helper::baseUrl() . $this->getData(['config','page403'])); + } } } elseif($this->output['content'] === '') { diff --git a/core/module/config/config.php b/core/module/config/config.php index ffb5b577..be28aefe 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -426,6 +426,7 @@ class config extends common { [ 'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true), 'page404' => $this->getInput('configPage404'), + 'page403' => $this->getInput('configPage403'), 'analyticsId' => $this->getInput('configAnalyticsId'), 'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN), 'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN), diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index c840bc7e..0fb94b39 100755 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -42,12 +42,19 @@ 'Description du site', 'value' => $this->getData(['config', 'metaDescription']), - 'help' => 'Elle apparaît dans les partages sur les réseaux sociaux.' + 'help' => 'La description participe au référence, n\'oubliez pas de personnaliser la description de chaque page sans copié collé.' ]); ?> + + + +
+
+
+

Pages spéciales

-
+
getData(['page']); foreach($pages as $page => $pageId) { @@ -57,26 +64,37 @@ } } echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [ - 'label' => 'Page d\'accueil', - 'selected' =>$this->getData(['config', 'homePageId']) + 'label' => 'Accueil du site', + 'selected' =>$this->getData(['config', 'homePageId']), + 'help' => 'La page par défaut, c\'est la première page vue par vos visiteurs' ]); ?>
-
- 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ - 'label' => 'Page d\'erreur 404 personnalisée', - 'selected' =>$this->getData(['config', 'page404']), - 'help' => 'Une page 404 ne doit pas apparaître dans l\'arborescence du menu. Créez puis sélectionnez une page orpheline.' - ]); ?> -
-
+
'Sélectionner'] , helper::arrayCollumn($this->getData(['page']), 'title', 'SORT_ASC') ) , [ 'label' => 'Mentions légales', 'selected' => $this->getData(['config', 'legalPageId']), - 'help' => 'Les mentions légales sont obligatoires en France.' + 'help' => 'Les mentions légales sont obligatoires en France. Une option du thèmz - pied de page ajoute un lien discret vers cette page.' ]); ?>
+
+
+ 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ + 'label' => 'Accès interdit, erreur 403', + 'selected' =>$this->getData(['config', 'page403']), + 'help' => 'Une page 403 ne doit pas apparaître dans l\'arborescence du menu. Créez puis sélectionnez une page orpheline.' + ]); ?> +
+
+ 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ + 'label' => 'Page inexistante, erreur 404 ', + 'selected' =>$this->getData(['config', 'page404']), + 'help' => 'Une page 404 ne doit pas apparaître dans l\'arborescence du menu. Créez puis sélectionnez une page orpheline.' + ]); ?> +
+
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index dc189880..342f2587 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -9,7 +9,8 @@ class init extends common { 'favicon' => 'favicon.ico', 'faviconDark' => 'faviconDark.ico', 'homePageId' => 'accueil', - 'page404' => 'erreur-404', + 'page404' => 'none', + 'page403' => 'none', 'maintenance' => false, 'social' => [ 'facebookId' => 'facebook', @@ -666,3 +667,4 @@ class init extends common { ] ]; } +