From 7787ca328c0f147d0d77b13c5572e532045d0919 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Aug 2023 18:36:06 +0100 Subject: [PATCH] Try to prevent the browser from pre-filling the LDAP password Signed-off-by: snipe --- resources/views/settings/ldap.blade.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index b3070e13e1..016d54f48f 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -18,6 +18,15 @@ .checkbox label { padding-right: 40px; } + + /* + Don't make the password field *look* readonly - this is for usability, so admins don't think they can't edit this field. + */ + .form-control[readonly] { + background-color: white; + color: #555555; + cursor:text; + } @if ((!function_exists('ldap_connect')) || (!function_exists('ldap_set_option')) || (!function_exists('ldap_bind'))) @@ -34,10 +43,12 @@ @endif - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'false', 'class' => 'form-horizontal', 'role' => 'form']) }} + {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form']) }} {{csrf_field()}} + + @@ -54,7 +65,6 @@
-
@@ -230,7 +240,7 @@ {{ Form::label('ldap_uname', trans('admin/settings/general.ldap_uname')) }}
- {{ Form::text('ldap_uname', Request::old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','placeholder' => trans('general.example') .'binduser@example.com', $setting->demoMode]) }} + {{ Form::text('ldap_uname', Request::old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','autocomplete' => 'off', 'placeholder' => trans('general.example') .'binduser@example.com', $setting->demoMode]) }} {!! $errors->first('ldap_uname', '') !!} @if (config('app.lock_passwords')===true)

{{ trans('general.feature_disabled') }}

@@ -244,7 +254,7 @@ {{ Form::label('ldap_pword', trans('admin/settings/general.ldap_pword')) }}
- {{ Form::password('ldap_pword', ['class' => 'form-control','placeholder' => trans('general.example') .' binduserpassword', $setting->demoMode]) }} + {{ Form::password('ldap_pword', ['class' => 'form-control', 'autocomplete' => 'off', 'onfocus' => "this.removeAttribute('readonly');", $setting->demoMode, ' readonly']) }} {!! $errors->first('ldap_pword', '') !!} @if (config('app.lock_passwords')===true)

{{ trans('general.feature_disabled') }}

@@ -538,7 +548,7 @@
- +