From 04d2542b817115ec6e8bf06f305eef6df1c52209 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 Mar 2018 22:42:40 -0800 Subject: [PATCH] Fixed #5078 - check for object or array as location in LDAP sync --- app/Console/Commands/LdapSync.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index e0e001a997..7b7571bf40 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -190,7 +190,13 @@ class LdapSync extends Command if ($item['ldap_location_override'] == true) { $user->location_id = $item['location_id']; } 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';