From 26841c795cfbab5702061b462a536fb40456e9a6 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sun, 11 Oct 2020 19:29:33 +0200 Subject: [PATCH 1/2] captcha 10 ou 20 --- core/class/template.class.php | 8 +- core/core.php | 8 +- core/module/config/config.php | 3 +- core/module/config/view/index/index.php | 197 ++++++++++++------------ core/module/user/view/login/login.php | 4 +- module/blog/view/article/article.php | 4 +- module/form/view/index/index.php | 4 +- 7 files changed, 124 insertions(+), 104 deletions(-) diff --git a/core/class/template.class.php b/core/class/template.class.php index f7384a10..d8f8f6d8 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -46,13 +46,15 @@ class template { 'help' => '', 'id' => $nameId, 'name' => $nameId, - 'value' => '' + 'value' => '', + 'limit' => false ], $attributes); // Génère deux nombres pour le captcha $numbers = array(0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20); $letters = array('u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a'); - $firstNumber = rand ( 0 , count($letters)-1 ); - $secondNumber = rand ( 0 , count($letters)-1 ); + $limit = $attributes['limit'] ? 9 : count($letters)-1 ; + $firstNumber = rand ( 0 , $limit ); + $secondNumber = rand ( 0 , $limit ); $result = $firstNumber + $secondNumber; $result = password_hash($result, PASSWORD_BCRYPT); $firstLetter = uniqid(); diff --git a/core/core.php b/core/core.php index 0ae013a9..2b4114be 100644 --- a/core/core.php +++ b/core/core.php @@ -39,7 +39,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.3.02'; + const ZWII_VERSION = '10.3.03'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1421,6 +1421,12 @@ class common { $this->setData(['config', 'connect','captcha', true]); $this->setData(['core', 'dataVersion', 10302]); } + // Version 10.3.03 + if ($this->getData(['core', 'dataVersion']) < 10303) { + // Activation par défaut du captcha à la connexion + $this->setData(['config', 'connect','captcha10', false]); + $this->setData(['core', 'dataVersion', 10303]); + } } } diff --git a/core/module/config/config.php b/core/module/config/config.php index 835490eb..0773a373 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -484,7 +484,8 @@ class config extends common { 'attempt' => $this->getInput('configConnectAttempt',helper::FILTER_INT), 'timeout' => $this->getInput('configConnectTimeout',helper::FILTER_INT), 'log' => $this->getInput('configConnectLog',helper::FILTER_BOOLEAN), - 'captcha' => $this->getInput('configConnectCaptcha',helper::FILTER_BOOLEAN) + 'captcha' => $this->getInput('configConnectCaptcha',helper::FILTER_BOOLEAN), + 'captcha10' => $this->getInput('configConnectCaptcha10',helper::FILTER_BOOLEAN) ] ] ]); diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 25307562..f7200795 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -343,6 +343,107 @@ +
+
+
+

Sécurité de la connexion +
+ +
+

+
+
+
+ 'Connexions successives', + 'selected' => $this->getData(['config', 'connect', 'attempt']) + ]); ?> +
+
+ 'Blocage après échecs', + 'selected' => $this->getData(['config', 'connect', 'timeout']) + ]); ?> +
+
+ + helper::baseUrl() . 'config/blacklistDownload', + 'value' => 'Télécharger liste noire', + 'ico' => 'download' + ]); ?> +
+
+ 'buttonRed', + 'href' => helper::baseUrl() . 'config/blacklistReset', + 'value' => 'Réinitialiser liste', + 'ico' => 'cancel' + ]); ?> +
+
+
+
+ $this->getData(['config', 'connect','captcha']) + ]); ?> +
+
+ $this->getData(['config', 'connect','captcha10']) + ]); ?> +
+
+
+
+
+
+
+
+
+

Journalisation +
+ +
+

+
+
+
+ $this->getData(['config', 'connect', 'log']) + ]); ?> +
+
+ helper::baseUrl() . 'config/logDownload', + 'value' => 'Télécharger journal', + 'ico' => 'download' + ]); ?> +
+
+ 'buttonRed', + 'href' => helper::baseUrl() . 'config/logReset', + 'value' => 'Réinitialiser journal', + 'ico' => 'cancel' + ]); ?> +
+
+
+
+
+
@@ -452,102 +553,6 @@
-
-
-
-

Sécurité de la connexion -
- -
-

-
-
-
- 'Connexions successives', - 'selected' => $this->getData(['config', 'connect', 'attempt']) - ]); ?> -
-
- 'Blocage après échecs', - 'selected' => $this->getData(['config', 'connect', 'timeout']) - ]); ?> -
-
- - helper::baseUrl() . 'config/blacklistDownload', - 'value' => 'Télécharger liste noire', - 'ico' => 'download' - ]); ?> -
-
- 'buttonRed', - 'href' => helper::baseUrl() . 'config/blacklistReset', - 'value' => 'Réinitialiser liste', - 'ico' => 'cancel' - ]); ?> -
-
-
-
- $this->getData(['config', 'connect','captcha']) - ]); ?> -
-
-
-
-
-
-
-
-
-

Journalisation -
- -
-

-
-
-
- $this->getData(['config', 'connect', 'log']) - ]); ?> -
-
- helper::baseUrl() . 'config/logDownload', - 'value' => 'Télécharger journal', - 'ico' => 'download' - ]); ?> -
-
- 'buttonRed', - 'href' => helper::baseUrl() . 'config/logReset', - 'value' => 'Réinitialiser journal', - 'ico' => 'cancel' - ]); ?> -
-
-
-
-
-
diff --git a/core/module/user/view/login/login.php b/core/module/user/view/login/login.php index c68ad1ab..a7219ce6 100644 --- a/core/module/user/view/login/login.php +++ b/core/module/user/view/login/login.php @@ -15,7 +15,9 @@ getData(['config', 'connect','captcha'])): ?>
- + $this->getData(['config','connect','captcha10']) + ]); ?>
diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 5b573ebc..6e700bdd 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -79,7 +79,9 @@ getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
- + $this->getData(['config','connect','captcha10']) + ]); ?>
diff --git a/module/form/view/index/index.php b/module/form/view/index/index.php index ebf58f15..02b082e2 100644 --- a/module/form/view/index/index.php +++ b/module/form/view/index/index.php @@ -46,7 +46,9 @@ getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
- + $this->getData(['config','connect','captcha10']) + ]); ?>
From 0dc4df3b98dfecc253a8363d149f1e02cb8cf71d Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 12 Oct 2020 09:49:17 +0200 Subject: [PATCH 2/2] TLD com en fr --- README.md | 4 ++-- core/core.php | 2 +- core/module/config/config.php | 2 +- core/module/config/view/index/index.php | 2 +- core/module/install/install.php | 2 +- core/module/install/ressource/defaultdata.php | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 56fe236c..62d6cc21 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer ZwiiCMS a été créé par un développeur de talent, [Rémi Jean](https://remijean.fr/). Il est désormais maintenu par Fred Tempez aidé de la communauté. -[Site](http://zwiicms.com/) - [Forum](http://forum.zwiicms.com/) - [Version initiale](https://github.com/remijean/ZwiiCMS/) - [GitHub](https://github.com/fredtempez/ZwiiCMS) +[Site](http://zwiicms.fr/) - [Forum](http://forum.zwiicms.com/) - [Version initiale](https://github.com/remijean/ZwiiCMS/) - [GitHub](https://github.com/fredtempez/ZwiiCMS) ## Configuration recommandée @@ -15,7 +15,7 @@ ZwiiCMS a été créé par un développeur de talent, [Rémi Jean](https://remij ## Téléchargement de ZwiICMS -Pour télécharger la dernière version publiée, il faut vous rendre sur la page de téléchargemet du [site](https://zwiicms.com/telechargements) +Pour télécharger la dernière version publiée, il faut vous rendre sur la page de téléchargemet du [site](https://zwiicms.fr/telechargements) La version github est une **version de développement** qui peut encore contenir des bugs mais elle vous permet de tester les dernières nouveautés. Cette version n'est pas recommandée en production. diff --git a/core/core.php b/core/core.php index 2b4114be..5505151f 100644 --- a/core/core.php +++ b/core/core.php @@ -1266,7 +1266,7 @@ class common { } } // Contrôle des options php.ini pour la mise à jour auto - if (helper::urlGetContents('http://zwiicms.com/update/' . common::ZWII_UPDATE_CHANNEL . '/version') === false) { + if (helper::urlGetContents('http://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/version') === false) { $this->setData(['config','autoUpdate',false]); } diff --git a/core/module/config/config.php b/core/module/config/config.php index 0773a373..b97d1481 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -275,7 +275,7 @@ class config extends common { public function configMetaImage() { // fonction désactivée pour un site local if ( strpos(helper::baseUrl(false),'localhost') > 0 OR strpos(helper::baseUrl(false),'127.0.0.1') > 0) { - $site = 'https://zwiicms.com/'; } else { + $site = 'https://zwiicms.fr/'; } else { $site = helper::baseUrl(false); } $success= false; diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index f7200795..3b11410c 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -60,7 +60,7 @@

Paramètres généraux

- +
addOutput([ 'display' => self::DISPLAY_JSON, diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 8fc24513..36e90661 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -488,7 +488,7 @@ class init extends common {

Article 1 : Les mentions légales

L’édition et la direction de la publication du site www.site.com est assurée par John Doe, domicilié 1 rue de Paris - 75016 PARIS.

Numéro de téléphone est 0102030405

-

Adresse e-mail john.doe@zwiicms.com.

+

Adresse e-mail john.doe@zwiicms.fr.

L\'hébergeur du site www.site.com est la société Nom de l\'hébergeur, dont le siège social est situé au 12 rue de Lyon - 69001 Lyon, avec le numéro de téléphone : 0401020305.

ARTICLE 2 : Accès au site

Le site www.site.com permet à l\'Utilisateur un accès gratuit aux services suivants :

@@ -727,7 +727,7 @@ class init extends common { ] ], 'site-de-zwii' => [ - 'url' => 'https://zwiicms.com/', + 'url' => 'https://zwiicms.fr/', 'count' => 0 ], 'contact' => [