From dafac4ceb3f2263481eee8063d2872d6baea865b Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 25 Sep 2020 19:04:38 -0700 Subject: [PATCH] Disable ldap_enabled on demo, fixed some incorrect error messages --- resources/views/settings/ldap.blade.php | 84 ++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index d265137615..a4310e4388 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -63,9 +63,12 @@ {{ Form::label('ldap_integration', trans('admin/settings/general.ldap_integration')) }}
- {{ Form::checkbox('ldap_enabled', '1', Request::old('ldap_enabled', $setting->ldap_enabled), ['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} + + {{ Form::checkbox('ldap_enabled', '1', Request::old('ldap_enabled', $setting->ldap_enabled), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ trans('admin/settings/general.ldap_enabled') }} - {!! $errors->first('ldap_enabled', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -75,10 +78,16 @@ {{ Form::label('ldap_pw_sync', trans('admin/settings/general.ldap_pw_sync')) }}
- {{ Form::checkbox('ldap_pw_sync', '1', Request::old('ldap_pw_sync', $setting->ldap_pw_sync),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} + + {{ Form::checkbox('ldap_pw_sync', '1', Request::old('ldap_pw_sync', $setting->ldap_pw_sync), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ trans('general.yes') }} +

{{ trans('admin/settings/general.ldap_pw_sync_help') }}

- {!! $errors->first('is_ad', '') !!} + {!! $errors->first('ldap_pw_sync_help', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif +
@@ -88,9 +97,13 @@ {{ Form::label('is_ad', trans('admin/settings/general.ad')) }}
- {{ Form::checkbox('is_ad', '1', Request::old('is_ad', $setting->is_ad),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} + {{ Form::checkbox('is_ad', '1', Request::old('is_ad', $setting->is_ad), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ trans('admin/settings/general.is_ad') }} - {!! $errors->first('ldap_pw_sync', '') !!} + {!! $errors->first('is_ad', '') !!} + + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -103,6 +116,9 @@ {{ Form::text('ad_domain', Request::old('ad_domain', $setting->ad_domain), ['class' => 'form-control','placeholder' => 'example.com', $setting->demoMode]) }}

{{ trans('admin/settings/general.ad_domain_help') }}

{!! $errors->first('ad_domain', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif @@ -115,7 +131,10 @@ {{ Form::checkbox('ad_append_domain', '1', Request::old('ad_append_domain', $setting->ad_append_domain),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ trans('admin/settings/general.ad_append_domain') }}

{{ trans('admin/settings/general.ad_append_domain_help') }}

- {!! $errors->first('is_ad', ':message') !!} + {!! $errors->first('ad_append_domain', ':message') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif @@ -128,6 +147,9 @@ {{ Form::text('ldap_server', Request::old('ldap_server', $setting->ldap_server), ['class' => 'form-control','placeholder' => 'ldap://ldap.example.com', $setting->demoMode]) }}

{{ trans('admin/settings/general.ldap_server_help') }}

{!! $errors->first('ldap_server', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif @@ -140,6 +162,9 @@ {{ Form::checkbox('ldap_tls', '1', Request::old('ldap_tls', $setting->ldap_tls),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ trans('admin/settings/general.ldap_tls_help') }} {!! $errors->first('ldap_tls', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif @@ -153,6 +178,9 @@ {{ trans('admin/settings/general.ldap_server_cert_ignore') }} {!! $errors->first('ldap_server_cert_ignore', '') !!}

{{ trans('admin/settings/general.ldap_server_cert_help') }}

+ @if (config('app.lock_passwords')===true) +

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

+ @endif @@ -164,6 +192,9 @@
{{ Form::text('ldap_uname', Request::old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','placeholder' => 'binduser@example.com', $setting->demoMode]) }} {!! $errors->first('ldap_uname', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -175,6 +206,9 @@
{{ Form::password('ldap_pword', ['class' => 'form-control','placeholder' => 'binduserpassword', $setting->demoMode]) }} {!! $errors->first('ldap_pword', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -186,6 +220,9 @@
{{ Form::text('ldap_basedn', Request::old('ldap_basedn', $setting->ldap_basedn), ['class' => 'form-control', 'placeholder' => 'cn=users/authorized,dc=example,dc=com', $setting->demoMode]) }} {!! $errors->first('ldap_basedn', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -197,6 +234,9 @@
{{ Form::text('ldap_filter', Request::old('ldap_filter', $setting->ldap_filter), ['class' => 'form-control','placeholder' => '&(cn=*)', $setting->demoMode]) }} {!! $errors->first('ldap_filter', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -208,6 +248,9 @@
{{ Form::text('ldap_username_field', Request::old('ldap_username_field', $setting->ldap_username_field), ['class' => 'form-control','placeholder' => 'samaccountname', $setting->demoMode]) }} {!! $errors->first('ldap_username_field', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -219,6 +262,9 @@
{{ Form::text('ldap_lname_field', Request::old('ldap_lname_field', $setting->ldap_lname_field), ['class' => 'form-control','placeholder' => 'sn', $setting->demoMode]) }} {!! $errors->first('ldap_lname_field', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -230,6 +276,9 @@
{{ Form::text('ldap_fname_field', Request::old('ldap_fname_field', $setting->ldap_fname_field), ['class' => 'form-control', 'placeholder' => 'givenname', $setting->demoMode]) }} {!! $errors->first('ldap_fname_field', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -241,6 +290,9 @@
{{ Form::text('ldap_auth_filter_query', Request::old('ldap_auth_filter_query', $setting->ldap_auth_filter_query), ['class' => 'form-control','placeholder' => '"uid="', $setting->demoMode]) }} {!! $errors->first('ldap_auth_filter_query', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -252,6 +304,9 @@
{{ Form::text('ldap_version', Request::old('ldap_version', $setting->ldap_version), ['class' => 'form-control','placeholder' => '3', $setting->demoMode]) }} {!! $errors->first('ldap_version', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -263,6 +318,9 @@
{{ Form::text('ldap_active_flag', Request::old('ldap_active_flag', $setting->ldap_active_flag), ['class' => 'form-control','placeholder' => '', $setting->demoMode]) }} {!! $errors->first('ldap_active_flag', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -274,6 +332,9 @@
{{ Form::text('ldap_emp_num', Request::old('ldap_emp_num', $setting->ldap_emp_num), ['class' => 'form-control','placeholder' => '', $setting->demoMode]) }} {!! $errors->first('ldap_emp_num', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -285,6 +346,9 @@
{{ Form::text('ldap_email', Request::old('ldap_email', $setting->ldap_email), ['class' => 'form-control','placeholder' => '', $setting->demoMode]) }} {!! $errors->first('ldap_email', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -305,6 +369,9 @@

{{ trans('admin/settings/general.ldap_login_sync_help') }}

+ @if (config('app.lock_passwords')===true) +

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

+ @endif
@@ -320,6 +387,9 @@ {{ Form::text('custom_forgot_pass_url', Request::old('custom_forgot_pass_url', $setting->custom_forgot_pass_url), ['class' => 'form-control','placeholder' => 'https://my.ldapserver-forgotpass.com', $setting->demoMode]) }}

{{ trans('admin/settings/general.custom_forgot_pass_url_help') }}

{!! $errors->first('custom_forgot_pass_url', '') !!} + @if (config('app.lock_passwords')===true) +

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

+ @endif