Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #15696: Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap #15697

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cniccolo
Copy link

@cniccolo cniccolo commented Oct 19, 2024

Description

Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap

Fixes #15696

Type of change

Please delete options that are not relevant.

  • [X ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Has been tested on our server

Test Configuration:

  • PHP version: 8.3
  • MySQL version 10.11.8-MariaDB
  • Webserver version 2.4.58
  • OS version Ubuntu 24.04

Checklist:

  • [ X] I have read the Contributing documentation available here: https://snipe-it.readme.io/docs/contributing-overview
  • [ X] I have formatted this PR according to the project guidelines: https://snipe-it.readme.io/docs/contributing-overview#pull-request-guidelines
  • [ X] My code follows the style guidelines of this project
  • [ X] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [X ] My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • [ X] New and existing unit tests pass locally with my changes

See bugreport LDAP login fails for users that have set ldap_import=0
@cniccolo cniccolo requested a review from snipe as a code owner October 19, 2024 21:18
Copy link

welcome bot commented Oct 19, 2024

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link

what-the-diff bot commented Oct 19, 2024

PR Summary

  • Optimized User Database Query
    Removed a condition originally included in the database search query. This facilitates the system's process of finding the user in the database, improving the software's efficiency.

@cniccolo cniccolo changed the title fixes #15696 - Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap Fixed #15696 - Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap Oct 19, 2024
@cniccolo cniccolo changed the title Fixed #15696 - Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap Fixed #15696: Removes the requirement for a user to have ldap_import set to 1 to be able to logon using ldap Oct 19, 2024
@snipe
Copy link
Owner

snipe commented Oct 19, 2024

The ldap_import field was added years ago ago, so it would be pretty unusual to have the scenario described in the original issue - and if you’re using the API to import users, if you want them to login via ldap, you can/should have set that flag to 1. Additionally, bulk user edit allows you to toggle that setting. This problem seems pretty niche, and the reason for the check in the login is to prevent a call to the LDAP server if they’re not even allowed to login that way.

@snipe
Copy link
Owner

snipe commented Oct 22, 2024

(Also this would need to be retargeted to develop, per the dev documentation.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LDAP login fails for users that have set ldap_import=0
2 participants