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

[ldap] Add ldap domain socket (ldapi:///) support #24497

Closed
zenlord opened this issue Dec 2, 2020 · 9 comments
Closed

[ldap] Add ldap domain socket (ldapi:///) support #24497

zenlord opened this issue Dec 2, 2020 · 9 comments

Comments

@zenlord
Copy link
Contributor

zenlord commented Dec 2, 2020

See ##7737 for a description of the issue. That bug was closed in May 2019, but in my 20.0.2 installation of nextcloud, the problem is still present.

I have identified the files that require changes in the user_ldap app:

  • lib/Connection.php (backend)
  • lib/LDAP.php (backend)
  • lib/Wizard.php (frontend)

Making the changes to the backend files as done previously by @nick-dumas in his commit nick-dumas@72b8054 has proven to work for me, so I intend to make the required changes and then send in a PR.

@zenlord zenlord added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 2, 2020
@nick-dumas
Copy link

Thanks @zenlord.
I ran a patched version for a while and it worked for me, so feel free to use my changes.

@zenlord
Copy link
Contributor Author

zenlord commented Dec 3, 2020

I'm struggling with the frontend patch. I have made the required changes to get the Wizard to respond 'Configuration OK', but the tab headings for 'Users', 'Login Attributes' etc. stay greyed out and do not become available.

@nextcloud/ldap @blizzz any hints where the checks to enable these tabs can be found so I can send in a pull request?

@blizzz
Copy link
Member

blizzz commented Dec 3, 2020

@zenlord this probably depends on ajax/testConfiguration.php which eventually triggers the doCriticalValidation() in lib/Connection.php. But the changes on the linked commit should deal with it. Maybe you double check that?

@zenlord
Copy link
Contributor Author

zenlord commented Dec 3, 2020

@blizzz At first I thought my configuration was at fault, but even after resetting to default I still was unable to switch tabs in the LDAP settings section.

The ajax/ folder doesn't contain anything relevant, but the js/wizard/ folder does (83 hits for 'port' spread over 20 files :( ), and it seems that quite some checks are triggering an auto-detection of the port number. I'll do some further digging, but JS is not my strongsuit.

@zenlord
Copy link
Contributor Author

zenlord commented Dec 3, 2020

I made some progress by adding an additional condition in two functions inside js/wizard/view.js:

basicStatusCheck()

if((host && port  && base) && ((!agent && !pwd) || (agent && pwd))) {
  view.enableTabs();
} else if((host && base && host.indexOf('ldapi://') > -1 ) && ((!agent && !pwd) || (agent && pwd))) {
  view.enableTabs();
} else {
  view.disableTabs();
}

(and similar in functionalityCheck()

But the behaviour is erratic: e.g. the check for a username returns 'user found', but the count for users returns 0 ...

@zenlord
Copy link
Contributor Author

zenlord commented Dec 3, 2020

Errors were indeed in my configuration (and in me misunderstanding the 'edit Query filter' functionality - one has to click the underlined text for the filter in the textfield to become active...).
I'll send in a pull request over the weekend.

@szaimen szaimen added 2. developing Work in progress enhancement feature: ldap and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 18, 2021
@zenlord
Copy link
Contributor Author

zenlord commented Nov 20, 2021

Not sure what I have to do. I have filed a pull request that solves this issue almost one year ago, and I am able to apply the patches manually to versions 20, 21 and now also 22.2.3. The PR just sits there.
#24574
Am I doing something wrong?

@xandris
Copy link

xandris commented Jun 12, 2023

@zenlord #24574 is merged now, is this issue resolved?

@zenlord
Copy link
Contributor Author

zenlord commented Jun 25, 2023

Yes, I just upgraded this instance to v26.0.3 and I no longer have to patch the source files myself.

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

No branches or pull requests

5 participants