'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()
**Parameters:**
Var | Type | Desciption
-- |-- |--
$aConfig | array | new config items
---
## `public function close()`
close an existing ldap connection
---
## `public function connect()`
connect to ldap
---
## `public function bind($sUser = '', $sPw = '')`
ldap bind connects with a ldap user. If the ldap connection was not opened yet the connection will be established. If a binding exists it will be unbind
## `public function getUserInfo($sUser, $aAttributesToGet = array("*"))`
search user by a given username or email address. It returns false if the user does not exist or is not member of the group 'DnAppNode' (if it was set).
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sUser | type | user id (uid) or email (mail) to search
$aAttributesToGet | type | i.e. array("ou", "sn", "vorname", "mail", "uid", "memberOf")
**Return:**
boolean|array
---
## `public function getUserDn($sUser)`
search for a DN entry with the lookup user by a given username or email address. It returns false if the user does not exist or is not member of the group 'DnAppNode' (if it was set).
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sUser | type | %s
**Return:**
string
---
## `public function setPassword($sUser, $sPW)`
set a password for a given user; this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sUser | string | username or email
$sPW | string | password
**Return:**
boolean
---
## `private function _getNTLMHash($Input)`
get NTLM hash from a string taken from https://secure.php.net/manual/en/ref.hash.php
**Parameters:**
Var | Type | Desciption
-- |-- |--
$Input | string | %s
**Return:**
string
---
## `public function setPasswordSamba($sUser, $sPW)`
set a password for a given user for Samba this requires a ldap bind with master/ admin account see https://msdn.microsoft.com/en-us/library/cc223248.aspx see http://php.net/ldap-modify-batch - last examle see https://secure.php.net/manual/en/ref.hash.php
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sUser | string | username or email
$sPW | string | password
**Return:**
boolean
---
## `public function objAdd($sDn, $aItem)`
update an ldap object this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | dn to update
$aItem | string | array of new ldap properties
**Return:**
boolean
---
## `public function objAddAttr($sDn, $aItem)`
update an ldap attribute this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | dn to update
$aItem | string | array of new ldap properties
**Return:**
boolean
---
## `public function objGet($sDn, $sSearchFilter='(objectclass=*)', $aAttributesToGet = array("*"))`
read attributes from ldap node with given DN (using ldap_read)
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | DN to search for
$sSearchFilter | string | filter in ldap filter syntax
$aAttributesToGet | array | flat array of attributes to fetch
**Return:**
array
---
## `public function objUpdate($sDn, $aItem)`
update an ldap object with given key-value array if the attribute (key) does not exist it will be created. this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | full DN where to update the item
$aItem | array | updated entry
**Return:**
boolean
---
## `public function objDelete($sDn)`
delete an ldap object this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | full DN to remove
**Return:**
boolean
---
## `public function objDeleteAttr($sDn, $aItem)`
delete attributes of an ldap object this requires a ldap bind with master/ admin account
TODO: Test me
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | DN
$aItem | string | item to remove
**Return:**
boolean
---
## `public function objectAttributeExists($sDn, $sAttribute)`
check if an attribute exists in a DN
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | DN
$sAttribute | string | attribute name to check
$sAttrValue | string | value to check
**Return:**
boolean
---
## `public function objectAttributeAndValueExist($sDn, $sAttribute, $sAttrValue)`
check if an attribute and value exist in a DN
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | DN
$sAttribute | string | attribute name to check
$sAttrValue | string | value to check
**Return:**
boolean
---
## `public function objectAttributeAndValueMustExist($sDn, $sAttribute, $sAttrValue)`
check an attribute and value; it will be created if it does not exist this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sDn | string | dn to update
$sAttribute | string | attribute name to check
$sAttrValue | string | value to check
**Return:**
boolean
---
## `public function userAdd($aItem, $sDn = false)`
create a new user item this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$aItem | array | ldap properties
$sDn | string | optional DN where to create the user
**Return:**
boolean
---
## `public function userDelete($sUserDn)`
delete a user this requires a ldap bind with master/ admin account
**Parameters:**
Var | Type | Desciption
-- |-- |--
$sUser | string | user to update
$sPW | string | new password to set
**Return:**
boolean
---
## `public function userUpdate($aItem)`
update an ldap object this requires a ldap bind with master/ admin account