Joomla! CMS 3.3 API

JClientLdap

LDAP client class

package

Joomla.Platform

subpackage

Client

since

12.1

Methods

__construct

Constructor

__construct(object $configObj = null) 
since

12.1

Arguments

$configObj

objectAn object of configuration variables

add

Add an attribute to the given DN Note: DN has to exist already

add(string $dn, array $entry) : boolean
since

12.1

Arguments

$dn

stringThe DN of the entry to add the attribute

$entry

arrayAn array of arrays with attributes to add

Response

booleanResult of operation

anonymous_bind

Anonymously binds to LDAP directory

anonymous_bind() : array
since

12.1

Response

array

bind

Binds to the LDAP directory

bind(string $username = null, string $password = null, string $nosub) : boolean
since

12.1

Arguments

$username

stringThe username

$password

stringThe password

$nosub

string...

Response

boolean

close

Close the connection

close() : void
since

12.1

compare

Compare an entry and return a true or false result

compare(string $dn, string $attribute, string $value) : mixed
since

12.1

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

mixedresult of comparison (true, false, -1 on error)

connect

Connect to server

connect() : boolean
since

12.1

Response

booleanTrue if successful

create

Create a new DN

create(string $dn, array $entries) : boolean
since

12.1

Arguments

$dn

stringThe DN where you want to put the object

$entries

arrayAn array of arrays describing the object to add

Response

booleanResult of operation

delete

Deletes a given DN from the tree

delete(string $dn) : boolean
since

12.1

Arguments

$dn

stringThe DN of the object you want to delete

Response

booleanResult of operation

generatePassword

Generates a LDAP compatible password

generatePassword(string $password, string $type = 'md5') : string
static
since

12.1

Arguments

$password

stringClear text password to encrypt

$type

stringType of password hash, either md5 or SHA

Response

stringEncrypted password

getDN

Get the DN

getDN() : string
since

12.1

Response

stringThe current dn

getErrorMsg

Returns the error message

getErrorMsg() : string
since

12.1

Response

stringerror message

ipToNetAddress

Converts a dot notation IP address to net address (e.g. for Netware, etc)

ipToNetAddress(string $ip) : string
static
since

12.1

Arguments

$ip

stringIP Address (e.g. xxx.xxx.xxx.xxx)

Response

stringNet address

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

12.1

Arguments

$networkaddress

stringThe network address

Response

array

modify

Modifies an entry and return a true or false result

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

12.1

Arguments

$dn

stringThe DN which contains the attribute you want to modify

$attribute

stringThe attribute values you want to modify

Response

mixedresult of comparison (true, false, -1 on error)

read

Read all or specified attributes of given dn

read(string $dn) : mixed
since

12.1

Arguments

$dn

stringThe DN of the object you want to read

Response

mixedarray of attributes or -1 on error

remove

Removes attribute value from given dn and return a true or false result

remove(string $dn, string $attribute) : mixed
since

12.1

Arguments

$dn

stringThe DN which contains the attribute you want to remove

$attribute

stringThe attribute values you want to remove

Response

mixedresult of comparison (true, false, -1 on error)

rename

Rename the entry

rename(string $dn, string $newdn, string $newparent, boolean $deleteolddn) : boolean
since

12.1

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

booleanResult of operation

replace

Replace an entry and return a true or false result

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

12.1

Arguments

$dn

stringThe DN which contains the attribute you want to replace

$attribute

stringThe attribute values you want to replace

Response

mixedresult of comparison (true, false, -1 on error)

setDN

Sets the DN with some template replacements

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

12.1

Arguments

$username

stringThe username

$nosub

string...

Properties

host

Hostname of LDAP server

host : string
var

Hostname of LDAP server

since

12.1

Type(s)

string

auth_method

Authorization Method to use

auth_method : boolean
var

Authorization Method to use

since

12.1

Type(s)

boolean

port

Port of LDAP server

port : integer
var

Port of LDAP server

since

12.1

Type(s)

integer

base_dn

Base DN (e.g. o=MyDir)

base_dn : string
var

Base DN (e.g. o=MyDir)

since

12.1

Type(s)

string

users_dn

User DN (e.g. cn=Users,o=MyDir)

users_dn : string
var

User DN (e.g. cn=Users,o=MyDir)

since

12.1

Type(s)

string

search_string

Search String

search_string : string
var

Search String

since

12.1

Type(s)

string

use_ldapV3

Use LDAP Version 3

use_ldapV3 : boolean
var

Use LDAP Version 3

since

12.1

Type(s)

boolean

no_referrals

No referrals (server transfers)

no_referrals : boolean
var

No referrals (server transfers)

since

11.1

Type(s)

boolean

negotiate_tls

Negotiate TLS (encrypted communications)

negotiate_tls : boolean
var

Negotiate TLS (encrypted communications)

since

12.1

Type(s)

boolean

username

Username to connect to server

username : string
var

Username to connect to server

since

12.1

Type(s)

string

password

Password to connect to server

password : string
var

Password to connect to server

since

12.1

Type(s)

string

_resource

LDAP Resource Identifier

_resource : mixed
var

LDAP Resource Identifier

since

12.1

Type(s)

mixed

_dn

Current DN

_dn : string
var

Current DN

since

12.1

Type(s)

string