mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -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->country = $item['country'];
|
||||||
$user->department_id = $department->id;
|
$user->department_id = $department->id;
|
||||||
|
|
||||||
if($item->ldap_default_group_check == 1){
|
if($item->ldap_default_group != null){
|
||||||
|
|
||||||
$permissions_array = $item['ldap_default_group'];
|
$permissions_array = $item['ldap_default_group'];
|
||||||
$user->permissions= json_encode($permissions_array);
|
$user->permissions= json_encode($permissions_array);
|
||||||
|
|
|
@ -7,6 +7,7 @@ use App\Helpers\StorageHelper;
|
||||||
use App\Http\Requests\ImageUploadRequest;
|
use App\Http\Requests\ImageUploadRequest;
|
||||||
use App\Http\Requests\SettingsSamlRequest;
|
use App\Http\Requests\SettingsSamlRequest;
|
||||||
use App\Http\Requests\SetupUserRequest;
|
use App\Http\Requests\SetupUserRequest;
|
||||||
|
use App\Models\Group;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
@ -910,6 +911,8 @@ class SettingsController extends Controller
|
||||||
public function getLdapSettings()
|
public function getLdapSettings()
|
||||||
{
|
{
|
||||||
$setting = Setting::getSettings();
|
$setting = Setting::getSettings();
|
||||||
|
$groups = Group::pluck('name', 'id');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This validator is only temporary (famous last words.) - @snipe
|
* 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()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('settings', function (Blueprint $table) {
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
$table->boolean('ldap_default_group_check')
|
$table->string('ldap_default_group')
|
||||||
->after('ldap_base_dn');
|
->after('ldap_base_dn');
|
||||||
$table->boolean('ldap_default_group')
|
|
||||||
->after('ldap_default_group_check');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +27,6 @@ class AddsLdapDefaultGroupToSettingsTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('settings', function (Blueprint $table) {
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
$table->dropColumn('ldap_default_group_check');
|
|
||||||
$table->dropColumn('ldap_default_group');
|
$table->dropColumn('ldap_default_group');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,19 +90,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</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 -->
|
<!-- Default LDAP Permissions Group Select -->
|
||||||
<div class="form-group{{ $errors->has('groups') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('groups') ? ' has-error' : '' }}">
|
||||||
<label class="col-md-3 control-label" for="groups[]"> {{ trans('general.groups') }}</label>
|
<label class="col-md-3 control-label" for="groups[]"> {{ trans('general.groups') }}</label>
|
||||||
|
@ -110,16 +98,14 @@
|
||||||
|
|
||||||
@if ($groups->count())
|
@if ($groups->count())
|
||||||
@if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
|
@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
|
@else
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select
|
<select
|
||||||
|
@ -131,7 +117,6 @@
|
||||||
|
|
||||||
@foreach ($groups as $id => $group)
|
@foreach ($groups as $id => $group)
|
||||||
<option value="{{ $id }}"
|
<option value="{{ $id }}"
|
||||||
{{ ($userGroups->keys()->contains($id) ? ' selected="selected"' : '') }}>
|
|
||||||
{{ $group }}
|
{{ $group }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@ -148,6 +133,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- AD Flag -->
|
<!-- AD Flag -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
|
|
@ -499,7 +499,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
@endif
|
@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
|
@else
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select
|
<select
|
||||||
|
|
Loading…
Reference in a new issue