From 58b4ca15c66d348f3fbdc89451c888d784a9ee2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 23 Dec 2024 15:33:09 +0100 Subject: [PATCH] =?UTF-8?q?Filtrage=20champ=20de=20saisie=20cl=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/user/view/auth/auth.css | 2 -- core/module/user/view/auth/auth.js.php | 33 ++++++++++++++++++++++++++ core/module/user/view/auth/auth.php | 10 ++++---- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 core/module/user/view/auth/auth.js.php diff --git a/core/module/user/view/auth/auth.css b/core/module/user/view/auth/auth.css index 343a686..6e9d4f2 100644 --- a/core/module/user/view/auth/auth.css +++ b/core/module/user/view/auth/auth.css @@ -12,8 +12,6 @@ * @link http://zwiicms.fr/ */ -/** @import url("site/data/admin.css"); */ - /** NE PAS EFFACER * admin.css */ diff --git a/core/module/user/view/auth/auth.js.php b/core/module/user/view/auth/auth.js.php new file mode 100644 index 0000000..006a79b --- /dev/null +++ b/core/module/user/view/auth/auth.js.php @@ -0,0 +1,33 @@ +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2025, Frédéric Tempez + * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International + * @link http://zwiicms.fr/ + */ + + +$(document).ready(function () { + $('#userAuthKey').on('input', function () { + // Récupère la valeur du champ + let input = $(this).val(); + + // Supprime tous les caractères non numériques + input = input.replace(/\D/g, ''); + + // Limite à 6 caractères maximum + if (input.length > 6) { + input = input.substring(0, 6); + } + + // Met à jour la valeur du champ + $(this).val(input); + }); +}); + diff --git a/core/module/user/view/auth/auth.php b/core/module/user/view/auth/auth.php index e301fda..1f87237 100644 --- a/core/module/user/view/auth/auth.php +++ b/core/module/user/view/auth/auth.php @@ -9,14 +9,14 @@
$this->getUrl(2) ? helper::baseUrl() . 'user/login/' . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))) : helper::baseUrl() . 'user/login', - 'value' => template::ico('left') + 'href' => $this->getUrl(2) ? helper::baseUrl() . 'user/login/' . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))) : helper::baseUrl() . 'user/login', + 'value' => template::ico('left') ]); ?>
-
+
template::ico('check'), - 'ico' => '', + 'value' => 'Connexion', + 'ico' => '' ]); ?>