From 9cda286db4b4b19c4f18575645321cbbb99e3487 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 29 Aug 2024 06:23:29 +0200 Subject: [PATCH] Fix Captcha --- sondage/enum.json | 2 +- sondage/sondage.php | 10 +++++----- sondage/view/config/config.php | 13 ++++++------- sondage/view/data/data.php | 29 ++++++++++++++--------------- sondage/view/index/index.php | 4 ++-- 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/sondage/enum.json b/sondage/enum.json index 84d4e02..9e5cbd7 100644 --- a/sondage/enum.json +++ b/sondage/enum.json @@ -1 +1 @@ -{"name":"sondage","realName":"Sondage","version":"1.2","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file +{"name":"sondage","realName":"Sondage","version":"1.3","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file diff --git a/sondage/sondage.php b/sondage/sondage.php index a1f714e..d2af53a 100644 --- a/sondage/sondage.php +++ b/sondage/sondage.php @@ -89,7 +89,7 @@ class sondage extends common 'config', [ 'button' => $this->getInput('formConfigButton'), - 'capcha' => $this->getInput('formConfigCapcha', helper::FILTER_BOOLEAN), + 'captcha' => $this->getInput('formConfigCapcha', helper::FILTER_BOOLEAN), 'group' => $this->getInput('formConfigGroup', helper::FILTER_INT), 'user' => self::$listUsers[$this->getInput('formConfigUser', helper::FILTER_INT)], 'mail' => $this->getInput('formConfigMail'), @@ -163,9 +163,9 @@ class sondage extends common self::$data[] = [ $content, template::button('formDataDelete' . $dataIds[$i], [ - 'class' => 'formDataDelete red', + 'class' => 'formDataDelete buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $dataIds[$i] . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') + 'value' => template::ico('trash') ]) ]; } @@ -331,9 +331,9 @@ class sondage extends common { // Soumission du formulaire if ($this->isPost()) { - // Check la capcha + // Check la captcha if ( - $this->getData(['module', $this->getUrl(0), 'config', 'capcha']) + $this->getData(['module', $this->getUrl(0), 'config', 'captcha']) and $this->getInput('formCapcha', helper::FILTER_INT) !== $this->getInput('formCapchaFirstNumber', helper::FILTER_INT) + $this->getInput('formCapchaSecondNumber', helper::FILTER_INT) ) { self::$inputNotices['formCapcha'] = 'Incorrect'; diff --git a/sondage/view/config/config.php b/sondage/view/config/config.php index eeee308..307021b 100644 --- a/sondage/view/config/config.php +++ b/sondage/view/config/config.php @@ -45,18 +45,17 @@
-
+
'', + 'class' => 'buttonGrey', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
helper::baseUrl() . $this->getUrl(0) . '/data', - 'value' => 'Gérer les données' + 'value' => 'Réponses' ]); ?>
@@ -134,7 +133,7 @@
$this->getData(['module', $this->getUrl(0), 'config', 'capcha']) + 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha']) ]); ?>
diff --git a/sondage/view/data/data.php b/sondage/view/data/data.php index 2039172..d85c73e 100644 --- a/sondage/view/data/data.php +++ b/sondage/view/data/data.php @@ -1,22 +1,21 @@
-
+
'', + 'class' => 'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
- 'formDataDeleteAll red', +
+ 'formDataDeleteAll buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'], - 'ico' => 'cancel', + 'ico' => 'trash', 'value' => 'Tout effacer' ]); ?>
- 'blue', 'href' => helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'], 'ico' => 'download', @@ -24,12 +23,12 @@ ]); ?>
- - - - - - + + + + + +
Version n°
\ No newline at end of file diff --git a/sondage/view/index/index.php b/sondage/view/index/index.php index 3de963d..28401b7 100644 --- a/sondage/view/index/index.php +++ b/sondage/view/index/index.php @@ -38,10 +38,10 @@ ); ?> - getData(['module', $this->getUrl(0), 'config', 'capcha'])): ?> + getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
- +