2017-07-07 23:44:48 -07:00
|
|
|
@extends('layouts/default')
|
|
|
|
|
|
|
|
{{-- Page title --}}
|
|
|
|
@section('title')
|
|
|
|
Update LDAP/AD Settings
|
|
|
|
@parent
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@section('header_right')
|
|
|
|
<a href="{{ route('settings.index') }}" class="btn btn-default"> {{ trans('general.back') }}</a>
|
|
|
|
@stop
|
|
|
|
|
|
|
|
|
|
|
|
{{-- Page content --}}
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.checkbox label {
|
|
|
|
padding-right: 40px;
|
|
|
|
}
|
2023-08-28 10:36:06 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
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;
|
|
|
|
}
|
2017-07-07 23:44:48 -07:00
|
|
|
</style>
|
|
|
|
|
2017-07-08 01:48:29 -07:00
|
|
|
@if ((!function_exists('ldap_connect')) || (!function_exists('ldap_set_option')) || (!function_exists('ldap_bind')))
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="alert alert-danger">
|
2021-11-19 06:23:48 -08:00
|
|
|
{{ trans('admin/settings/general.ldap_extension_warning') }}
|
2017-07-08 01:48:29 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-04-23 14:41:20 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
|
|
|
|
|
2023-08-28 10:36:06 -07:00
|
|
|
{{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form']) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
<!-- CSRF Token -->
|
|
|
|
{{csrf_field()}}
|
|
|
|
|
2024-06-27 07:05:47 -07:00
|
|
|
<input type="hidden" name="username" value="{{ old('username', $user->username) }}">
|
2023-08-28 10:36:06 -07:00
|
|
|
|
2017-10-17 17:35:48 -07:00
|
|
|
<!-- this is a hack to prevent Chrome from trying to autocomplete fields -->
|
|
|
|
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" />
|
|
|
|
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" />
|
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="panel box box-default">
|
|
|
|
<div class="box-header with-border">
|
2020-04-01 03:51:08 -07:00
|
|
|
<h2 class="box-title">
|
2024-08-19 06:48:12 -07:00
|
|
|
<x-icon type="ldap"/>
|
|
|
|
{{ trans('admin/settings/general.ldap_ad') }}
|
2017-07-07 23:44:48 -07:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
|
|
|
|
<div class="col-md-11 col-md-offset-1">
|
|
|
|
|
|
|
|
<!-- Enable LDAP -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_integration') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ Form::label('ldap_enabled', trans('admin/settings/general.ldap_integration')) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2020-09-25 19:04:38 -07:00
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
<label class="form-control">
|
|
|
|
{{ Form::checkbox('ldap_enabled', '1', old('ldap_enabled', $setting->ldap_enabled), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'form-control '. $setting->demoMode, $setting->demoMode]) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
{{ trans('admin/settings/general.ldap_enabled') }}
|
2023-05-09 22:34:46 -07:00
|
|
|
</label>
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
|
|
|
|
<!-- AD Flag -->
|
2017-07-07 23:44:48 -07:00
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ Form::label('is_ad', trans('admin/settings/general.ad')) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
|
|
|
<label class="form-control">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::checkbox('is_ad', '1', old('is_ad', $setting->is_ad), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ trans('admin/settings/general.is_ad') }}
|
|
|
|
</label>
|
|
|
|
{!! $errors->first('is_ad', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-29 12:09:56 -07:00
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
<!-- LDAP Password Sync -->
|
2017-07-07 23:44:48 -07:00
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ Form::label('ldap_pw_sync', trans('admin/settings/general.ldap_pw_sync')) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
|
|
|
<label class="form-control">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::checkbox('ldap_pw_sync', '1', old('ldap_pw_sync', $setting->ldap_pw_sync), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ trans('general.yes') }}
|
|
|
|
</label>
|
2020-09-25 19:04:38 -07:00
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_pw_sync_help') }}</p>
|
|
|
|
{!! $errors->first('ldap_pw_sync_help', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2023-05-09 22:34:46 -07:00
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- AD Domain -->
|
|
|
|
<div class="form-group {{ $errors->has('ad_domain') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ad_domain', trans('admin/settings/general.ad_domain')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ad_domain', old('ad_domain', $setting->ad_domain), ['class' => 'form-control','placeholder' => trans('general.example') .'example.com', $setting->demoMode]) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ad_domain_help') }}</p>
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ad_domain', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div><!-- AD Domain -->
|
|
|
|
|
2021-11-08 17:11:47 -08:00
|
|
|
{{-- NOTICE - this was a feature for AdLdap2-based LDAP syncing, and is already handled in 'classic' LDAP, so we now hide the checkbox (but haven't deleted the field) <!-- AD Append Domain -->
|
2020-02-04 12:47:49 -08:00
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ad_append_domain', trans('admin/settings/general.ad_append_domain_label')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::checkbox('ad_append_domain', '1', old('ad_append_domain', $setting->ad_append_domain),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
2020-02-04 12:47:49 -08:00
|
|
|
{{ trans('admin/settings/general.ad_append_domain') }}
|
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ad_append_domain_help') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
{!! $errors->first('ad_append_domain', '<span class="alert-msg">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2020-02-04 12:47:49 -08:00
|
|
|
</div>
|
2021-11-08 17:11:47 -08:00
|
|
|
</div> --}}
|
2020-02-04 12:47:49 -08:00
|
|
|
|
2021-08-17 14:43:36 -07:00
|
|
|
<!-- LDAP Client-Side TLS key -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_client_tls_key') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::textarea('ldap_client_tls_key', old('ldap_client_tls_key', $setting->ldap_client_tls_key), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN RSA PRIVATE KEY-----'."\r\n1234567890\r\n-----END RSA PRIVATE KEY-----
|
2021-08-17 14:43:36 -07:00
|
|
|
", $setting->demoMode]) }}
|
|
|
|
{!! $errors->first('ldap_client_tls_key', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-08-17 14:43:36 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div><!-- LDAP Client-Side TLS key -->
|
|
|
|
|
|
|
|
<!-- LDAP Client-Side TLS certificate -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_client_tls_cert') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_client_tls_cert', trans('admin/settings/general.ldap_client_tls_cert')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::textarea('ldap_client_tls_cert', old('ldap_client_tls_cert', $setting->ldap_client_tls_cert), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN CERTIFICATE-----'."\r\n1234567890\r\n-----END CERTIFICATE-----", $setting->demoMode]) }}
|
2021-08-17 14:43:36 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_client_tls_cert_help') }}</p>
|
|
|
|
{!! $errors->first('ldap_client_tls_cert', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-08-17 14:43:36 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div><!-- LDAP Client-Side TLS certificate -->
|
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
<!-- LDAP Server -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_server') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_server', trans('admin/settings/general.ldap_server')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_server', old('ldap_server', $setting->ldap_server), ['class' => 'form-control','placeholder' => trans('general.example') .'ldap://ldap.example.com', $setting->demoMode]) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_server_help') }}</p>
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_server', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div><!-- LDAP Server -->
|
|
|
|
|
|
|
|
<!-- Start TLS -->
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_tls', trans('admin/settings/general.ldap_tls')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
|
|
|
<label class="form-control">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::checkbox('ldap_tls', '1', old('ldap_tls', $setting->ldap_tls),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ trans('admin/settings/general.ldap_tls_help') }}
|
|
|
|
</label>
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_tls', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Ignore LDAP Certificate -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_server_cert_ignore') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_server_cert_ignore', trans('admin/settings/general.ldap_server_cert')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
|
|
|
<label class="form-control">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::checkbox('ldap_server_cert_ignore', '1', old('ldap_server_cert_ignore', $setting->ldap_server_cert_ignore),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ trans('admin/settings/general.ldap_server_cert_ignore') }}
|
|
|
|
</label>
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_server_cert_ignore', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2017-07-07 23:44:48 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_server_cert_help') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP Username -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_uname') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_uname', trans('admin/settings/general.ldap_uname')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_uname', old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','autocomplete' => 'off', 'placeholder' => trans('general.example') .'binduser@example.com', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_uname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP pword -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_pword') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_pword', trans('admin/settings/general.ldap_pword')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2023-08-28 10:36:06 -07:00
|
|
|
{{ Form::password('ldap_pword', ['class' => 'form-control', 'autocomplete' => 'off', 'onfocus' => "this.removeAttribute('readonly');", $setting->demoMode, ' readonly']) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_pword', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP basedn -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_basedn') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_basedn', trans('admin/settings/general.ldap_basedn')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_basedn', old('ldap_basedn', $setting->ldap_basedn), ['class' => 'form-control', 'placeholder' => trans('general.example') .'cn=users/authorized,dc=example,dc=com', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_basedn', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP filter -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_filter') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_filter', trans('admin/settings/general.ldap_filter')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_filter', old('ldap_filter', $setting->ldap_filter), ['class' => 'form-control','placeholder' => trans('general.example') .'&(cn=*)', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_filter', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP username field-->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_username_field') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_username_field', trans('admin/settings/general.ldap_username_field')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_username_field', old('ldap_username_field', $setting->ldap_username_field), ['class' => 'form-control','placeholder' => trans('general.example') .'samaccountname', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_username_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP Last Name Field -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_lname_field') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_lname_field', trans('admin/settings/general.ldap_lname_field')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_lname_field', old('ldap_lname_field', $setting->ldap_lname_field), ['class' => 'form-control','placeholder' => trans('general.example') .'sn', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_lname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP First Name field -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_fname_field') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_fname_field', trans('admin/settings/general.ldap_fname_field')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_fname_field', old('ldap_fname_field', $setting->ldap_fname_field), ['class' => 'form-control', 'placeholder' => trans('general.example') .'givenname', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_fname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP Auth Filter Query -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_auth_filter_query') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_auth_filter_query', trans('admin/settings/general.ldap_auth_filter_query')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_auth_filter_query', old('ldap_auth_filter_query', $setting->ldap_auth_filter_query), ['class' => 'form-control','placeholder' => trans('general.example') .'uid=', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_auth_filter_query', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
<!-- Default LDAP Permissions Group Select -->
|
|
|
|
|
|
|
|
<div class="form-group{{ $errors->has('group') ? ' has-error' : '' }}">
|
2017-07-07 23:44:48 -07:00
|
|
|
<div class="col-md-3">
|
2023-05-09 22:34:46 -07:00
|
|
|
{{ Form::label('ldap_default_group', trans('admin/settings/general.ldap_default_group')) }}
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
|
|
|
@if ($groups->count())
|
|
|
|
@if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
|
|
|
|
<ul>
|
|
|
|
@foreach ($groups as $id => $group)
|
|
|
|
{!! '<li>'.e($group).'</li>' !!}
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
|
|
|
|
@else
|
|
|
|
<div class="controls">
|
|
|
|
<select name="ldap_default_group" aria-label="ldap_default_group" id="ldap_default_group" class="form-control select2">
|
|
|
|
<option value="">{{ trans('admin/settings/general.no_default_group') }}</option>
|
|
|
|
@foreach ($groups as $id => $group)
|
|
|
|
<option value="{{ $id }}" {{ $setting->ldap_default_group == $id ? 'selected' : '' }}>
|
|
|
|
{{ $group }}
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<span class="help-block">
|
|
|
|
{{ trans('admin/settings/general.ldap_default_group_info') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2023-05-09 22:34:46 -07:00
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP active flag -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_active_flag') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_active_flag', trans('admin/settings/general.ldap_active_flag')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_active_flag', old('ldap_active_flag', $setting->ldap_active_flag), ['class' => 'form-control', $setting->demoMode]) }}
|
2020-11-13 11:52:34 -08:00
|
|
|
|
2022-10-11 12:38:37 -07:00
|
|
|
<p class="help-block">{!! trans('admin/settings/general.ldap_activated_flag_help') !!}</p>
|
2020-11-13 11:52:34 -08:00
|
|
|
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_active_flag', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP emp number -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_emp_num') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_emp_num', trans('admin/settings/general.ldap_emp_num')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_emp_num', old('ldap_emp_num', $setting->ldap_emp_num), ['class' => 'form-control','placeholder' => trans('general.example') .'employeenumber/employeeid', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_emp_num', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-14 10:17:57 -07:00
|
|
|
<!-- LDAP department -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_dept') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_dept')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_dept', old('ldap_dept', $setting->ldap_dept), ['class' => 'form-control','placeholder' => trans('general.example') .'department', $setting->demoMode]) }}
|
2021-04-14 10:17:57 -07:00
|
|
|
{!! $errors->first('ldap_dept', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2022-03-21 11:15:39 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- LDAP Manager -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_dept') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_manager')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_manager', old('ldap_manager', $setting->ldap_manager), ['class' => 'form-control','placeholder' => trans('general.example') .'manager', $setting->demoMode]) }}
|
2022-03-21 11:15:39 -07:00
|
|
|
{!! $errors->first('ldap_manager', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-04-14 10:17:57 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-07 23:44:48 -07:00
|
|
|
|
|
|
|
<!-- LDAP email -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_email') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_email', trans('admin/settings/general.ldap_email')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_email', old('ldap_email', $setting->ldap_email), ['class' => 'form-control','placeholder' => trans('general.example') .'mail', $setting->demoMode]) }}
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('ldap_email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-04-05 19:26:04 -07:00
|
|
|
<!-- LDAP Phone -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_phone') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_phone', trans('admin/settings/general.ldap_phone')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_phone', old('ldap_phone', $setting->ldap_phone_field), ['class' => 'form-control','placeholder' => trans('general.example') .'telephonenumber', $setting->demoMode]) }}
|
2021-04-05 19:26:04 -07:00
|
|
|
{!! $errors->first('ldap_phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-04-05 19:26:04 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2021-04-05 19:26:04 -07:00
|
|
|
<!-- LDAP Job title -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_jobtitle') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_jobtitle', trans('admin/settings/general.ldap_jobtitle')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_jobtitle', old('ldap_jobtitle', $setting->ldap_jobtitle), ['class' => 'form-control','placeholder' => trans('general.example') .'title', $setting->demoMode]) }}
|
2021-04-05 19:26:04 -07:00
|
|
|
{!! $errors->first('ldap_jobtitle', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-04-05 19:26:04 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- LDAP Country -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_country') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_country', trans('admin/settings/general.ldap_country')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_country', old('ldap_country', $setting->ldap_country), ['class' => 'form-control','placeholder' => trans('general.example') .'c', $setting->demoMode]) }}
|
2021-04-05 19:26:04 -07:00
|
|
|
{!! $errors->first('ldap_country', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2023-04-25 11:44:04 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- LDAP Location -->
|
|
|
|
<div class="form-group {{ $errors->has('ldap_location') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('ldap_location', trans('admin/settings/general.ldap_location')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('ldap_location', old('ldap_location', $setting->ldap_location), ['class' => 'form-control','placeholder' => trans('general.example') .'physicaldeliveryofficename', $setting->demoMode]) }}
|
2023-04-25 11:44:04 -07:00
|
|
|
<p class="help-block">{!! trans('admin/settings/general.ldap_location_help') !!}</p>
|
|
|
|
{!! $errors->first('ldap_location', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2021-04-05 19:26:04 -07:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-16 06:34:04 -07:00
|
|
|
@if ($setting->ldap_enabled)
|
|
|
|
|
2018-12-06 14:05:43 -08:00
|
|
|
<!-- LDAP test -->
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('test_ldap_sync', 'Test LDAP Sync') }}
|
2017-10-16 06:34:04 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8" id="ldaptestrow">
|
2024-01-24 12:13:40 -08:00
|
|
|
<a {{ $setting->demoMode }} class="btn btn-default btn-sm" id="ldaptest" style="margin-right: 10px;">{{ trans('admin/settings/general.ldap_test_sync') }}</a>
|
2017-10-16 06:34:04 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8 col-md-offset-3">
|
2018-12-06 14:05:43 -08:00
|
|
|
<br />
|
|
|
|
<div id="ldapad_test_results" class="hidden well well-sm"></div>
|
2017-10-16 06:34:04 -07:00
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8 col-md-offset-3">
|
2018-12-06 14:05:43 -08:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_login_sync_help') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-10-16 06:34:04 -07:00
|
|
|
</div>
|
2017-10-16 09:00:51 -07:00
|
|
|
|
2017-10-16 06:34:04 -07:00
|
|
|
</div>
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2020-11-16 21:23:08 -08:00
|
|
|
<!-- LDAP Login test -->
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('test_ldap_login', 'Test LDAP Login') }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2020-11-16 21:23:08 -08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
|
|
|
<input type="text" name="ldaptest_user" id="ldaptest_user" class="form-control" placeholder="LDAP username">
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
2023-08-28 10:36:06 -07:00
|
|
|
<input type="password" name="ldaptest_password" id="ldaptest_password" class="form-control" placeholder="LDAP password" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');">
|
2020-11-16 21:23:08 -08:00
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
2021-11-19 06:23:48 -08:00
|
|
|
<a class="btn btn-default btn-sm" id="ldaptestlogin" style="margin-right: 10px;">{{ trans('admin/settings/general.ldap_test') }}</a>
|
2020-11-16 21:23:08 -08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8 col-md-offset-3">
|
2020-11-16 21:23:08 -08:00
|
|
|
<span id="ldaptestloginicon"></span>
|
|
|
|
<span id="ldaptestloginresult"></span>
|
|
|
|
<span id="ldaptestloginstatus"></span>
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8 col-md-offset-3">
|
2020-11-16 21:23:08 -08:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.ldap_login_test_help') }}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2017-10-16 06:34:04 -07:00
|
|
|
@endif
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2017-10-19 12:22:27 -07:00
|
|
|
<!-- LDAP Forgotten password -->
|
|
|
|
<div class="form-group {{ $errors->has('custom_forgot_pass_url') ? 'error' : '' }}">
|
|
|
|
<div class="col-md-3">
|
|
|
|
{{ Form::label('custom_forgot_pass_url', trans('admin/settings/general.custom_forgot_pass_url')) }}
|
|
|
|
</div>
|
2023-05-09 22:34:46 -07:00
|
|
|
<div class="col-md-8">
|
2024-06-27 07:05:47 -07:00
|
|
|
{{ Form::text('custom_forgot_pass_url', old('custom_forgot_pass_url', $setting->custom_forgot_pass_url), ['class' => 'form-control','placeholder' => trans('general.example') .'https://my.ldapserver-forgotpass.com', $setting->demoMode]) }}
|
2017-10-19 12:22:27 -07:00
|
|
|
<p class="help-block">{{ trans('admin/settings/general.custom_forgot_pass_url_help') }}</p>
|
2020-04-01 03:21:15 -07:00
|
|
|
{!! $errors->first('custom_forgot_pass_url', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
2020-09-25 19:04:38 -07:00
|
|
|
@if (config('app.lock_passwords')===true)
|
2021-09-26 01:11:08 -07:00
|
|
|
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
2020-09-25 19:04:38 -07:00
|
|
|
@endif
|
2017-10-19 12:22:27 -07:00
|
|
|
</div>
|
|
|
|
</div><!-- LDAP Server -->
|
|
|
|
|
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
</div> <!--/.box-body-->
|
|
|
|
<div class="box-footer">
|
|
|
|
<div class="text-left col-md-6">
|
|
|
|
<a class="btn btn-link text-left" href="{{ route('settings.index') }}">{{ trans('button.cancel') }}</a>
|
|
|
|
</div>
|
|
|
|
<div class="text-right col-md-6">
|
2024-08-18 09:26:44 -07:00
|
|
|
<button type="submit" class="btn btn-primary"><x-icon type="checkmark" /> {{ trans('general.save') }}</button>
|
2017-07-07 23:44:48 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div> <!-- /box -->
|
2017-07-08 01:48:29 -07:00
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
</div> <!-- /.col-md-8-->
|
|
|
|
</div> <!-- /.row-->
|
|
|
|
|
|
|
|
{{Form::close()}}
|
2020-04-23 14:41:20 -07:00
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
|
|
|
|
@stop
|
|
|
|
|
2018-12-06 14:05:43 -08:00
|
|
|
@push('js')
|
2020-04-23 14:41:20 -07:00
|
|
|
<script nonce="{{ csrf_token() }}">
|
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
|
|
|
|
|
2020-04-23 14:41:20 -07:00
|
|
|
/**
|
|
|
|
* Check to see if is_ad is checked, if not disable the ad_domain field
|
|
|
|
*/
|
|
|
|
$(function() {
|
|
|
|
if( $('#is_ad').prop('checked') === false) {
|
|
|
|
$('#ad_domain').prop('disabled', 'disabled');
|
|
|
|
} else {
|
2020-09-17 13:32:14 -07:00
|
|
|
//$('#ldap_server').prop('disabled', 'disabled');
|
2020-04-23 14:41:20 -07:00
|
|
|
}
|
|
|
|
});
|
2017-10-16 10:10:11 -07:00
|
|
|
|
2023-05-09 22:34:46 -07:00
|
|
|
$("#is_ad").change(function() {
|
|
|
|
$('#ad_domain').prop('disabled', 'disabled');
|
|
|
|
|
|
|
|
if (this.checked) {
|
|
|
|
$('#ad_domain').toggleDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-04-23 14:41:20 -07:00
|
|
|
/**
|
|
|
|
* Toggle the server info based on the is_ad checkbox
|
|
|
|
*/
|
|
|
|
$('#is_ad').on('ifClicked', function(){
|
|
|
|
$('#ad_domain').toggleDisabled();
|
2020-09-17 13:32:14 -07:00
|
|
|
//$('#ldap_server').toggleDisabled();
|
2020-04-23 14:41:20 -07:00
|
|
|
});
|
2017-10-16 10:10:11 -07:00
|
|
|
|
2017-10-16 09:00:51 -07:00
|
|
|
|
2020-04-23 14:41:20 -07:00
|
|
|
/**
|
|
|
|
* Test the LDAP connection settings
|
|
|
|
*/
|
|
|
|
$("#ldaptest").click(function () {
|
|
|
|
$("#ldapad_test_results").removeClass('hidden text-success text-danger');
|
|
|
|
$("#ldapad_test_results").html('');
|
2021-11-19 06:23:48 -08:00
|
|
|
$("#ldapad_test_results").html('<i class="fas fa-spinner spin"></i> {{ trans('admin/settings/message.ldap.testing') }}');
|
2020-04-23 14:41:20 -07:00
|
|
|
$.ajax({
|
|
|
|
url: '{{ route('api.settings.ldaptest') }}',
|
|
|
|
type: 'GET',
|
|
|
|
headers: {
|
|
|
|
"X-Requested-With": 'XMLHttpRequest',
|
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
|
|
|
},
|
|
|
|
data: {},
|
|
|
|
dataType: 'json',
|
|
|
|
|
|
|
|
success: function (data) {
|
|
|
|
$("#ldapad_test_results").html('');
|
|
|
|
let html = buildLdapTestResults(data)
|
|
|
|
$("#ldapad_test_results").html(
|
|
|
|
html
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function (data) {
|
|
|
|
$("#ldapad_test_results").html('');
|
|
|
|
$("#ldapad_test_results").addClass('text-danger');
|
2021-09-26 01:11:08 -07:00
|
|
|
let errorIcon = '<i class="fas fa-exclamation-triangle text-danger"></i>' + ' ';
|
2020-04-23 14:41:20 -07:00
|
|
|
if (data.status == 500) {
|
2021-11-19 06:23:48 -08:00
|
|
|
$('#ldapad_test_results').html(errorIcon + '{{ trans('admin/settings/message.ldap.500') }}');
|
2020-04-23 14:41:20 -07:00
|
|
|
} else if (data.status == 400) {
|
|
|
|
let errorMessage = '';
|
|
|
|
if( typeof data.responseJSON.user_sync !== 'undefined') {
|
|
|
|
errorMessage = data.responseJSON.user_sync.message;
|
|
|
|
}
|
|
|
|
if( typeof data.responseJSON.message !== 'undefined') {
|
|
|
|
errorMessage = data.responseJSON.message;
|
|
|
|
}
|
|
|
|
$('#ldapad_test_results').html(errorIcon + errorMessage);
|
|
|
|
} else {
|
2021-11-19 06:23:48 -08:00
|
|
|
$('#ldapad_test_results').html('{{ trans('admin/settings/message.ldap.error') }}');
|
2020-04-23 22:44:48 -07:00
|
|
|
// $('#ldapad_test_results').html(errorIcon + data.responseText.message);
|
2017-10-16 09:00:51 -07:00
|
|
|
}
|
2017-10-16 06:34:04 -07:00
|
|
|
}
|
2020-04-23 22:44:48 -07:00
|
|
|
|
|
|
|
|
2020-04-23 14:41:20 -07:00
|
|
|
});
|
2017-10-16 06:34:04 -07:00
|
|
|
});
|
2020-04-23 14:41:20 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the results html table
|
|
|
|
*/
|
|
|
|
function buildLdapTestResults(results) {
|
2023-12-19 09:49:40 -08:00
|
|
|
let html = '<ul style="list-style: none;padding-left: 5px;">'
|
2021-09-26 01:11:08 -07:00
|
|
|
html += '<li class="text-success"><i class="fas fa-check" aria-hidden="true"></i> ' + results.login.message + ' </li>'
|
|
|
|
html += '<li class="text-success"><i class="fas fa-check" aria-hidden="true"></i> ' + results.bind.message + ' </li>'
|
2020-04-23 14:41:20 -07:00
|
|
|
html += '</ul>'
|
2024-01-24 12:13:40 -08:00
|
|
|
html += '<div style="overflow:auto;">'
|
2021-11-19 06:23:48 -08:00
|
|
|
html += '<div>{{ trans('admin/settings/message.ldap.sync_success') }}</div>'
|
2024-01-24 12:13:40 -08:00
|
|
|
html += '<table class="table table-bordered table-condensed" style=" table-layout:fixed; width:100%;background-color: #fff">'
|
2020-04-23 14:41:20 -07:00
|
|
|
html += buildLdapResultsTableHeader()
|
|
|
|
html += buildLdapResultsTableBody(results.user_sync.users)
|
2024-01-24 12:13:40 -08:00
|
|
|
html += '</table>'
|
|
|
|
html += '</div>'
|
2020-04-23 14:41:20 -07:00
|
|
|
return html;
|
|
|
|
}
|
|
|
|
|
|
|
|
function buildLdapResultsTableHeader(user)
|
|
|
|
{
|
2021-11-19 06:23:48 -08:00
|
|
|
var keys = [
|
|
|
|
'{{ trans('admin/settings/general.employee_number') }}',
|
|
|
|
'{{ trans('mail.username') }}',
|
|
|
|
'{{ trans('general.first_name') }}',
|
|
|
|
'{{ trans('general.last_name') }}',
|
|
|
|
'{{ trans('general.email') }}'
|
|
|
|
]
|
2020-04-23 14:41:20 -07:00
|
|
|
let header = '<thead><tr>'
|
|
|
|
for (var i in keys) {
|
|
|
|
header += '<th>' + keys[i] + '</th>'
|
|
|
|
}
|
|
|
|
header += "</tr></thead>"
|
|
|
|
return header;
|
2018-12-06 14:05:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
function buildLdapResultsTableBody(users)
|
2020-04-23 14:41:20 -07:00
|
|
|
{
|
|
|
|
let body = '<tbody>'
|
|
|
|
for (var i in users) {
|
2024-01-24 12:13:40 -08:00
|
|
|
body += '<tr><td>' + users[i].employee_number + '</td><td>' + users[i].username + '</td><td>' + users[i].firstname + '</td><td>' + users[i].lastname + '</td><td>' + users[i].email + '</td></tr>'
|
2020-04-23 14:41:20 -07:00
|
|
|
}
|
|
|
|
body += "</tbody>"
|
|
|
|
return body;
|
2018-12-06 14:05:43 -08:00
|
|
|
}
|
2020-11-16 21:23:08 -08:00
|
|
|
|
|
|
|
$("#ldaptestlogin").click(function(){
|
|
|
|
$("#ldaptestloginrow").removeClass('text-success');
|
|
|
|
$("#ldaptestloginrow").removeClass('text-danger');
|
|
|
|
$("#ldaptestloginstatus").removeClass('text-danger');
|
|
|
|
$("#ldaptestloginstatus").html('');
|
2021-11-19 06:23:48 -08:00
|
|
|
$("#ldaptestloginicon").html('<i class="fas fa-spinner spin"></i> {{ trans('admin/settings/message.ldap.testing_authentication') }}');
|
2020-11-16 21:23:08 -08:00
|
|
|
$.ajax({
|
|
|
|
url: '{{ route('api.settings.ldaptestlogin') }}',
|
|
|
|
type: 'POST',
|
|
|
|
headers: {
|
|
|
|
"X-Requested-With": 'XMLHttpRequest',
|
|
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
'ldaptest_user': $('#ldaptest_user').val(),
|
|
|
|
'ldaptest_password': $('#ldaptest_password').val()
|
|
|
|
},
|
|
|
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
|
|
|
success: function (data) {
|
|
|
|
$("#ldaptestloginicon").html('');
|
|
|
|
$("#ldaptestloginrow").addClass('text-success');
|
|
|
|
$("#ldaptestloginstatus").addClass('text-success');
|
2021-11-19 06:23:48 -08:00
|
|
|
$("#ldaptestloginstatus").html('<i class="fas fa-check text-success"></i> {{ trans('admin/settings/message.ldap.authentication_success') }}');
|
2020-11-16 21:23:08 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
error: function (data) {
|
|
|
|
|
|
|
|
if (data.responseJSON) {
|
|
|
|
var errors = data.responseJSON.message;
|
|
|
|
} else {
|
|
|
|
var errors;
|
|
|
|
}
|
|
|
|
|
|
|
|
var error_text = '';
|
|
|
|
|
|
|
|
$("#ldaptestloginicon").html('');
|
|
|
|
$("#ldaptestloginstatus").addClass('text-danger');
|
2021-09-26 01:11:08 -07:00
|
|
|
$("#ldaptestloginicon").html('<i class="fas fa-exclamation-triangle text-danger"></i>');
|
2020-11-16 21:23:08 -08:00
|
|
|
|
|
|
|
if (data.status == 500) {
|
2021-11-19 06:23:48 -08:00
|
|
|
$('#ldaptestloginstatus').html('{{ trans('admin/settings/message.ldap.500') }}');
|
2020-11-16 21:23:08 -08:00
|
|
|
} else if (data.status == 400) {
|
|
|
|
|
|
|
|
if (typeof errors !='string') {
|
|
|
|
|
|
|
|
for (i = 0; i < errors.length; i++) {
|
|
|
|
if (errors[i]) {
|
|
|
|
error_text += '<li>Error: ' + errors[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
error_text = errors;
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#ldaptestloginstatus').html(error_text);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$('#ldaptestloginstatus').html(data.responseText.message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2020-04-23 14:41:20 -07:00
|
|
|
</script>
|
2019-12-10 19:32:50 -08:00
|
|
|
@endpush
|