Fixed #5078 - check for object or array as location in LDAP sync

This commit is contained in:
snipe 2018-03-05 22:42:40 -08:00
parent 9a25cb3ee7
commit 04d2542b81

View file

@ -190,7 +190,13 @@ class LdapSync extends Command
if ($item['ldap_location_override'] == true) { if ($item['ldap_location_override'] == true) {
$user->location_id = $item['location_id']; $user->location_id = $item['location_id'];
} elseif ((isset($location)) && (!empty($location))) { } elseif ((isset($location)) && (!empty($location))) {
$user->location_id = e($location->id);
if (is_array($location)) {
$user->location_id = $location['id'];
} elseif (is_object($location)) {
$user->location_id = $location->id;
}
} }
$user->notes = 'Imported from LDAP'; $user->notes = 'Imported from LDAP';