Class JLDAP

Description

LDAP client class

  • since: 11.1

Located in /libraries/joomla/client/ldap.php (line 19)

JObject
   |
   --JLDAP
Variable Summary
string $base_dn
string $host
boolean $negotiate_tls
boolean $no_referrals
string $password
int $port
string $username
string $users_dn
boolean $use_ldapV3
string $_dn
mixed $_resource
Method Summary
JLDAP __construct ([object $configObj = null])
boolean add (string $dn, array $entry)
array anonymous_bind ()
boolean bind ([string $username = null], [string $password = null], [string $nosub = 0])
void close ()
mixed compare (string $dn, string $attribute, string $value)
boolean connect ()
boolean create (string $dn, array $entries)
boolean delete (string $dn)
string generatePassword (string $password, [string $type = 'md5'])
string getDN ()
string getErrorMsg ()
string ipToNetAddress (string $ip)
array LDAPNetAddr (string $networkaddress)
mixed modify (string $dn, string $attribute)
mixed read (string $dn, [string $attribute = array()])
mixed remove (string $dn, string $attribute)
boolean rename (string $dn, string $newdn, string $newparent, boolean $deleteolddn)
mixed replace (string $dn, string $attribute)
array search (array $filters, [string $dnoverride = null])
void setDN (string $username, [string $nosub = 0])
array simple_search (string $search)
Variables
bool $auth_method = null (line 31)
  • var: Authorization Method to use
  • since: 11.1
  • access: public
string $base_dn = null (line 43)
  • var: Base DN (e.g. o=MyDir)
  • since: 11.1
  • access: public
string $host = null (line 25)
  • var: Hostname of LDAP server
  • since: 11.1
  • access: public
boolean $negotiate_tls = null (line 73)
  • var: Negotiate TLS (encrypted communications)
  • since: 11.1
  • access: public
boolean $no_referrals = null (line 67)
  • var: No referrals (server transfers)
  • since: 11.1
  • access: public
string $password = null (line 86)
  • var: Password to connect to server
  • since: 11.1
  • access: public
int $port = null (line 37)
  • var: Port of LDAP server
  • since: 11.1
  • access: public
string $search_string = null (line 55)
  • var: Search String
  • since: 11.1
  • access: public
string $username = null (line 79)
  • var: Username to connect to server
  • since: 11.1
  • access: public
string $users_dn = null (line 49)
  • var: User DN (e.g. cn=Users,o=MyDir)
  • since: 11.1
  • access: public
boolean $use_ldapV3 = null (line 61)
  • var: Use LDAP Version 3
  • since: 11.1
  • access: public
string $_dn = null (line 99)
  • var: Current DN
  • since: 11.1
  • access: private
mixed $_resource = null (line 92)
  • var: LDAP Resource Identifier
  • since: 11.1
  • access: private

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 108)

Constructor

  • since: 11.1
  • access: public
JLDAP __construct ([object $configObj = null])
  • object $configObj: An object of configuration variables

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
add (line 463)

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

  • return: Result of operation
  • access: public
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
anonymous_bind (line 226)

Anonymously binds to LDAP directory

  • since: 11.1
  • access: public
array anonymous_bind ()
bind (line 243)

Binds to the LDAP directory

  • since: 11.1
  • access: public
boolean bind ([string $username = null], [string $password = null], [string $nosub = 0])
  • string $username: The username
  • string $password: The password
  • string $nosub: ...
close (line 176)

Close the connection

  • since: 11.1
  • access: public
void close ()
compare (line 398)

Compare an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 11.1
  • access: public
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 (line 134)

Connect to server

  • return: True if successful
  • since: 11.1
  • access: public
boolean connect ()
create (line 449)

Create a new DN

  • return: Result of operation
  • access: public
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
delete (line 436)

Deletes a given DN from the tree

  • return: Result of operation
  • access: public
boolean delete (string $dn)
  • string $dn: The DN of the object you want to delete
generatePassword (line 611)

Generates a LDAP compatible password

  • return: Encrypted password
  • since: 11.1
  • access: public
string generatePassword (string $password, [string $type = 'md5'])
  • string $password: Clear text password to encrypt
  • string $type: Type of password hash, either md5 or SHA
getDN (line 214)

Get the DN

  • return: The current dn
  • since: 11.1
  • access: public
string getDN ()
getErrorMsg (line 492)

Returns the error message

  • return: error message
  • since: 11.1
  • access: public
string getErrorMsg ()
ipToNetAddress (line 506)

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

  • return: Net address
  • since: 11.1
  • access: public
string ipToNetAddress (string $ip)
  • string $ip: IP Address (e.g. xxx.xxx.xxx.xxx)
LDAPNetAddr (line 547)

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

  • author: Jay Burrell, Systems & Networks, Mississippi State University
  • since: 11.1
  • access: public
array LDAPNetAddr (string $networkaddress)
  • string $networkaddress: The network address
modify (line 366)

Modifies an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 11.1
  • access: public
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 (line 413)

Read all or specified attributes of given dn

  • return: array of attributes or -1 on error
  • since: 11.1
  • access: public
mixed read (string $dn, [string $attribute = array()])
  • string $dn: The DN of the object you want to read
  • string $attribute: The attribute values you want to read (Optional)
remove (line 381)

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

  • return: result of comparison (true, false, -1 on error)
  • since: 11.1
  • access: public
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 (line 480)

Rename the entry

  • return: Result of operation
  • since: 11.1
  • access: public
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 (line 351)

Replace an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 11.1
  • access: public
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
search (line 288)

Perform an LDAP search

  • return: Multidimensional array of results
  • since: 11.1
  • access: public
array search (array $filters, [string $dnoverride = null])
  • array $filters: Search Filters (array of strings)
  • string $dnoverride: DN Override
setDN (line 191)

Sets the DN with some template replacements

  • since: 11.1
  • access: public
void setDN (string $username, [string $nosub = 0])
  • string $username: The username
  • string $nosub: ...
simple_search (line 268)

Perform an LDAP search using comma separated search strings

  • return: Search results
  • since: 11.1
  • access: public
array simple_search (string $search)
  • string $search: search string of search values

Inherited Methods

Inherited From JObject

JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:56:13 -0500 by phpDocumentor 1.4.4