mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
gets the groups selector to appear but options are blank
This commit is contained in:
parent
fc6fefdb4e
commit
0c362e8b57
|
@ -216,7 +216,7 @@ class LdapSync extends Command
|
|||
$user->country = $item['country'];
|
||||
$user->department_id = $department->id;
|
||||
|
||||
if($item->ldap_default_group_check == 1){
|
||||
if($item->ldap_default_group != null){
|
||||
|
||||
$permissions_array = $item['ldap_default_group'];
|
||||
$user->permissions= json_encode($permissions_array);
|
||||
|
|
|
@ -7,6 +7,7 @@ use App\Helpers\StorageHelper;
|
|||
use App\Http\Requests\ImageUploadRequest;
|
||||
use App\Http\Requests\SettingsSamlRequest;
|
||||
use App\Http\Requests\SetupUserRequest;
|
||||
use App\Models\Group;
|
||||
use App\Models\Setting;
|
||||
use App\Models\Asset;
|
||||
use App\Models\User;
|
||||
|
@ -910,6 +911,8 @@ class SettingsController extends Controller
|
|||
public function getLdapSettings()
|
||||
{
|
||||
$setting = Setting::getSettings();
|
||||
$groups = Group::pluck('name', 'id');
|
||||
|
||||
|
||||
/**
|
||||
* This validator is only temporary (famous last words.) - @snipe
|
||||
|
@ -928,7 +931,7 @@ class SettingsController extends Controller
|
|||
|
||||
|
||||
|
||||
return view('settings.ldap', compact('setting'))->withErrors($validator);
|
||||
return view('settings.ldap', compact('setting', 'groups'))->withErrors($validator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,10 +14,8 @@ class AddsLdapDefaultGroupToSettingsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->boolean('ldap_default_group_check')
|
||||
->after('ldap_base_dn');
|
||||
$table->boolean('ldap_default_group')
|
||||
->after('ldap_default_group_check');
|
||||
$table->string('ldap_default_group')
|
||||
->after('ldap_base_dn');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -29,7 +27,6 @@ class AddsLdapDefaultGroupToSettingsTable extends Migration
|
|||
public function down()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->dropColumn('ldap_default_group_check');
|
||||
$table->dropColumn('ldap_default_group');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -90,19 +90,7 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Default LDAP Permissions Group Check-->
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_default_group', trans('admin/settings/general.ldap_default_group')) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Form::checkbox('ldap_default_group', '1', Request::old('ldap_default_group', $setting->ldap_default_group), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
|
||||
{{ trans('admin/settings/general.ldap_default_group_info') }}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default LDAP Permissions Group Select -->
|
||||
<div class="form-group{{ $errors->has('groups') ? ' has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="groups[]"> {{ trans('general.groups') }}</label>
|
||||
|
@ -110,16 +98,14 @@
|
|||
|
||||
@if ($groups->count())
|
||||
@if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
|
||||
<ul>
|
||||
@foreach ($groups as $id => $group)
|
||||
{!! '<li>'.e($group).'</li>' !!}
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
@if (count($userGroups->keys()) > 0)
|
||||
<ul>
|
||||
@foreach ($groups as $id => $group)
|
||||
{!! ($userGroups->keys()->contains($id) ? '<li>'.e($group).'</li>' : '') !!}
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</p>
|
||||
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
|
||||
@else
|
||||
<div class="controls">
|
||||
<select
|
||||
|
@ -131,7 +117,6 @@
|
|||
|
||||
@foreach ($groups as $id => $group)
|
||||
<option value="{{ $id }}"
|
||||
{{ ($userGroups->keys()->contains($id) ? ' selected="selected"' : '') }}>
|
||||
{{ $group }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
@ -148,6 +133,7 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AD Flag -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">
|
||||
|
|
|
@ -499,7 +499,7 @@
|
|||
</ul>
|
||||
@endif
|
||||
|
||||
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</p>
|
||||
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
|
||||
@else
|
||||
<div class="controls">
|
||||
<select
|
||||
|
|
Loading…
Reference in a new issue