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
Commits
7af1139d
Commit
7af1139d
authored
10 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
remove connection port (use server value "
ldaps://<host
>:<port>" if needed)
parent
1f2aca7a
No related branches found
No related tags found
1 merge request
!6
Update docs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ldap.class.php
+16
-14
16 additions, 14 deletions
src/ldap.class.php
with
16 additions
and
14 deletions
src/ldap.class.php
+
16
−
14
View file @
7af1139d
...
...
@@ -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__
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment