diff --git a/core/class/template.class.php b/core/class/template.class.php index ff0b7ce6..7e7ff879 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -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 = '
'; // Label $html .= self::label($attributes['id'], - ' ' . $operator . '  en chiffres ?', [ + ' ' . $operator . '  en chiffres ?', [ 'help' => $attributes['help'] ]); diff --git a/core/layout/common.css b/core/layout/common.css index ba135c73..fad64e3f 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -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; diff --git a/core/module/config/config.php b/core/module/config/config.php index 7547a112..38ff3d51 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -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), diff --git a/core/module/config/view/connect/connect.php b/core/module/config/view/connect/connect.php index b02198e5..1c618999 100644 --- a/core/module/config/view/connect/connect.php +++ b/core/module/config/view/connect/connect.php @@ -10,18 +10,24 @@
-
+
$this->getData(['config', 'connect','captcha']) ]); ?>
-
+
$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.' ]); ?>
-
+
+ 'Type de captcha', + 'selected' => $this->getData(['config', 'connect', 'captchaType']) + ]); ?> +
+
$this->getData(['config','connect', 'autoDisconnect']), 'help' => 'Déconnecte les sessions ouvertes précédemment sur d\'autres navigateurs ou terminaux. Activation recommandée.' diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 149725e6..3c3145f8 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -36,6 +36,7 @@ class init extends common { 'anonymousIp' => 2, 'captcha' => true, 'captchaStrong' => false, + "captchaType" => 'num', 'autoDisconnect' => true ], 'i18n' => [ diff --git a/core/module/user/view/login/login.php b/core/module/user/view/login/login.php index 2e6363ea..c0e0732f 100644 --- a/core/module/user/view/login/login.php +++ b/core/module/user/view/login/login.php @@ -16,7 +16,8 @@
$this->getData(['config','connect', 'captchaStrong']) + 'limit' => $this->getData(['config','connect', 'captchaStrong']), + 'type' => $this->getData(['config','connect', 'captchaType']) ]); ?>
diff --git a/core/vendor/zwiico/png/alpha/a.png b/core/vendor/zwiico/png/alpha/a.png new file mode 100644 index 00000000..a9b6726c Binary files /dev/null and b/core/vendor/zwiico/png/alpha/a.png differ diff --git a/core/vendor/zwiico/png/alpha/b.png b/core/vendor/zwiico/png/alpha/b.png new file mode 100644 index 00000000..fee7c021 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/b.png differ diff --git a/core/vendor/zwiico/png/alpha/c.png b/core/vendor/zwiico/png/alpha/c.png new file mode 100644 index 00000000..2208fe51 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/c.png differ diff --git a/core/vendor/zwiico/png/alpha/d.png b/core/vendor/zwiico/png/alpha/d.png new file mode 100644 index 00000000..879ec3e4 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/d.png differ diff --git a/core/vendor/zwiico/png/alpha/e.png b/core/vendor/zwiico/png/alpha/e.png new file mode 100644 index 00000000..f3e67e01 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/e.png differ diff --git a/core/vendor/zwiico/png/alpha/f.png b/core/vendor/zwiico/png/alpha/f.png new file mode 100644 index 00000000..e6593515 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/f.png differ diff --git a/core/vendor/zwiico/png/alpha/g.png b/core/vendor/zwiico/png/alpha/g.png new file mode 100644 index 00000000..cba1212e Binary files /dev/null and b/core/vendor/zwiico/png/alpha/g.png differ diff --git a/core/vendor/zwiico/png/alpha/h.png b/core/vendor/zwiico/png/alpha/h.png new file mode 100644 index 00000000..ee1437dc Binary files /dev/null and b/core/vendor/zwiico/png/alpha/h.png differ diff --git a/core/vendor/zwiico/png/alpha/i.png b/core/vendor/zwiico/png/alpha/i.png new file mode 100644 index 00000000..09dac6ba Binary files /dev/null and b/core/vendor/zwiico/png/alpha/i.png differ diff --git a/core/vendor/zwiico/png/alpha/j.png b/core/vendor/zwiico/png/alpha/j.png new file mode 100644 index 00000000..2dd0ada1 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/j.png differ diff --git a/core/vendor/zwiico/png/alpha/k.png b/core/vendor/zwiico/png/alpha/k.png new file mode 100644 index 00000000..3bffa77a Binary files /dev/null and b/core/vendor/zwiico/png/alpha/k.png differ diff --git a/core/vendor/zwiico/png/alpha/l.png b/core/vendor/zwiico/png/alpha/l.png new file mode 100644 index 00000000..793ed531 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/l.png differ diff --git a/core/vendor/zwiico/png/alpha/m.png b/core/vendor/zwiico/png/alpha/m.png new file mode 100644 index 00000000..d1a95f78 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/m.png differ diff --git a/core/vendor/zwiico/png/alpha/n.png b/core/vendor/zwiico/png/alpha/n.png new file mode 100644 index 00000000..344df248 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/n.png differ diff --git a/core/vendor/zwiico/png/alpha/o.png b/core/vendor/zwiico/png/alpha/o.png new file mode 100644 index 00000000..2bb10649 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/o.png differ diff --git a/core/vendor/zwiico/png/alpha/p.png b/core/vendor/zwiico/png/alpha/p.png new file mode 100644 index 00000000..1d31afc1 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/p.png differ diff --git a/core/vendor/zwiico/png/alpha/q.png b/core/vendor/zwiico/png/alpha/q.png new file mode 100644 index 00000000..bf46e2c4 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/q.png differ diff --git a/core/vendor/zwiico/png/alpha/r.png b/core/vendor/zwiico/png/alpha/r.png new file mode 100644 index 00000000..ed99bf15 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/r.png differ diff --git a/core/vendor/zwiico/png/alpha/s.png b/core/vendor/zwiico/png/alpha/s.png new file mode 100644 index 00000000..ed3f7fce Binary files /dev/null and b/core/vendor/zwiico/png/alpha/s.png differ diff --git a/core/vendor/zwiico/png/alpha/t.png b/core/vendor/zwiico/png/alpha/t.png new file mode 100644 index 00000000..966f682d Binary files /dev/null and b/core/vendor/zwiico/png/alpha/t.png differ diff --git a/core/vendor/zwiico/png/alpha/u.png b/core/vendor/zwiico/png/alpha/u.png new file mode 100644 index 00000000..60f5b423 Binary files /dev/null and b/core/vendor/zwiico/png/alpha/u.png differ diff --git a/core/vendor/zwiico/png/a.png b/core/vendor/zwiico/png/num/a.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/a.png rename to core/vendor/zwiico/png/num/a.png diff --git a/core/vendor/zwiico/png/b.png b/core/vendor/zwiico/png/num/b.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/b.png rename to core/vendor/zwiico/png/num/b.png diff --git a/core/vendor/zwiico/png/c.png b/core/vendor/zwiico/png/num/c.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/c.png rename to core/vendor/zwiico/png/num/c.png diff --git a/core/vendor/zwiico/png/d.png b/core/vendor/zwiico/png/num/d.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/d.png rename to core/vendor/zwiico/png/num/d.png diff --git a/core/vendor/zwiico/png/e.png b/core/vendor/zwiico/png/num/e.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/e.png rename to core/vendor/zwiico/png/num/e.png diff --git a/core/vendor/zwiico/png/f.png b/core/vendor/zwiico/png/num/f.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/f.png rename to core/vendor/zwiico/png/num/f.png diff --git a/core/vendor/zwiico/png/g.png b/core/vendor/zwiico/png/num/g.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/g.png rename to core/vendor/zwiico/png/num/g.png diff --git a/core/vendor/zwiico/png/h.png b/core/vendor/zwiico/png/num/h.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/h.png rename to core/vendor/zwiico/png/num/h.png diff --git a/core/vendor/zwiico/png/i.png b/core/vendor/zwiico/png/num/i.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/i.png rename to core/vendor/zwiico/png/num/i.png diff --git a/core/vendor/zwiico/png/j.png b/core/vendor/zwiico/png/num/j.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/j.png rename to core/vendor/zwiico/png/num/j.png diff --git a/core/vendor/zwiico/png/k.png b/core/vendor/zwiico/png/num/k.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/k.png rename to core/vendor/zwiico/png/num/k.png diff --git a/core/vendor/zwiico/png/l.png b/core/vendor/zwiico/png/num/l.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/l.png rename to core/vendor/zwiico/png/num/l.png diff --git a/core/vendor/zwiico/png/m.png b/core/vendor/zwiico/png/num/m.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/m.png rename to core/vendor/zwiico/png/num/m.png diff --git a/core/vendor/zwiico/png/n.png b/core/vendor/zwiico/png/num/n.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/n.png rename to core/vendor/zwiico/png/num/n.png diff --git a/core/vendor/zwiico/png/o.png b/core/vendor/zwiico/png/num/o.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/o.png rename to core/vendor/zwiico/png/num/o.png diff --git a/core/vendor/zwiico/png/p.png b/core/vendor/zwiico/png/num/p.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/p.png rename to core/vendor/zwiico/png/num/p.png diff --git a/core/vendor/zwiico/png/q.png b/core/vendor/zwiico/png/num/q.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/q.png rename to core/vendor/zwiico/png/num/q.png diff --git a/core/vendor/zwiico/png/r.png b/core/vendor/zwiico/png/num/r.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/r.png rename to core/vendor/zwiico/png/num/r.png diff --git a/core/vendor/zwiico/png/s.png b/core/vendor/zwiico/png/num/s.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/s.png rename to core/vendor/zwiico/png/num/s.png diff --git a/core/vendor/zwiico/png/t.png b/core/vendor/zwiico/png/num/t.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/t.png rename to core/vendor/zwiico/png/num/t.png diff --git a/core/vendor/zwiico/png/u.png b/core/vendor/zwiico/png/num/u.png old mode 100755 new mode 100644 similarity index 100% rename from core/vendor/zwiico/png/u.png rename to core/vendor/zwiico/png/num/u.png diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index d6523d8a..7f157e35 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -116,7 +116,8 @@
$this->getData(['config','connect', 'captchaStrong']) + 'limit' => $this->getData(['config','connect', 'captchaStrong']), + 'type' => $this->getData(['config','connect', 'captchaType']) ]); ?>
diff --git a/module/form/view/index/index.php b/module/form/view/index/index.php index ade838e2..6eba5cc9 100644 --- a/module/form/view/index/index.php +++ b/module/form/view/index/index.php @@ -47,7 +47,8 @@
$this->getData(['config','connect', 'captchaStrong']) + 'limit' => $this->getData(['config','connect', 'captchaStrong']), + 'type' => $this->getData(['config','connect', 'captchaType']) ]); ?>