init pour test

This commit is contained in:
Fred Tempez 2021-11-12 18:22:06 +01:00
parent ded4ed6052
commit 6280e606b8
50 changed files with 36 additions and 13 deletions

View File

@ -47,7 +47,8 @@ class template {
'id' => $nameId,
'name' => $nameId,
'value' => '',
'limit' => false // captcha simple
'limit' => false, // captcha simple
'type'=> 'num' // num(érique) ou alpha(bétique)
], $attributes);
// Captcha quatre opérations
@ -114,14 +115,15 @@ class template {
$secondLetter = uniqid();
// Masquage image source pour éviter un décodage
copy ('core/vendor/zwiico/png/'.$letters[$firstNumber] . '.png', 'site/tmp/' . $firstLetter . '.png');
copy ('core/vendor/zwiico/png/'.$letters[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.png');
copy ('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$firstNumber] . '.png', 'site/tmp/' . $firstLetter . '.png');
copy ('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.png');
// Début du wrapper
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="captcha inputWrapper ' . $attributes['classWrapper'] . '">';
// Label
$html .= self::label($attributes['id'],
'<img src="' . helper::baseUrl(false) . 'site/tmp/' . $firstLetter . '.png" />&nbsp;<strong>' . $operator . '</strong>&nbsp;<img class="captchaNumber" src="' . helper::baseUrl(false) . 'site/tmp/' . $secondLetter . '.png" /> en chiffres ?', [
'<img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $firstLetter . '.png" />&nbsp;<strong>' . $operator . '</strong>&nbsp;<img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $secondLetter . '.png" /> en chiffres ?', [
'help' => $attributes['help']
]);

View File

@ -1660,8 +1660,15 @@ th.col12 {
/* Captcha
*/
.captcha img {
height: 30px;
.captchaNum {
height: 50px;
vertical-align: middle;
padding-left: 10px;
padding-right: 10px;
}
.captchaAlpha {
height: 65px;
vertical-align: middle;
padding-left: 10px;
padding-right: 10px;

View File

@ -184,7 +184,10 @@ class config extends common {
2 => 'Niveau 2 (192.168.x.x)',
1 => 'Niveau 3 (192.x.x.x)',
];
public static $captchaTypes = [
'num' => 'Chiffres',
'alpha' => 'Lettres'
];
// Langue traduite courante
public static $i18nSite = 'fr';
@ -485,6 +488,7 @@ class config extends common {
'captcha' => $this->getInput('connectCaptcha',helper::FILTER_BOOLEAN),
'captchaStrong' => $this->getInput('connectCaptchaStrong',helper::FILTER_BOOLEAN),
'autoDisconnect' => $this->getInput('connectAutoDisconnect',helper::FILTER_BOOLEAN),
'captchaType' => $this->getInput('connectCaptchaType')
],
'i18n' => [
'enable' => $this->getInput('localei18n',helper::FILTER_BOOLEAN),

View File

@ -10,18 +10,24 @@
</span>
</h4>
<div class="row">
<div class="col4">
<div class="col3">
<?php echo template::checkbox('connectCaptcha', true, 'Captcha à la connexion', [
'checked' => $this->getData(['config', 'connect','captcha'])
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::checkbox('connectCaptchaStrong', true, 'Captcha complexe', [
'checked' => $this->getData(['config', 'connect', 'captchaStrong']),
'help' => 'Option recommandée pour sécuriser la connexion. S\'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.'
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::select('connectCaptchaType', $module::$captchaTypes , [
'label' => 'Type de captcha',
'selected' => $this->getData(['config', 'connect', 'captchaType'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('connectAutoDisconnect', true, 'Déconnexion automatique', [
'checked' => $this->getData(['config','connect', 'autoDisconnect']),
'help' => 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.'

View File

@ -36,6 +36,7 @@ class init extends common {
'anonymousIp' => 2,
'captcha' => true,
'captchaStrong' => false,
"captchaType" => 'num',
'autoDisconnect' => true
],
'i18n' => [

View File

@ -16,7 +16,8 @@
<div class="row">
<div class="col12 textAlignCenter">
<?php echo template::captcha('userLoginCaptcha', [
'limit' => $this->getData(['config','connect', 'captchaStrong'])
'limit' => $this->getData(['config','connect', 'captchaStrong']),
'type' => $this->getData(['config','connect', 'captchaType'])
]); ?>
</div>
</div>

BIN
core/vendor/zwiico/png/alpha/a.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
core/vendor/zwiico/png/alpha/b.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
core/vendor/zwiico/png/alpha/c.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
core/vendor/zwiico/png/alpha/d.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
core/vendor/zwiico/png/alpha/e.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
core/vendor/zwiico/png/alpha/f.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
core/vendor/zwiico/png/alpha/g.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
core/vendor/zwiico/png/alpha/h.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
core/vendor/zwiico/png/alpha/i.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
core/vendor/zwiico/png/alpha/j.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
core/vendor/zwiico/png/alpha/k.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
core/vendor/zwiico/png/alpha/l.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
core/vendor/zwiico/png/alpha/m.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
core/vendor/zwiico/png/alpha/n.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
core/vendor/zwiico/png/alpha/o.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
core/vendor/zwiico/png/alpha/p.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
core/vendor/zwiico/png/alpha/q.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

BIN
core/vendor/zwiico/png/alpha/r.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
core/vendor/zwiico/png/alpha/s.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
core/vendor/zwiico/png/alpha/t.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
core/vendor/zwiico/png/alpha/u.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

0
core/vendor/zwiico/png/a.png → core/vendor/zwiico/png/num/a.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
core/vendor/zwiico/png/b.png → core/vendor/zwiico/png/num/b.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
core/vendor/zwiico/png/c.png → core/vendor/zwiico/png/num/c.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
core/vendor/zwiico/png/d.png → core/vendor/zwiico/png/num/d.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
core/vendor/zwiico/png/e.png → core/vendor/zwiico/png/num/e.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
core/vendor/zwiico/png/f.png → core/vendor/zwiico/png/num/f.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
core/vendor/zwiico/png/g.png → core/vendor/zwiico/png/num/g.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

0
core/vendor/zwiico/png/h.png → core/vendor/zwiico/png/num/h.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
core/vendor/zwiico/png/i.png → core/vendor/zwiico/png/num/i.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
core/vendor/zwiico/png/j.png → core/vendor/zwiico/png/num/j.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
core/vendor/zwiico/png/k.png → core/vendor/zwiico/png/num/k.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
core/vendor/zwiico/png/l.png → core/vendor/zwiico/png/num/l.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
core/vendor/zwiico/png/m.png → core/vendor/zwiico/png/num/m.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

0
core/vendor/zwiico/png/n.png → core/vendor/zwiico/png/num/n.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
core/vendor/zwiico/png/o.png → core/vendor/zwiico/png/num/o.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
core/vendor/zwiico/png/p.png → core/vendor/zwiico/png/num/p.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

0
core/vendor/zwiico/png/q.png → core/vendor/zwiico/png/num/q.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
core/vendor/zwiico/png/r.png → core/vendor/zwiico/png/num/r.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

0
core/vendor/zwiico/png/s.png → core/vendor/zwiico/png/num/s.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

0
core/vendor/zwiico/png/t.png → core/vendor/zwiico/png/num/t.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

0
core/vendor/zwiico/png/u.png → core/vendor/zwiico/png/num/u.png vendored Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -116,7 +116,8 @@
<div class="row">
<div class="col12">
<?php echo template::captcha('blogArticleCaptcha', [
'limit' => $this->getData(['config','connect', 'captchaStrong'])
'limit' => $this->getData(['config','connect', 'captchaStrong']),
'type' => $this->getData(['config','connect', 'captchaType'])
]); ?>
</div>
</div>

View File

@ -47,7 +47,8 @@
<div class="row">
<div class="col12 textAlignCenter">
<?php echo template::captcha('formCaptcha', [
'limit' => $this->getData(['config','connect', 'captchaStrong'])
'limit' => $this->getData(['config','connect', 'captchaStrong']),
'type' => $this->getData(['config','connect', 'captchaType'])
]); ?>
</div>
</div>