We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d556d1c + bdb0e6c commit 6f84729Copy full SHA for 6f84729
app/Console/Commands/LdapSync.php
@@ -434,8 +434,12 @@ public function handle()
434
$item['note'] = $item['createorupdate'];
435
$item['status'] = 'success';
436
if ($item['createorupdate'] === 'created' && $ldap_default_group) {
437
- $user->groups()->attach($ldap_default_group);
+ // Check if the relationship already exists
438
+ if (!$user->groups()->where('group_id', $ldap_default_group)->exists()) {
439
+ $user->groups()->attach($ldap_default_group);
440
+ }
441
}
442
+
443
//updates assets location based on user's location
444
if ($user->wasChanged('location_id')) {
445
foreach ($user->assets as $asset) {
0 commit comments