Generates a LDAP compatible password
static string
generatePassword
(string $password, [string $type = 'md5'])
-
string
$password: Clear text password to encrypt
-
string
$type: Type of password hash, either md5 or SHA
Converts a dot notation IP address to net address (e.g. for Netware, etc)
static string
ipToNetAddress
(string $ip)
-
string
$ip: IP Address (e.g. xxx.xxx.xxx.xxx)
Extract readable network address from the LDAP encoded networkAddress attribute.
Please keep this document block and author attribution in place.
Novell Docs, see: http://developer.novell.com/ndk/doc/ndslib/schm_enu/data/sdk5624.html#sdk5624 for Address types: http://developer.novell.com/ndk/doc/ndslib/index.html?page=/ndk/doc/ndslib/schm_enu/data/sdk4170.html LDAP Format, String: taggedData = uint32String "#" octetstring byte 0 = uint32String = Address Type: 0= IPX Address; 1 = IP Address byte 1 = char = "#" - separator byte 2+ = octetstring - the ordinal value of the address Note: with eDirectory 8.6.2, the IP address (type 1) returns correctly, however, an IPX address does not seem to. eDir 8.7 may correct this. Enhancement made by Merijn van de Schoot: If addresstype is 8 (UDP) or 9 (TCP) do some additional parsing like still returning the IP address
static array
LDAPNetAddr
(string $networkaddress)
-
string
$networkaddress: The network address
Constructor
JClientLdap
__construct
([object $configObj = null])
-
object
$configObj: An object of configuration variables
Redefined in descendants as:
Add an attribute to the given DN Note: DN has to exist already
boolean
add
(string $dn, array $entry)
-
string
$dn: The DN of the entry to add the attribute
-
array
$entry: An array of arrays with attributes to add
Anonymously binds to LDAP directory
array
anonymous_bind
()
Binds to the LDAP directory
boolean
bind
([string $username = null], [string $password = null], [string $nosub = 0])
-
string
$username: The username
-
string
$password: The password
-
string
$nosub: ...
Close the connection
void
close
()
Compare an entry and return a true or false result
mixed
compare
(string $dn, string $attribute, string $value)
-
string
$dn: The DN which contains the attribute you want to compare
-
string
$attribute: The attribute whose value you want to compare
-
string
$value: The value you want to check against the LDAP attribute
Connect to server
boolean
connect
()
Create a new DN
boolean
create
(string $dn, array $entries)
-
string
$dn: The DN where you want to put the object
-
array
$entries: An array of arrays describing the object to add
Deletes a given DN from the tree
boolean
delete
(string $dn)
-
string
$dn: The DN of the object you want to delete
Get the DN
string
getDN
()
Returns the error message
string
getErrorMsg
()
Modifies an entry and return a true or false result
mixed
modify
(string $dn, string $attribute)
-
string
$dn: The DN which contains the attribute you want to modify
-
string
$attribute: The attribute values you want to modify
Read all or specified attributes of given dn
mixed
read
(string $dn)
-
string
$dn: The DN of the object you want to read
Removes attribute value from given dn and return a true or false result
mixed
remove
(string $dn, string $attribute)
-
string
$dn: The DN which contains the attribute you want to remove
-
string
$attribute: The attribute values you want to remove
Rename the entry
boolean
rename
(string $dn, string $newdn, string $newparent, boolean $deleteolddn)
-
string
$dn: The DN of the entry at the moment
-
string
$newdn: The DN of the entry should be (only cn=newvalue)
-
string
$newparent: The full DN of the parent (null by default)
-
boolean
$deleteolddn: Delete the old values (default)
Replace an entry and return a true or false result
mixed
replace
(string $dn, string $attribute)
-
string
$dn: The DN which contains the attribute you want to replace
-
string
$attribute: The attribute values you want to replace
Performs an LDAP search
array
search
(array $filters, [string $dnoverride = null], [array $attributes = array()])
-
array
$filters: Search Filters (array of strings)
-
string
$dnoverride: DN Override
-
array
$attributes: An array of attributes to return (if empty, all fields are returned).
Sets the DN with some template replacements
void
setDN
(string $username, [string $nosub = 0])
-
string
$username: The username
-
string
$nosub: ...
Perform an LDAP search using comma separated search strings
array
simple_search
(string $search)
-
string
$search: search string of search values