LdapClient
LDAP client class
since |
1.0 |
---|---|
deprecated |
The joomla/ldap package is deprecated |
Methods
__construct
Constructor
__construct(object $configObj = null)
since |
1.0 |
---|
Arguments
- $configObj
object
An object of configuration variables
__destruct
Class destructor.
__destruct()
since |
1.3.0 |
---|
add
Add attribute values to current attributes
add(string $dn, array $entry) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN of the entry to add the attribute- $entry
array
An array of arrays with attributes to add
Response
boolean
anonymous_bind
Anonymously binds to LDAP directory
anonymous_bind() : boolean
since |
1.0 |
---|
Response
boolean
bind
Binds to the LDAP directory
bind(string $username = null, string $password = null, string $nosub) : boolean
since |
1.0 |
---|
Arguments
- $username
string
The username- $password
string
The password- $nosub
string
...
Response
boolean
close
Close the connection
close() : void
since |
1.0 |
---|
compare
Compare value of attribute found in entry specified with DN
compare(string $dn, string $attribute, string $value) : boolean|integer
since |
1.0 |
---|
Arguments
- $dn
string
The DN which contains the attribute you want to compare- $attribute
string
The attribute whose value you want to compare- $value
string
The value you want to check against the LDAP attribute
Response
boolean|integer
Boolean result of the comparison or -1 on error
connect
Connect to an LDAP server
connect() : boolean
since |
1.0 |
---|
Response
boolean
create
Add entries to LDAP directory
create(string $dn, array $entries) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN where you want to put the object- $entries
array
An array of arrays describing the object to add
Response
boolean
delete
Delete an entry from a directory
delete(string $dn) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN of the object you want to delete
Response
boolean
escape
Escape a string
escape(string $value, string $ignore = '', integer $flags) : string
since |
1.2.0 |
---|
Arguments
- $value
string
The subject string- $ignore
string
Characters to ignore when escaping.- $flags
integer
The context the escaped string will be used in LDAP_ESCAPE_FILTER or LDAP_ESCAPE_DN
Response
string
generatePassword
Generates a LDAP compatible password
generatePassword(string $password, string $type = 'md5') : string
since |
1.0 |
---|
Arguments
- $password
string
Clear text password to encrypt- $type
string
Type of password hash, either md5 or SHA
Response
string
getDn
Get the configured DN
getDn() : string
since |
1.0 |
---|
Response
string
getErrorMsg
Return the LDAP error message of the last LDAP command
getErrorMsg() : string
since |
1.0 |
---|
Response
string
ipToNetAddress
Converts a dot notation IP address to net address (e.g. for Netware, etc)
ipToNetAddress(string $ip) : string
since |
1.0 |
---|
Arguments
- $ip
string
IP Address (e.g. xxx.xxx.xxx.xxx)
Response
string
isConnected
Check if the connection is established
isConnected() : boolean
since |
1.3.0 |
---|
Response
boolean
ldapNetAddr
Extract readable network address from the LDAP encoded networkAddress attribute.
ldapNetAddr(string $networkaddress) : array
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
author |
Jay Burrell, Systems & Networks, Mississippi State University |
---|---|
since |
1.0 |
Arguments
- $networkaddress
string
The network address
Response
array
modify
Modify an LDAP entry
modify(string $dn, string $attribute) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN which contains the attribute you want to modify- $attribute
string
The attribute values you want to modify
Response
boolean
read
Read attributes of a given DN
read(string $dn) : array|boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN of the object you want to read
Response
array|boolean
Array of attributes for the given DN or boolean false on failure
remove
Delete attribute values from current attributes
remove(string $dn, string $attribute) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN which contains the attribute you want to remove- $attribute
string
The attribute values you want to remove
Response
boolean
rename
Modify the name of an entry
rename(string $dn, string $newdn, string $newparent, boolean $deleteolddn) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN of the entry at the moment- $newdn
string
The DN of the entry should be (only cn=newvalue)- $newparent
string
The full DN of the parent (null by default)- $deleteolddn
boolean
Delete the old values (default)
Response
boolean
replace
Replace attribute values with new ones
replace(string $dn, string $attribute) : boolean
since |
1.0 |
---|
Arguments
- $dn
string
The DN which contains the attribute you want to replace- $attribute
string
The attribute values you want to replace
Response
boolean
search
Performs an LDAP search
search(array $filters, string $dnoverride = null, array $attributes = array()) : array
since |
1.0 |
---|
Arguments
- $filters
array
Search Filters (array of strings)- $dnoverride
string
DN Override- $attributes
array
An array of attributes to return (if empty, all fields are returned).
Response
array
Multidimensional array of results
setDn
Sets the DN with some template replacements
setDn(string $username, string $nosub) : void
since |
1.0 |
---|
Arguments
- $username
string
The username- $nosub
string
...
simple_search
Perform an LDAP search using comma separated search strings
simple_search(string $search) : array
since |
1.0 |
---|
Arguments
- $search
string
search string of search values
Response
array
Search results
unbind
Unbinds from the LDAP directory
unbind() : boolean
since |
1.3.0 |
---|
Response
boolean
Properties
host
Hostname of LDAP server
since |
1.0 |
---|
Type(s)
string
auth_method
Authorization Method to use
since |
1.0 |
---|
Type(s)
boolean
port
Port of LDAP server
since |
1.0 |
---|
Type(s)
integer
base_dn
Base DN (e.g. o=MyDir)
since |
1.0 |
---|
Type(s)
string
users_dn
User DN (e.g. cn=Users,o=MyDir)
since |
1.0 |
---|
Type(s)
string
search_string
Search String
since |
1.0 |
---|
Type(s)
string
use_ldapV3
Use LDAP Version 3
since |
1.0 |
---|
Type(s)
boolean
no_referrals
No referrals (server transfers)
since |
1.0 |
---|
Type(s)
boolean
negotiate_tls
Negotiate TLS (encrypted communications)
since |
1.0 |
---|
Type(s)
boolean
username
Username to connect to server
since |
1.0 |
---|
Type(s)
string
password
Password to connect to server
since |
1.0 |
---|
Type(s)
string
resource
LDAP Resource Identifier
since |
1.0 |
---|
Type(s)
resource
dn
Current DN
since |
1.0 |
---|
Type(s)
string
isBound
Flag tracking whether the connection has been bound
since |
1.3.0 |
---|
Type(s)
boolean