Skip to content
Snippets Groups Projects
Commit 7af1139d authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

remove connection port (use server value "ldaps://<host>:<port>" if needed)

parent 1f2aca7a
No related branches found
No related tags found
1 merge request!6Update docs
...@@ -4,13 +4,18 @@ ...@@ -4,13 +4,18 @@
* *
* IML LDAP CONNECTOR * IML LDAP CONNECTOR
* *
* @author axel.hahn@unibe.ch
* @license GNU GPL v3
*
* SOURCE: <https://git-repo.iml.unibe.ch/iml-open-source/ldap-php-class/>
* DOCS: <https://os-docs.iml.unibe.ch/ldap-php-class/index.html>
*
* 2022-02-22 ah added objGet(), sanitizeFilter() * 2022-02-22 ah added objGet(), sanitizeFilter()
* 2022-08-18 ah mask password (showing 4 chars only) * 2022-08-18 ah mask password (showing 4 chars only)
* 2022-08-22 ah mhash is deprecated * 2022-08-22 ah mhash is deprecated
* 2022-08-26 ah fix verifyPassword * 2022-08-26 ah fix verifyPassword
* 2024-07-11 ah php8 only: use variable types; update phpdocs * 2024-07-11 ah php8 only: use variable types; update phpdocs
* * 2024-07-12 ah remove connection port (use server value "ldaps://<host>:<port>" if needed)
* @author axel.hahn@unibe.ch
*/ */
class imlldap class imlldap
{ {
...@@ -24,7 +29,6 @@ class imlldap ...@@ -24,7 +29,6 @@ class imlldap
*/ */
private array $_aLdap = [ private array $_aLdap = [
'server' => false, 'server' => false,
'port' => false,
'DnLdapUser' => false, // ldap rdn oder dn 'DnLdapUser' => false, // ldap rdn oder dn
'PwLdapUser' => false, 'PwLdapUser' => false,
'DnUserNode' => false, // ou=People... 'DnUserNode' => false, // ou=People...
...@@ -132,17 +136,15 @@ class imlldap ...@@ -132,17 +136,15 @@ class imlldap
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
/** /**
* set a ldap config * set a ldap config or modify existing value
* *
* @param array $aConfig new config items * @param array $aConfig new config items with these keys
* 'server' => 'ldaps://ldap.example.com', * 'server' => 'ldaps://ldap.example.com',
* 'port' => 636,
* 'DnLdapUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn * 'DnLdapUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn
* 'PwLdapUser' => 'IkHEFFzlZ...99j0h8WdI0LrLhxU', // password * 'PwLdapUser' => 'PasswordOfLookupUser', // password
* 'DnUserNode' => 'ou=People,ou=ORG,dc=org,dc=example.com', * 'DnUserNode' => 'ou=People,ou=ORG,dc=org,dc=example.com',
* 'DnAppNode' => '' optional dn ... if a user must be member of a given group
* 'protoVersion' => 3 * 'protoVersion' => 3
* 'debugLevel' => 0 // for debugging set higher 0 AND call debugOn() * 'debugLevel' => 0 // value for LDAP_OPT_DEBUG_LEVEL in debugOn()
*/ */
public function setConfig(array $aConfig = []): void public function setConfig(array $aConfig = []): void
{ {
...@@ -189,7 +191,7 @@ class imlldap ...@@ -189,7 +191,7 @@ class imlldap
$this->close(); $this->close();
} }
$this->_w(__FUNCTION__ . ' connect to ' . $this->_aLdap['server'] . ':' . $this->_aLdap['port']); $this->_w(__FUNCTION__ . ' connect to ' . $this->_aLdap['server']);
$this->_ldapConn = ldap_connect($this->_aLdap['server']); $this->_ldapConn = ldap_connect($this->_aLdap['server']);
if (!$this->_ldapConn) { if (!$this->_ldapConn) {
$this->_wLdaperror(__FUNCTION__); $this->_wLdaperror(__FUNCTION__);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment