From b7818ea1c135ef521939319caf6bdffcd557f52a Mon Sep 17 00:00:00 2001 From: Pawel Boguslawski Date: Sat, 28 Aug 2021 12:11:03 +0200 Subject: [PATCH 1/2] Hide all password fields when backend without db pass is used When using auth backend that does not require password from db (i.e. basic auth) Znuny hides correctly password input in agent and customer preferences (Kernel/Output/HTML/Preferences/Password.pm) but does not hide password fields in AdminUser nor AdminCustomerUser screens. This mod hides password fields on these screens also. Author-Change-Id: IB#1110411 --- CHANGES.md | 3 +++ Kernel/Modules/AdminCustomerUser.pm | 6 ++++++ Kernel/Modules/AdminUser.pm | 6 ++++++ Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt | 3 +++ Kernel/Output/HTML/Templates/Standard/AdminUser.tt | 3 +++ 5 files changed, 21 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e84cd1797d8..00e8871c634 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +# 6.5.2 ????-??-?? + - 2023-04-26 All password fields hidden when backend without db pass is used. + # 6.5.1 2023-03-09 - 2023-02-28 Added options tickets-created-before-date and tickets-created-before-days to console command Admin::Article::StorageSwitch. - 2023-02-28 Fixed encoding of postmaster filter name in AdminPostMasterFilter. diff --git a/Kernel/Modules/AdminCustomerUser.pm b/Kernel/Modules/AdminCustomerUser.pm index 588680ce3f5..74c21749701 100644 --- a/Kernel/Modules/AdminCustomerUser.pm +++ b/Kernel/Modules/AdminCustomerUser.pm @@ -1,6 +1,7 @@ # -- # Copyright (C) 2001-2021 OTRS AG, https://otrs.com/ # Copyright (C) 2021 Znuny GmbH, https://znuny.org/ +# Copyright (C) 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you @@ -1086,6 +1087,11 @@ sub _Edit { $UpdateOnlyPreferences = 1; } + # Hide password field if backend that does not require password from db it is enabled. + if ( $ConfigObject->Get('Customer::AuthModule') =~ /(LDAP|HTTPBasicAuth|Radius)/i ) { + $Param{PwHidden} = 1; + } + # Get dynamic field backend object. my $DynamicFieldBackendObject = $Kernel::OM->Get('Kernel::System::DynamicField::Backend'); my $ParamObject = $Kernel::OM->Get('Kernel::System::Web::Request'); diff --git a/Kernel/Modules/AdminUser.pm b/Kernel/Modules/AdminUser.pm index a6f4d24e95f..965f4c705b3 100644 --- a/Kernel/Modules/AdminUser.pm +++ b/Kernel/Modules/AdminUser.pm @@ -1,6 +1,7 @@ # -- # Copyright (C) 2001-2021 OTRS AG, https://otrs.com/ # Copyright (C) 2021 Znuny GmbH, https://znuny.org/ +# Copyright (C) 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you @@ -454,6 +455,11 @@ sub _Edit { } } + # Hide password field if backend that does not require password from db it is enabled. + if ( $Kernel::OM->Get('Kernel::Config')->Get('AuthModule') =~ /(LDAP|HTTPBasicAuth|Radius)/i ) { + $Param{PwHidden} = 1; + } + # get valid list my %ValidList = $Kernel::OM->Get('Kernel::System::Valid')->ValidList(); my %ValidListReverse = reverse %ValidList; diff --git a/Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt b/Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt index 969da0e4cd8..f408952ea36 100644 --- a/Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt +++ b/Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt @@ -1,6 +1,7 @@ # -- # Copyright (C) 2001-2021 OTRS AG, https://otrs.com/ # Copyright (C) 2021 Znuny GmbH, https://znuny.org/ +# Copyright (C) 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you @@ -256,6 +257,7 @@
[% RenderBlockEnd("PreferencesGenericInput") %] +[% IF !Data.PwHidden %] [% RenderBlockStart("PreferencesGenericPassword") %]
@@ -265,6 +267,7 @@
[% RenderBlockEnd("PreferencesGenericPassword") %] +[% END %] [% RenderBlockStart("PreferencesGenericOption") %]
diff --git a/Kernel/Output/HTML/Templates/Standard/AdminUser.tt b/Kernel/Output/HTML/Templates/Standard/AdminUser.tt index 4e18b03952f..835e66e6235 100644 --- a/Kernel/Output/HTML/Templates/Standard/AdminUser.tt +++ b/Kernel/Output/HTML/Templates/Standard/AdminUser.tt @@ -1,6 +1,7 @@ # -- # Copyright (C) 2001-2021 OTRS AG, https://otrs.com/ # Copyright (C) 2021 Znuny GmbH, https://znuny.org/ +# Copyright (C) 2021 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you @@ -237,6 +238,7 @@
+[% IF !Data.PwHidden %]