Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Ldap Php Class
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Ldap Php Class
Merge requests
!6
Update docs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update docs
update-docs
into
master
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
update-docs
into
master
10 months ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
7af1139d
Prev
Next
Show latest version
1 file
+
16
−
14
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
7af1139d
remove connection port (use server value "
ldaps://<host
>:<port>" if needed)
· 7af1139d
Hahn Axel (hahn)
authored
10 months ago
src/ldap.class.php
+
16
−
14
Options
@@ -4,13 +4,18 @@
*
* 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-08-18 ah mask password (showing 4 chars only)
* 2022-08-22 ah mhash is deprecated
* 2022-08-26 ah fix verifyPassword
* 2024-07-11 ah php8 only: use variable types; update phpdocs
*
* @author axel.hahn@unibe.ch
* 2024-07-12 ah remove connection port (use server value "ldaps://<host>:<port>" if needed)
*/
class
imlldap
{
@@ -24,7 +29,6 @@ class imlldap
*/
private
array
$_aLdap
=
[
'server'
=>
false
,
'port'
=>
false
,
'DnLdapUser'
=>
false
,
// ldap rdn oder dn
'PwLdapUser'
=>
false
,
'DnUserNode'
=>
false
,
// ou=People...
@@ -132,17 +136,15 @@ class imlldap
// ----------------------------------------------------------------------
/**
* set a ldap config
* set a ldap config
or modify existing value
*
* @param array $aConfig new config items
* 'server' => 'ldaps://ldap.example.com',
* 'port' => 636,
* 'DnLdapUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn
* 'PwLdapUser' => 'IkHEFFzlZ...99j0h8WdI0LrLhxU', // password
* '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
* 'debugLevel' => 0 // for debugging set higher 0 AND call debugOn()
* @param array $aConfig new config items with these keys
* 'server' => 'ldaps://ldap.example.com',
* 'DnLdapUser' => 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com', // ldap rdn oder dn
* 'PwLdapUser' => 'PasswordOfLookupUser', // password
* 'DnUserNode' => 'ou=People,ou=ORG,dc=org,dc=example.com',
* 'protoVersion' => 3
* 'debugLevel' => 0 // value for LDAP_OPT_DEBUG_LEVEL in debugOn()
*/
public
function
setConfig
(
array
$aConfig
=
[]):
void
{
@@ -189,7 +191,7 @@ class imlldap
$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'
]);
if
(
!
$this
->
_ldapConn
)
{
$this
->
_wLdaperror
(
__FUNCTION__
);
Loading