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',
[
'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';

View File

@ -45,18 +45,17 @@
</div>
<?php echo template::formOpen('formConfigForm'); ?>
<div class="row">
<div class="col2">
<div class="col1">
<?php echo template::button('formConfigBack', [
'class' => '',
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left',
'value' => 'Retour'
'value' => template::ico('left')
]); ?>
</div>
<div class="col3 offset5">
<div class="col2 offset7">
<?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => 'Gérer les données'
'value' => 'Réponses'
]); ?>
</div>
<div class="col2">
@ -134,7 +133,7 @@
<div class="row">
<div class="col6">
<?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 class="col6">

View File

@ -1,22 +1,21 @@
<div class="row">
<div class="col2">
<div class="col1">
<?php echo template::button('formDataBack', [
'class' => '',
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::button('formDataDeleteAll', [
'class' => 'formDataDeleteAll red',
<div class="col2 offset7">
<?php echo template::button('formDataDeleteAll', [
'class' => 'formDataDeleteAll buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'],
'ico' => 'cancel',
'ico' => 'trash',
'value' => 'Tout effacer'
]); ?>
</div>
<div class="col2">
<?php echo template::button('formDataBack', [
<?php echo template::button('formDataBack', [
'class' => 'blue',
'href' => helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'],
'ico' => 'download',
@ -24,12 +23,12 @@
]); ?>
</div>
</div>
<?php if($module::$data): ?>
<?php echo template::table([11, 1], $module::$data, ['Réponses', '']); ?>
<?php echo $module::$pagination; ?>
<?php else: ?>
<?php echo template::speech('Aucune réponse !'); ?>
<?php endif; ?>
<?php if ($module::$data): ?>
<?php echo template::table([11, 1], $module::$data, ['Réponses', '']); ?>
<?php echo $module::$pagination; ?>
<?php else: ?>
<?php echo template::speech('Aucune réponse !'); ?>
<?php endif; ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
</div>

View File

@ -38,10 +38,10 @@
); ?>
<?php endif; ?>
<?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="col4">
<?php echo template::capcha('formCapcha'); ?>
<?php echo template::captcha('formCapcha'); ?>
</div>
</div>
<?php endif; ?>