From a6d99224953f23edeee79023cd23b020c026e7b4 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Mon, 19 Dec 2022 09:14:38 +0100 Subject: [PATCH] =?UTF-8?q?visibilit=C3=A9=20du=20mot=20de=20passe=20+=20s?= =?UTF-8?q?uite=20banniere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +- core/core.js.php | 30 ++++++++++--------- core/include/update.inc.php | 1 + core/module/config/config.php | 3 +- core/module/config/lang/en/lex_config.php | 2 ++ core/module/config/lang/fr/lex_config.php | 2 ++ core/module/config/view/connect/connect.php | 8 ++++- core/module/install/ressource/defaultdata.php | 3 +- core/module/theme/theme.php | 1 - core/module/user/view/login/login.css | 7 +++++ core/module/user/view/login/login.js.php | 9 +++++- core/module/user/view/login/login.php | 10 +++++-- 12 files changed, 57 insertions(+), 22 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9eb123b..9b27808 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,8 @@ ## Version 4.4.03 de Deltacms - Modifications : - - Nouvelle option pour la bannière : une bannière animée avec Swiper + - Thème / bannière : nouvelle option : une bannière animée avec Swiper, + - Configuration / connexion : nouvelle option permettant de dévoiler le mot de passe, - Corrections : ## Version 4.4.02 de Deltacms diff --git a/core/core.js.php b/core/core.js.php index d99b423..8e6df8e 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -555,22 +555,24 @@ $(document).ready(function(){ */ $(window).on("resize", function() { if( $(window).width() > 768 ){ - var page=[]; - if( 'getData(['theme', 'menu', 'minWidthParentOrAll']); ?>' === ''){ - page = parentPage; - // suppression d'un sous-menu depuis le dernier enregistrement de theme.css - $.each(allPage, function(index, value) { - // si la page n'est pas parent on repositionne min-width à auto - if( parentPage.includes( value ) === false ) $('nav li .' + value).css('min-width', 'auto'); + if( typeof parentPage !== "undefined" ){ + var page=[]; + if( 'getData(['theme', 'menu', 'minWidthParentOrAll']); ?>' === ''){ + page = parentPage; + // suppression d'un sous-menu depuis le dernier enregistrement de theme.css + $.each(allPage, function(index, value) { + // si la page n'est pas parent on repositionne min-width à auto + if( parentPage.includes( value ) === false ) $('nav li .' + value).css('min-width', 'auto'); + }); + } else{ + page = allPage; + } + $.each(page, function(index, value) { + $('nav li .' + value).css('min-width', 'getData(['theme', 'menu', 'minWidthTab']); ?>'); + $('nav li ul li .'+value).css('width', $('.'+value).css('width')); + $('nav li.' + value).css('text-align', 'left'); }); - } else{ - page = allPage; } - $.each(page, function(index, value) { - $('nav li .' + value).css('min-width', 'getData(['theme', 'menu', 'minWidthTab']); ?>'); - $('nav li ul li .'+value).css('width', $('.'+value).css('width')); - $('nav li.' + value).css('text-align', 'left'); - }); } }).trigger("resize"); diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 97f4025..12a43d8 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -98,6 +98,7 @@ if ($this->getData(['core', 'dataVersion']) < 4403) { $this->setData(['theme', 'header', 'swiperDirection', false]); $this->setData(['theme', 'header', 'swiperTime', '2000']); $this->setData(['theme', 'header', 'swiperTransition', '1000']); + $this->setData(['config', 'connect', 'passwordVisibility', false]); // Mise à jour $this->setData(['core', 'dataVersion', 4403]); } diff --git a/core/module/config/config.php b/core/module/config/config.php index dc423e9..a5e6792 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -428,7 +428,8 @@ class config extends common { 'anonymousIp' => $this->getInput('connectAnonymousIp',helper::FILTER_INT), 'captcha' => $this->getInput('connectCaptcha',helper::FILTER_BOOLEAN), 'captchaBot' => $this->getInput('connectCaptchaBot',helper::FILTER_BOOLEAN), - 'autoDisconnect' => $this->getInput('connectAutoDisconnect',helper::FILTER_BOOLEAN) + 'autoDisconnect' => $this->getInput('connectAutoDisconnect',helper::FILTER_BOOLEAN), + 'passwordVisibility' => $this->getInput('connectPasswordVisibility',helper::FILTER_BOOLEAN) ], 'i18n' => [ 'enable' => $this->getInput('localei18n',helper::FILTER_BOOLEAN), diff --git a/core/module/config/lang/en/lex_config.php b/core/module/config/lang/en/lex_config.php index 9e12864..be2e617 100644 --- a/core/module/config/lang/en/lex_config.php +++ b/core/module/config/lang/en/lex_config.php @@ -34,6 +34,8 @@ $text['core_config_view']['connect'][16] = 'French regulations require level 2 a $text['core_config_view']['connect'][17] = 'Download log'; $text['core_config_view']['connect'][18] = 'Reset log'; $text['core_config_view']['connect'][19] = 'Simple Captcha for humans'; +$text['core_config_view']['connect'][20] = 'Password visibility'; +$text['core_config_view']['connect'][21] = 'Hovering over an icon reveals the password'; $text['core_config_view']['index'][0] = 'Home'; $text['core_config_view']['index'][1] = 'Help'; $text['core_config_view']['index'][2] = 'Configuration'; diff --git a/core/module/config/lang/fr/lex_config.php b/core/module/config/lang/fr/lex_config.php index 6436503..bcc32af 100644 --- a/core/module/config/lang/fr/lex_config.php +++ b/core/module/config/lang/fr/lex_config.php @@ -34,6 +34,8 @@ $text['core_config_view']['connect'][16] = 'La réglementation française impose $text['core_config_view']['connect'][17] = 'Télécharger le journal'; $text['core_config_view']['connect'][18] = 'Réinitialiser le journal'; $text['core_config_view']['connect'][19] = 'Captcha simple pour les humains'; +$text['core_config_view']['connect'][20] = 'Visibilité du mot de passe'; +$text['core_config_view']['connect'][21] = 'Le survol d\'une icône dévoile le mot de passe'; $text['core_config_view']['index'][0] = 'Accueil'; $text['core_config_view']['index'][1] = 'Aide'; $text['core_config_view']['index'][2] = 'Configuration'; diff --git a/core/module/config/view/connect/connect.php b/core/module/config/view/connect/connect.php index 0df900e..7c1ec13 100644 --- a/core/module/config/view/connect/connect.php +++ b/core/module/config/view/connect/connect.php @@ -19,12 +19,18 @@ include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdm 'checked' => $this->getData(['config', 'connect','captcha']) ]); ?> -
+
$this->getData(['config', 'connect', 'captchaBot']), 'help' => $text['core_config_view']['connect'][3] ]); ?>
+
+ $this->getData(['config', 'connect', 'passwordVisibility']), + 'help' => $text['core_config_view']['connect'][21] + ]); ?> +
$this->getData(['config','connect', 'autoDisconnect']), diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index f8c72c9..04588ae 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -38,7 +38,8 @@ class init extends common { 'log' => false, 'anonymousIp' => 2, 'captcha' => true, - 'captchaBot' => true + 'captchaBot' => true, + 'passwordVisibility' => false ], 'i18n' => [ 'enable'=> true, diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 2e2e39d..35b4ba8 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -994,7 +994,6 @@ class theme extends common { heightMod = heightImg * ( widthMod / widthImg ); $(".swiper-wrapper").css("width", widthMod); $(".swiper-wrapper").css("height", heightMod); - console.log( widthSite +" * " + wclient +" ** " + widthMod + " - " + heightMod); } $.wrapper(); $(window).resize(function(){ diff --git a/core/module/user/view/login/login.css b/core/module/user/view/login/login.css index 5b5fba8..5aea785 100644 --- a/core/module/user/view/login/login.css +++ b/core/module/user/view/login/login.css @@ -17,4 +17,11 @@ .userInner{ display: inline-block; +} + +#passwordLabel, #passwordIcon { + display: inline-flex; +} +#passwordIcon { + float: right; } \ No newline at end of file diff --git a/core/module/user/view/login/login.js.php b/core/module/user/view/login/login.js.php index 83b73d2..39d28fc 100644 --- a/core/module/user/view/login/login.js.php +++ b/core/module/user/view/login/login.js.php @@ -13,7 +13,14 @@ * @author Frédéric Tempez * @copyright Copyright (C) 2018-2021, Frédéric Tempez */ - + +/* Visibilité du mot de passe */ +$(".zwiico-eye").mouseenter(function() { + $("#userLoginPassword").attr("type","text"); +}); +$(".zwiico-eye").mouseleave(function() { + $("#userLoginPassword").attr("type","password"); +}); /* Création et mise à jour du cookie sur modification d'un input */ $( ".humanBot" ).mouseleave(function() { diff --git a/core/module/user/view/login/login.php b/core/module/user/view/login/login.php index ceaa554..384b73c 100644 --- a/core/module/user/view/login/login.php +++ b/core/module/user/view/login/login.php @@ -12,8 +12,14 @@ echo template::formOpen('userLoginForm'); ]); ?>
- $text['core_user_view']['login'][1] + getData(['config', 'connect', 'passwordVisibility']) === true){ + $passwordLabel = ''. $text['core_user_view']['login'][1] .'' . template::ico('eye') . ''; + } else { + $passwordLabel = $text['core_user_view']['login'][1]; + } + echo template::password('userLoginPassword', [ + 'label' => $passwordLabel ]); ?>