Fix to ldap_location attribute

This commit is contained in:
Brady Wetherington 2023-07-17 20:42:02 +01:00
parent f15e14f905
commit 051830dff4

View file

@ -212,9 +212,12 @@ class LdapSync extends Command
$item['manager'] = $results[$i][$ldap_result_manager][0] ?? '';
$item['location'] = $results[$i][$ldap_result_location][0] ?? '';
// ONLY if you are using the "ldap_location" option *AND* you have an actual result
if ($ldap_result_location && $item['location']) {
$location = Location::firstOrCreate([
'name' => $item['location'],
]);
}
$department = Department::firstOrCreate([
'name' => $item['department'],
]);