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
a3e648d2
"...bash-rest-api-client.git" did not exist on "f776ae3216a746d770645f8ec4d6ebe921a7c3b6"
Commit
a3e648d2
authored
10 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update docs
parent
7af1139d
No related branches found
No related tags found
Loading
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/20_Usage.md
+10
-16
10 additions, 16 deletions
docs/20_Usage.md
docs/30_Methods.md
+1
-1
1 addition, 1 deletion
docs/30_Methods.md
docs/40_Configuration.md
+40
-8
40 additions, 8 deletions
docs/40_Configuration.md
docs/50_Examples.md
+3
-8
3 additions, 8 deletions
docs/50_Examples.md
with
54 additions
and
33 deletions
docs/20_Usage.md
+
10
−
16
View file @
a3e648d2
...
...
@@ -10,24 +10,18 @@ require_once '[APPROOT]/classes/ldap.class.php';
As an example I create a hash named $aConfig and save it as "inc_config.php".
```
php
return
[
...
'ldap-master'
=>
[
'server'
=>
'ldaps://ldap.example.com'
,
'DnLdapUser'
=>
'cn=Lookup,ou=Service,dc=some,dc=example.com'
,
'PwLdapUser'
=>
'PasswordOfLookupUser'
,
// node where to find users that are allowed to login
'DnUserNode'
=>
'ou=People,dc=some,dc=example.com'
,
// node where to find my app
'DnAppNode'
=>
'cn=MyApp,dc=some,dc=example.com'
,
'debugLevel'
=>
0
,
],
...
...
'ldap-master'
=>
[
'server'
=>
'ldaps://ldap.example.com'
,
'DnLdapUser'
=>
'cn=Lookup,ou=Service,dc=some,dc=example.com'
,
'PwLdapUser'
=>
'PasswordOfLookupUser'
,
// See Configuration page for all values.
],
...
];
```
...
...
This diff is collapsed.
Click to expand it.
docs/30_Methods.md
+
1
−
1
View file @
a3e648d2
...
...
@@ -83,7 +83,7 @@ set a ldap config
'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
'PwLdapUser' => '
PasswordOfLookupUser',
// 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
...
...
This diff is collapsed.
Click to expand it.
docs/40_Configuration.md
+
40
−
8
View file @
a3e648d2
...
...
@@ -2,11 +2,43 @@
When initializing a new imlldap object or use setConfig then you can apply these values:
Var | Type | Desciption | Example
-- |-- |-- |--
'server' | string | Server connection with "ldap(s)://host[:port]" | 'ldaps://ldap.example.com'
'DnLdapUser' | string | Bind user as ldap rdn or dn | 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com'
'PwLdapUser' | string | password for bind user |
'DnUserNode' | string | for user metods: set a DN where users are | 'ou=People,ou=ORG,dc=org,dc=example.com'
'protoVersion' | integer | ldap protocol version | 3
'debugLevel' | integer | Value for LDAP_OPT_DEBUG_LEVEL | 7
Var | Type | Desciption | Example
-- |-- |-- |--
`server`
| string | Server connection with "ldap(s)://host[:port]" | 'ldaps://ldap.example.com'
`DnLdapUser`
| string | Bind user as ldap rdn or dn | 'cn=Lookup,ou=ServiceAccounts,dc=org,dc=example.com'
`PwLdapUser`
| string | password for bind user | 'PasswordOfLookupUser'
`DnUserNode`
| string | for user metods: set a DN where users are | 'ou=People,ou=ORG,dc=org,dc=example.com'
`protoVersion`
| integer | ldap protocol version | 3
`debugLevel`
| integer | Value for LDAP_OPT_DEBUG_LEVEL when using debugOn() | 7
### Example:
As an example I create a hash named $aConfig and save it as "inc_config.php".
```
php
return
[
...
'ldap-master'
=>
[
'server'
=>
'ldaps://ldap.example.com'
,
'DnLdapUser'
=>
'cn=Lookup,ou=Service,dc=some,dc=example.com'
,
'PwLdapUser'
=>
'PasswordOfLookupUser'
,
'DnUserNode'
=>
'ou=People,dc=some,dc=example.com'
,
'debugLevel'
=>
0
,
],
...
];
```
```
php
$aConfig
=
require_once
(
'inc_config.php'
);
require_once
'[APPROOT]/classes/ldap.class.php'
;
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-maser'
]);
// ...
// update a single config item
$oLdap
->
setConfig
([
'debugLevel'
=>
3
,
]);
```
This diff is collapsed.
Click to expand it.
docs/50_Examples.md
+
3
−
8
View file @
a3e648d2
...
...
@@ -10,7 +10,7 @@ $aUser = $oLdap->getUserInfo("john@example.com", ["memberof", "uid"]);
print_r
(
$oLdap
->
normalizeSearchentry
(
$aUser
));
```
##
#
Verify user and password for login
## Verify user and password for login
```
php
// set values from $_FORM or $_POST data of your login form here
...
...
@@ -32,18 +32,13 @@ $oLdap->close();
## Debugging
If you want to find connection problems then use debugOn().
This enables the echoing of ldap actions for connect, bind and more.
This enables the echoing of ldap actions for connect, bind and class internal debug messages.
```
php
// this will set LDAP_OPT_DEBUG_LEVEL
$aConfig
[
'debugLevel'
]
=
7
;
$oLdap
=
new
imlldap
(
$aConfig
);
// enable showing debug output
// This method sets LDAP_OPT_DEBUG_LEVEL to $aConfig['debugLevel'];
$oLdap
->
debugOn
();
// then do something ... the first action will conect and bind
...
...
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