From 34d547355398a2e19f3e7c2c6dd6fc33a79c7e8d Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 1 Dec 2020 21:26:52 -0800 Subject: [PATCH] Fixes 8472 (again) - LDAP sync was assigning a bad default location (#8846) --- app/Console/Commands/LdapSync.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index aba23151aa..2928f38186 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -84,7 +84,7 @@ class LdapSync extends Command } /* Determine which location to assign users to by default. */ - $location = NULL; + $location = NULL; // FIXME - this would be better called "$default_location", which is more explicit about its purpose if ($this->option('location')!='') { $location = Location::where('name', '=', $this->option('location'))->first(); @@ -106,8 +106,8 @@ class LdapSync extends Command $ldap_ou_locations = Location::where('ldap_ou', '!=', '')->get()->toArray(); $ldap_ou_lengths = array(); - foreach ($ldap_ou_locations as $location) { - $ldap_ou_lengths[] = strlen($location["ldap_ou"]); + foreach ($ldap_ou_locations as $ou_loc) { + $ldap_ou_lengths[] = strlen($ou_loc["ldap_ou"]); } array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations);