Merge pull request #13828 from Godmartinz/ldap_location_sync

fixed ldap location sync
This commit is contained in:
snipe 2023-11-02 12:20:01 +00:00 committed by GitHub
commit c5e1cdbcee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,12 @@ class LdapSync extends Command
$summary = [];
try {
if ($this->option('base_dn') != '') {
if ( $this->option('location_id') != '') {
$location_ou= Location::where('id', '=', $this->option('location_id'))->value('ldap_ou');
$search_base = $location_ou;
Log::debug('Importing users from specified location OU: \"'.$search_base.'\".');
}
else if ($this->option('base_dn') != '') {
$search_base = $this->option('base_dn');
Log::debug('Importing users from specified base DN: \"'.$search_base.'\".');
} else {