Fix Captcha

This commit is contained in:
Fred Tempez 2024-08-29 06:23:29 +02:00
parent f2405afb9d
commit 9cda286db4
5 changed files with 28 additions and 30 deletions

View File

@ -1 +1 @@
{"name":"sondage","realName":"Sondage","version":"1.2","update":"0.0","delete":true,"dataDirectory":""} {"name":"sondage","realName":"Sondage","version":"1.3","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -89,7 +89,7 @@ class sondage extends common
'config', 'config',
[ [
'button' => $this->getInput('formConfigButton'), '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), 'group' => $this->getInput('formConfigGroup', helper::FILTER_INT),
'user' => self::$listUsers[$this->getInput('formConfigUser', helper::FILTER_INT)], 'user' => self::$listUsers[$this->getInput('formConfigUser', helper::FILTER_INT)],
'mail' => $this->getInput('formConfigMail'), 'mail' => $this->getInput('formConfigMail'),
@ -163,9 +163,9 @@ class sondage extends common
self::$data[] = [ self::$data[] = [
$content, $content,
template::button('formDataDelete' . $dataIds[$i], [ template::button('formDataDelete' . $dataIds[$i], [
'class' => 'formDataDelete red', 'class' => 'formDataDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $dataIds[$i] . '/' . $_SESSION['csrf'], '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 // Soumission du formulaire
if ($this->isPost()) { if ($this->isPost()) {
// Check la capcha // Check la captcha
if ( 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) and $this->getInput('formCapcha', helper::FILTER_INT) !== $this->getInput('formCapchaFirstNumber', helper::FILTER_INT) + $this->getInput('formCapchaSecondNumber', helper::FILTER_INT)
) { ) {
self::$inputNotices['formCapcha'] = 'Incorrect'; self::$inputNotices['formCapcha'] = 'Incorrect';

View File

@ -45,18 +45,17 @@
</div> </div>
<?php echo template::formOpen('formConfigForm'); ?> <?php echo template::formOpen('formConfigForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('formConfigBack', [ <?php echo template::button('formConfigBack', [
'class' => '', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col3 offset5"> <div class="col2 offset7">
<?php echo template::button('formConfigData', [ <?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data', 'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => 'Gérer les données' 'value' => 'Réponses'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
@ -134,7 +133,7 @@
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::checkbox('formConfigCapcha', true, 'Capcha à remplir pour soumettre le formulaire', [ <?php echo template::checkbox('formConfigCapcha', true, 'Capcha à remplir pour soumettre le formulaire', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'capcha']) 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">

View File

@ -1,17 +1,16 @@
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('formDataBack', [ <?php echo template::button('formDataBack', [
'class' => '', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset6"> <div class="col2 offset7">
<?php echo template::button('formDataDeleteAll', [ <?php echo template::button('formDataDeleteAll', [
'class' => 'formDataDeleteAll red', 'class' => 'formDataDeleteAll buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'],
'ico' => 'cancel', 'ico' => 'trash',
'value' => 'Tout effacer' 'value' => 'Tout effacer'
]); ?> ]); ?>
</div> </div>

View File

@ -38,10 +38,10 @@
); ?> ); ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($this->getData(['module', $this->getUrl(0), 'config', 'capcha'])): ?> <?php if($this->getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::capcha('formCapcha'); ?> <?php echo template::captcha('formCapcha'); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>