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

update docs

parent d7db2552
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ return [
$aConfig = require_once('inc_config.php');
require_once '[APPROOT]/classes/ldap.class.php';
$oLdap=new imlldap($aConfig['ldap-maser']);
$oLdap=new imlldap($aConfig['ldap-master']);
```
## Methods
......
......@@ -33,7 +33,7 @@ return [
$aConfig = require_once('inc_config.php');
require_once '[APPROOT]/classes/ldap.class.php';
$oLdap=new imlldap($aConfig['ldap-maser']);
$oLdap=new imlldap($aConfig['ldap-master']);
// ...
......
......@@ -42,7 +42,31 @@ $oLdap = new imlldap($aConfig);
$oLdap->debugOn();
// 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)) {
...
// 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();
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment