LdapClient

LDAP client class

deprecated
since

1.0

deprecated

The joomla/ldap package is deprecated

Methods

__construct

Constructor

__construct(object $configObj = null) 
since

1.0

Arguments

$configObj

objectAn 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

stringThe DN of the entry to add the attribute

$entry

arrayAn 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

stringThe username

$password

stringThe 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

stringThe DN which contains the attribute you want to compare

$attribute

stringThe attribute whose value you want to compare

$value

stringThe value you want to check against the LDAP attribute

Response

boolean|integerBoolean 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

stringThe DN where you want to put the object

$entries

arrayAn 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

stringThe 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

stringThe subject string

$ignore

stringCharacters to ignore when escaping.

$flags

integerThe 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
static
since

1.0

Arguments

$password

stringClear text password to encrypt

$type

stringType 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
static
since

1.0

Arguments

$ip

stringIP 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
static

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

stringThe network address

Response

array

modify

Modify an LDAP entry

modify(string $dn, string $attribute) : boolean
since

1.0

Arguments

$dn

stringThe DN which contains the attribute you want to modify

$attribute

stringThe 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

stringThe DN of the object you want to read

Response

array|booleanArray 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

stringThe DN which contains the attribute you want to remove

$attribute

stringThe 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

stringThe DN of the entry at the moment

$newdn

stringThe DN of the entry should be (only cn=newvalue)

$newparent

stringThe full DN of the parent (null by default)

$deleteolddn

booleanDelete the old values (default)

Response

boolean

replace

Replace attribute values with new ones

replace(string $dn, string $attribute) : boolean
since

1.0

Arguments

$dn

stringThe DN which contains the attribute you want to replace

$attribute

stringThe attribute values you want to replace

Response

boolean

setDn

Sets the DN with some template replacements

setDn(string $username, string $nosub) : void
since

1.0

Arguments

$username

stringThe username

$nosub

string...

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

ignore_reqcert_tls

Ignore TLS Certificate (encrypted communications)

since

1.5.0

Type(s)

boolean

ldap_debug

Enable LDAP debug

since

1.5.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