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

custom Ldap port #96

Open
quenenni opened this issue Sep 26, 2022 · 1 comment
Open

custom Ldap port #96

quenenni opened this issue Sep 26, 2022 · 1 comment
Assignees
Labels

Comments

@quenenni
Copy link

Describe the bug
A little bug when trying to use a custom port to access the Ldap server.

To Reproduce
Steps to reproduce the behavior:

  1. In 'LDAP/config_ldap.php', put a custom port to $ldap_port (of course, you need to have your Ldap server listening to that port)
  2. Connections to Ldap server are all on port 389

Project (please complete the following information):

  • Project Version: cloned the master few days ago

Additional context

The problem is in LDAP/LDAP.php file, line 40:
$ldap = ldap_connect($ldap_host, $ldap_port)

From https://www.php.net/manual/en/function.ldap-connect.php, the use of the port as a second parameter is deprecated.
They kept it for backwards compatibility, but you have to place the port in the Uri transmitted as the first parameter.

$ldap_uri  = $ldap_host.":".$ldap_port;
$ldap = ldap_connect($ldap_uri)

(careful to not end the ldap_host option with a slash)

And now it connects on the right port.

@WanpengQian
Copy link

Could you submit a pull request? This would help ensure a smooth merge into the repository.

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

No branches or pull requests

3 participants