tinkering to no avail

This commit is contained in:
Godfrey M 2022-09-13 11:40:10 -07:00
parent 28bc97f29f
commit 9b448227f7
4 changed files with 479 additions and 477 deletions

View file

@ -217,11 +217,6 @@ class LdapSync extends Command
$user->jobtitle = $item['jobtitle'];
$user->country = $item['country'];
$user->department_id = $department->id;
$user->groups()->sync($ldap_default_group, $user->id);
if($item['manager'] != null) {
// Get the LDAP Manager
@ -309,6 +304,11 @@ class LdapSync extends Command
if ($user->save()) {
$item['note'] = $item['createorupdate'];
$item['status'] = 'success';
if($ldap_default_group != null) {
$user->groups()->sync($ldap_default_group);
}
} else {
foreach ($user->getErrors()->getMessages() as $key => $err) {
$errors .= $err[0];

View file

@ -133,6 +133,7 @@ class UsersController extends Controller
if ($user->save()) {
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
$user->groups()->sync([]);

937
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -126,13 +126,13 @@
@endforeach
</select>
<span class="help-block">
<span class="help-block">
{{ trans('admin/settings/general.ldap_default_group_info') }}
</span>
</div>
</div>
@endif
@else
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
@else
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
@endif
</div>