snipe / snipe-it

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

[Feature Request]: LDAP Add config option to make FASLE = Enabled #14926

Open azmcnutt opened 3 months ago

azmcnutt commented 3 months ago

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

Some LDAP sources do not provide an LDAP Active Flag where TRUE or 1 = enabled. For instance, Google LDAP has a field called "suspended" where TRUE or 1 = account is not enabled.

Could an option be added to LDAP setup to change from LDAP Active Flag to LDAP Inactive Flag? So if the setting is not checked, the setting would work as normal. However, if the setting was checked or set to Inactive Flag, the LDAP field would return 1 or TRUE when the account is to be deactivated.

Describe alternatives you've considered

Currently I change the source after each upgrade. These are the change I make to the source: Edit the file app/Console/Commands/LdapSync.php Around line 337 Make the following change: From: $filter_var = filter_var($raw_value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); To: $filter_var = !filter_var($raw_value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); (add ! in front of = (!)filter)

While this is probably not the correct way to do things, the outcome provides what I need for Syncing with Google LDAP.

Additional context

We have been self hosted for quite some time, but we would like to eliminate on-premises servers. If this change were implemented, my organization would change to Snipe hosting services. I could also take a proposal to leadership to pay to have this feature added for our needs.

mengxunlingxue commented 1 month ago

我们目前开源环境中,也有该需求,希望能够支持