Merge branch 'develop' of https://github.com/snipe/snipe-it into develop

This commit is contained in:
snipe 2020-12-02 11:01:10 -08:00
commit 71d0e6369e

View file

@ -84,7 +84,7 @@ class LdapSync extends Command
} }
/* Determine which location to assign users to by default. */ /* 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')!='') { if ($this->option('location')!='') {
$location = Location::where('name', '=', $this->option('location'))->first(); $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_locations = Location::where('ldap_ou', '!=', '')->get()->toArray();
$ldap_ou_lengths = array(); $ldap_ou_lengths = array();
foreach ($ldap_ou_locations as $location) { foreach ($ldap_ou_locations as $ou_loc) {
$ldap_ou_lengths[] = strlen($location["ldap_ou"]); $ldap_ou_lengths[] = strlen($ou_loc["ldap_ou"]);
} }
array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations); array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations);