snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.96k stars 3.16k forks source link

People Location LDAP sync does not sync users in the respective LDAP Search OU #15557

Open Toby737 opened 2 weeks ago

Toby737 commented 2 weeks ago

Debug mode

Describe the bug

I have 3 Locations setup and each with an LDAP Search OU. When I perform an LDAP Sync in the People section, and select one of the Locations, it doesn't sync the users based off the LDAP Search OU assigned to the Location. Eg. Office 1 (ID 1) with LDAP Search OU as ou=staff,ou=office1,ou=officepeople,dc=domain,dc=com Office 2 (ID 2) with LDAP Search OU as ou=staff,ou=office2,ou=officepeople,dc=domain,dc=com Office 3 (ID 5) with LDAP Search OU as ou=staff,ou=office3,ou=officepeople,dc=domain,dc=com

When I select to LDAP Sync for the Office 1, it will display a small number of users synced but from a mixture of users from Office 2 and 3.

If I selection Office 2, it will display results saying it updated and created users from Office 2 and 3.

It must've worked previously as I had office specific users synced in their respective Locations, just for some reason it doesn't seem to be working now.

In my LDAP Settings, I have the Base Bind DN as ou=officepeople,dc=domain,dc=com LDAP Location is left blank.

I have tried the following commands via terminal... php artisan config:clear php artisan config:cache

php artisan snipeit:ldap-sync --location_id=1 --summary

Restarting HTTPD

Restarting the server

Reproduction steps

  1. In People, click LDAP Sync
  2. Select the desired Location and click Synchronize.
  3. Results will display that it has updated and created users but not from their respective LDAP OU.

Expected behavior

When selecting a specific Location, the expectation is that it syncs only the users based off the LDAP Search OU.

Screenshots

No response

Snipe-IT Version

7.0.13

Operating System

CentOS 9

Web Server

Apache

PHP Version

8.3.12

Operating System

Windows

Browser

Edge, Chrome, FireFox

Version

Latest

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
snmp
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Additional context

No response

Toby737 commented 1 week ago

Hello, Just to add to this. Just updated to 7.0.13 and still same behavior. I also actually just added a 4th office with its respective LDAP Search OU. Performed an LDAP sync for Office 1 and it ended up syncing all the users from the Active Directory OU for the 4th office. So regardless if I select to LDAP sync users for Office 1, 2, or 3, it will just end up syncing users only from the last office that was entered into Snipe-IT. In my case, users for Office 4.

Toby737 commented 4 days ago

Hi all, Just found this previous issue... https://github.com/snipe/snipe-it/pull/14559

Just as a test, I setup a test instance of 7.0.0-pre in which this bug was supposed to have been resolved. Tested by setting up LDAP settings. Then created the locations. First Office 1, then Office 2. When I then do a people sync for Office 1, it syncs only all the ldap users for Office 2. The last location that was entered into Snipe-IT. Location Office 1 remains with 0 sync'ed users from ldap.

Could this bug still be present?

erdemyanik2 commented 2 days ago

Hello. I have the same problem

Snipe-IT Version 7.0.13

Operating System Ubuntu

Web Server Nginx

PHP Version 8.3