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
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("*"))`
## `public function getUserInfo(string $sUser, array $aAttributesToGet = ["*"]): bool|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).
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).
...
@@ -219,15 +213,15 @@ search user by a given username or email address. It returns false if the user d
...
@@ -219,15 +213,15 @@ search user by a given username or email address. It returns false if the user d
Var | Type | Desciption
Var | Type | Desciption
-- |-- |--
-- |-- |--
$sUser | type | user id (uid) or email (mail) to search
$sUser | string | user id (uid) or email (mail) to search
$aAttributesToGet | type | i.e. array("ou", "sn", "vorname", "mail", "uid", "memberOf")
## `public function getUserDn(string $sUser): bool|string`
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).
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).
...
@@ -235,14 +229,14 @@ search for a DN entry with the lookup user by a given username or email address.
...
@@ -235,14 +229,14 @@ search for a DN entry with the lookup user by a given username or email address.
Var | Type | Desciption
Var | Type | Desciption
-- |-- |--
-- |-- |--
$sUser | type | %s
$sUser | string | %s
**Return:**
**Return:**
string
string
---
---
## `public function setPassword($sUser, $sPW)`
## `public function setPassword(string $sUser, string $sPW): bool`
set a password for a given user; this requires a ldap bind with master/ admin account
set a password for a given user; this requires a ldap bind with master/ admin account
...
@@ -258,7 +252,7 @@ $sPW | string | password
...
@@ -258,7 +252,7 @@ $sPW | string | password
boolean
boolean
---
---
## `private function _getNTLMHash($Input)`
## `private function _getNTLMHash(string $Input): string`
get NTLM hash from a string taken from https://secure.php.net/manual/en/ref.hash.php
get NTLM hash from a string taken from https://secure.php.net/manual/en/ref.hash.php
...
@@ -273,7 +267,7 @@ $Input | string | %s
...
@@ -273,7 +267,7 @@ $Input | string | %s
string
string
---
---
## `public function setPasswordSamba($sUser, $sPW)`
## `public function setPasswordSamba(string $sUser, string $sPW): bool`
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
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
...
@@ -289,23 +283,23 @@ $sPW | string | password
...
@@ -289,23 +283,23 @@ $sPW | string | password
boolean
boolean
---
---
## `public function objAdd($sDn, $aItem)`
## `public function objAdd(string $sDn, array $aItem): bool`
update an ldap object this requires a ldap bind with master/ admin account
update an ldap object this requires a ldap bind with master/ admin account It returns true if the action was successful
**Parameters:**
**Parameters:**
Var | Type | Desciption
Var | Type | Desciption
-- |-- |--
-- |-- |--
$sDn | string | dn to update
$sDn | string | dn to update
$aItem | string | array of new ldap properties
$aItem | array | array of new ldap properties
**Return:**
**Return:**
boolean
boolean
---
---
## `public function objAddAttr($sDn, $aItem)`
## `public function objAddAttr(string $sDn, array $aItem): bool`
update an ldap attribute this requires a ldap bind with master/ admin account
update an ldap attribute this requires a ldap bind with master/ admin account
...
@@ -314,16 +308,16 @@ update an ldap attribute this requires a ldap bind with master/ admin account
...
@@ -314,16 +308,16 @@ update an ldap attribute this requires a ldap bind with master/ admin account
Var | Type | Desciption
Var | Type | Desciption
-- |-- |--
-- |-- |--
$sDn | string | dn to update
$sDn | string | dn to update
$aItem | string | array of new ldap properties
$aItem | array | array of new ldap properties
**Return:**
**Return:**
boolean
boolean
---
---
## `public function objGet($sDn, $sSearchFilter='(objectclass=*)', $aAttributesToGet = array("*"))`
read attributes from ldap node with given DN (using ldap_read)
read attributes from ldap node with given DN (using ldap_read) It returns "false" if the action was not successful - no ldap connection - DN or filter didn't match
**Parameters:**
**Parameters:**
...
@@ -335,12 +329,12 @@ $aAttributesToGet | array | flat array of attributes to fetch
...
@@ -335,12 +329,12 @@ $aAttributesToGet | array | flat array of attributes to fetch
**Return:**
**Return:**
array
boolean|array
---
---
## `public function objUpdate($sDn, $aItem)`
## `public function objUpdate(string $sDn, array $aItem): bool`
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
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 It returns "false" if the action failed