From 639fa7c85f7c68934a573e8a9b3a8e8262ce96e8 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 24 Nov 2020 08:29:53 +0100 Subject: [PATCH 1/2] Bug user --- core/module/user/user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 48e654d2..1bcf15b1 100755 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -263,12 +263,12 @@ class user extends common { $redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()); } // Redirection si retour en arrière possible - elseif($this->getUrl(3)) { + elseif($this->getUser('group') === 3) { $redirect = helper::baseUrl() . 'user'; } // Redirection normale else { - $redirect = helper::baseUrl() . $this->getUrl(); + $redirect = helper::baseUrl(); } // Valeurs en sortie $this->addOutput([ From 1251f247d321231d01bdb4bc5b4076c7175b7ab0 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 24 Nov 2020 09:13:49 +0100 Subject: [PATCH 2/2] defaut data correction sylvain + emplacement translate dans config --- core/core.php | 9 ++++---- core/module/install/ressource/defaultdata.php | 21 ++++++++++++------- core/module/translate/translate.php | 2 +- core/module/translate/view/index/index.php | 4 ++-- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/core/core.php b/core/core.php index bc6fb0c8..d6458375 100755 --- a/core/core.php +++ b/core/core.php @@ -164,7 +164,6 @@ class common { 'theme' => '', 'admin' => '', 'blacklist' => '', - 'translate' => '', 'locale' => '' ]; @@ -219,7 +218,7 @@ class common { } // Auto traduction - if ( $this->getData(['translate','active'])) { + if ( $this->getData(['config','translate','active'])) { // Lire la langue du navigateur $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); @@ -2137,7 +2136,7 @@ class core extends common { // Librairie googtrans ajouté dynamiquement if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr' - AND $this->getData(['translate','active']) === true + AND $this->getData(['config','translate','active']) === true AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) { $this->addOutput([ 'vendor' => array_merge($this->output['vendor'], ['i18n']) @@ -2278,8 +2277,8 @@ class layout extends common { echo $this->core->output['content']; if ( substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr' - AND $this->getData(['translate','showCredits']) === true - AND $this->getData(['translate','active']) === true ) + AND $this->getData(['config','translate','showCredits']) === true + AND $this->getData(['config','translate','active']) === true ) { echo ''; } diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 532d921e..a34deaf9 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -41,7 +41,11 @@ class init extends common { 'attempt' => 3, 'log' => false, 'captcha' => true - ] + ], + 'translate' => [ + 'active' => false, + 'showCredits' => false + ], ], 'core' => [ 'dataVersion' => 10306, @@ -80,10 +84,6 @@ class init extends common { 'hideMenuChildren' =>false ] ], - 'translate' => [ - 'active' => false, - 'showCredits' => false - ], 'module' => [], 'user' => [], 'theme' => [ @@ -651,7 +651,13 @@ class init extends common { 'blog' => [ 'config' => [ 'feeds' => true, - 'feedsLabel' => "Syndication RSS" + 'feedsLabel' => "Syndication RSS", + "editConsent" => "all", + "commentMaxlength" => "500", + "commentApproved" => false, + "commentClose" => false, + "commentNotification" => false, + "commentGroupNotification" => 1 ], 'posts' => [ 'mon-premier-article' => [ @@ -661,7 +667,8 @@ class init extends common { 'author' => 'Rémi', 'content' => 'Article bien rédigé et très pertinent, bravo !', 'createdOn' => 1421748000, - 'userId' => '' + 'userId' => '', + 'approval' => true ] ], 'content' => '

Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.

Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.

Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.

', diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 447cedf5..c4717b8c 100755 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -25,7 +25,7 @@ class translate extends common { public function index() { // Soumission du formulaire if($this->isPost()) { - $this->setData(['translate', [ + $this->setData(['config','translate', [ 'active' => $this->getInput('translateActive', helper::FILTER_BOOLEAN), 'showCredits' => $this->getInput('translateActive', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false, ]]); diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index cf8e2377..fd40a573 100755 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -19,13 +19,13 @@
$this->getData(['translate', 'active']), + 'checked' => $this->getData(['config', 'translate', 'active']), 'help' => 'Traduction automatique du site hors connexion par le script Google Translate selon la langue du navigateur du visiteur.' ]); ?>
$this->getData(['translate', 'showCredits']), + 'checked' => $this->getData(['config', 'translate', 'showCredits']), 'help' => 'Option vivement recommandée pour le respect du droit d\'auteur' ]); ?>