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
1e839d79
Commit
1e839d79
authored
10 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update docs
parent
d7db2552
Branches
update-docs
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/20_Usage.md
+1
-1
1 addition, 1 deletion
docs/20_Usage.md
docs/40_Configuration.md
+1
-1
1 addition, 1 deletion
docs/40_Configuration.md
docs/50_Examples.md
+25
-1
25 additions, 1 deletion
docs/50_Examples.md
with
27 additions
and
3 deletions
docs/20_Usage.md
+
1
−
1
View file @
1e839d79
...
@@ -31,7 +31,7 @@ return [
...
@@ -31,7 +31,7 @@ return [
$aConfig
=
require_once
(
'inc_config.php'
);
$aConfig
=
require_once
(
'inc_config.php'
);
require_once
'[APPROOT]/classes/ldap.class.php'
;
require_once
'[APPROOT]/classes/ldap.class.php'
;
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-maser'
]);
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-mas
t
er'
]);
```
```
## Methods
## Methods
...
...
This diff is collapsed.
Click to expand it.
docs/40_Configuration.md
+
1
−
1
View file @
1e839d79
...
@@ -33,7 +33,7 @@ return [
...
@@ -33,7 +33,7 @@ return [
$aConfig
=
require_once
(
'inc_config.php'
);
$aConfig
=
require_once
(
'inc_config.php'
);
require_once
'[APPROOT]/classes/ldap.class.php'
;
require_once
'[APPROOT]/classes/ldap.class.php'
;
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-maser'
]);
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-mas
t
er'
]);
// ...
// ...
...
...
This diff is collapsed.
Click to expand it.
docs/50_Examples.md
+
25
−
1
View file @
1e839d79
...
@@ -42,7 +42,31 @@ $oLdap = new imlldap($aConfig);
...
@@ -42,7 +42,31 @@ $oLdap = new imlldap($aConfig);
$oLdap
->
debugOn
();
$oLdap
->
debugOn
();
// then do something ... the first action will conect and bind
// then do something ... the first action will conect and bind
```
## Add a member
This snippet is a function to add eg a user DN as member to an application or other group.
```
php
/*
string $sDn DN i.e. of an application / group that has member entries
string $sMemberDN DN of a user or for smb group: uid of member
string $sAttribute attribute to handle; default: member; for smb group "memberUid"
*/
$oLdap
=
new
imlldap
(
$aConfig
[
'ldap-master'
]);
if
(
$oLdap
->
objectAttributeAndValueExist
(
$sDn
,
$sAttribute
,
$sMemberDN
))
{
if
(
$oLdap
->
objectAttributeAndValueExist
(
$sDn
,
$sAttribute
,
$sMemberDN
))
{
...
// SKIP - $sMemberDN is a member in $sDn already
// ...
}
else
{
if
(
$oLdap
->
objAddAttr
(
$sDn
,
array
(
$sAttribute
=>
$sMemberDN
)))
{
// OK - member was added
// ...
}
else
{
// ERROR - adding the member failed
// ...
}
}
}
$oLdap
->
close
();
```
```
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