From 594d2796f3f12d9500a075f36a2de8df40aedb59 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Dec 2025 07:42:49 +0100 Subject: [PATCH 1/2] use new input addon to make password visible --- views/bootstrap/class.UsrMgr.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index 4db135402..ffb47a4d9 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -267,9 +267,30 @@ $(document).ready( function() { 'value'=>($currUser ? htmlspecialchars($currUser->getLogin()) : '') ) ); + if ($currUser && $currUser->isGuest()) { + $this->formField( + getMLText("clear_password"), + array( + 'element'=>'input', + 'type'=>'checkbox', + 'name'=>'clearpwd', + 'value'=>1, + ) + ); + } $this->formField( getMLText("password"), - ''.(($currUser && $currUser->isGuest()) ? ' '.getMLText('clear_password') : '') + array( + 'element'=>'input', + 'type'=>'password', + 'id'=>'pwd', + 'name'=>'pwd', + 'class'=>'pwd', + 'autocomplete'=>'off', + 'required'=>true, + 'attributes'=>[['rel', 'strengthbar'.($currUser ? $currUser->getID() : "0")]], + 'addon'=>'' + ) ); if($passwordstrength > 0) { $this->formField( @@ -284,6 +305,8 @@ $(document).ready( function() { 'type'=>'password', 'id'=>'pwdconf', 'name'=>'pwdconf', + 'autocomplete'=>'off', + 'addon'=>'' ) ); if($passwordexpiration > 0 && (!$currUser || !$currUser->isAdmin())) { @@ -618,4 +641,3 @@ $(document).ready( function() { $this->htmlEndPage(); } /* }}} */ } -?> From dfc80b823ebc6fb033abd6bdf8603af629df08b4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Dec 2025 07:43:21 +0100 Subject: [PATCH 2/2] simplify code --- op/op.UsrMgr.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/op/op.UsrMgr.php b/op/op.UsrMgr.php index cbb1a1a1c..ac5978f8f 100644 --- a/op/op.UsrMgr.php +++ b/op/op.UsrMgr.php @@ -346,10 +346,7 @@ else if ($action == "edituser") { $login = $_POST["login"]; $pwd = $_POST["pwd"]; - if(isset($_POST['clearpwd']) && $_POST['clearpwd']) - $clearpwd = 1; - else - $clearpwd = 0; + $clearpwd = (isset($_POST['clearpwd']) && $_POST['clearpwd']) ? true : false; if(isset($_POST["pwdexpiration"])) $pwdexpiration = $_POST["pwdexpiration"]; else