Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide all password fields when backend without db pass is used #404

Open
wants to merge 2 commits into
base: rel-6_5-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Kernel/Modules/AdminCustomerUser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,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');
Expand Down
5 changes: 5 additions & 0 deletions Kernel/Modules/AdminUser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,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;
Expand Down
2 changes: 2 additions & 0 deletions Kernel/Output/HTML/Templates/Standard/AdminCustomerUser.tt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
</div>
<div class="Clear"></div>
[% RenderBlockEnd("PreferencesGenericInput") %]
[% IF !Data.PwHidden %]
[% RenderBlockStart("PreferencesGenericPassword") %]
<label class="[% Data.RequiredLabelClass | html %]" for="[% Data.Name | html %]"><span class="Marker">[% Data.RequiredLabelCharacter | html %]</span> [% Translate(Data.Item) | html %]:</label>
<div class="Field">
Expand All @@ -265,6 +266,7 @@
</div>
<div class="Clear"></div>
[% RenderBlockEnd("PreferencesGenericPassword") %]
[% END %]
[% RenderBlockStart("PreferencesGenericOption") %]
<label class="[% Data.RequiredLabelClass | html %]" for="[% Data.Name | html %]"><span class="Marker">[% Data.RequiredLabelCharacter | html %]</span> [% Translate(Data.Item) | html %]:</label>
<div class="Field">
Expand Down
2 changes: 2 additions & 0 deletions Kernel/Output/HTML/Templates/Standard/AdminUser.tt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
</div>
</div>
<div class="Clear"></div>
[% IF !Data.PwHidden %]

<label for="UserPw">
[% Translate("Password") | html %]:
Expand All @@ -250,6 +251,7 @@
[% RenderBlockEnd("ShowPasswordHint") %]
</div>
<div class="Clear"></div>
[% END %]

<label class="Mandatory" for="UserEmail"><span class="Marker">*</span> [% Translate("Email") | html %]:</label>
<div class="Field">
Expand Down