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

update docs

parent d7db2552
Branches update-docs
No related tags found
No related merge requests found
...@@ -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-master']);
``` ```
## Methods ## Methods
......
...@@ -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-master']);
// ... // ...
......
...@@ -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();
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment