From 32f0e641a7b6ab0a5577410adf2d7a988d62bcd7 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 27 Jun 2023 16:18:43 +0800 Subject: [PATCH] * Add password strength tip. --- module/user/ui/create.html.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/module/user/ui/create.html.php b/module/user/ui/create.html.php index dfb3d56ca8..795877ba83 100644 --- a/module/user/ui/create.html.php +++ b/module/user/ui/create.html.php @@ -9,6 +9,9 @@ declare(strict_types=1); * @link https://www.zentao.net */ namespace zin; + +jsVar('passwordStrengthList', $lang->user->passwordStrengthList); + $visionList = $this->user->getVisionList(); $showVisionList = count($visionList) > 1; $passwordStrength = zget($lang->user->placeholder->passwordStrength, !empty($config->safe->mode) ? $config->safe->mode : 0, ''); @@ -108,9 +111,22 @@ formPanel ( set::width('1/2'), set::label($lang->user->password), - set::control('password'), - set::name('password1'), - set::value(''), + inputGroup + ( + input + ( + on::keyup('checkPassword'), + set::id('password1'), + set::name('password1'), + set::value(''), + set::placeholder(zget($lang->user->placeholder->passwordStrength, $config->safe->mode, '')), + ), + span + ( + setClass('input-group-addon hidden'), + set::id('passwordStrength'), + ), + ), set::tip($passwordStrength), set::tipClass('form-tip') )