Class JClientLdap

Description

LDAP client class

  • since: 12.1

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


	
			
Direct descendents
Class Description
 class JLDAP Deprecated class placeholder. You should use JClientLdap instead.
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
Method Summary
 static string generatePassword (string $password, [string $type = 'md5'])
 static string ipToNetAddress (string $ip)
 static array LDAPNetAddr (string $networkaddress)
 JClientLdap __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 getDN ()
 string getErrorMsg ()
 mixed modify (string $dn, string $attribute)
 mixed read (string $dn)
 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], [array $attributes = array()])
 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: 12.1
  • access: public
string $base_dn = null (line 43)
  • var: Base DN (e.g. o=MyDir)
  • since: 12.1
  • access: public
string $host = null (line 25)
  • var: Hostname of LDAP server
  • since: 12.1
  • access: public
boolean $negotiate_tls = null (line 73)
  • var: Negotiate TLS (encrypted communications)
  • since: 12.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: 12.1
  • access: public
int $port = null (line 37)
  • var: Port of LDAP server
  • since: 12.1
  • access: public
string $search_string = null (line 55)
  • var: Search String
  • since: 12.1
  • access: public
string $username = null (line 79)
  • var: Username to connect to server
  • since: 12.1
  • access: public
string $users_dn = null (line 49)
  • var: User DN (e.g. cn=Users,o=MyDir)
  • since: 12.1
  • access: public
boolean $use_ldapV3 = null (line 61)
  • var: Use LDAP Version 3
  • since: 12.1
  • access: public
Methods
static generatePassword (line 644)

Generates a LDAP compatible password

  • return: Encrypted password
  • since: 12.1
  • access: public
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
static ipToNetAddress (line 532)

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

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

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: 12.1
  • access: public
static array LDAPNetAddr (string $networkaddress)
  • string $networkaddress: The network address
Constructor __construct (line 108)

Constructor

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

Redefined in descendants as:
add (line 489)

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

  • return: Result of operation
  • since: 12.1
  • 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 233)

Anonymously binds to LDAP directory

  • since: 12.1
  • access: public
array anonymous_bind ()
bind (line 251)

Binds to the LDAP directory

  • since: 12.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 183)

Close the connection

  • since: 12.1
  • access: public
void close ()
compare (line 419)

Compare an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 12.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 136)

Connect to server

  • return: True if successful
  • since: 12.1
  • access: public
boolean connect ()
create (line 473)

Create a new DN

  • return: Result of operation
  • since: 12.1
  • 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 458)

Deletes a given DN from the tree

  • return: Result of operation
  • since: 12.1
  • access: public
boolean delete (string $dn)
  • string $dn: The DN of the object you want to delete
getDN (line 221)

Get the DN

  • return: The current dn
  • since: 12.1
  • access: public
string getDN ()
getErrorMsg (line 518)

Returns the error message

  • return: error message
  • since: 12.1
  • access: public
string getErrorMsg ()
modify (line 386)

Modifies an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 12.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 433)

Read all or specified attributes of given dn

  • return: array of attributes or -1 on error
  • since: 12.1
  • access: public
mixed read (string $dn)
  • string $dn: The DN of the object you want to read
remove (line 401)

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

  • return: result of comparison (true, false, -1 on error)
  • since: 12.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 506)

Rename the entry

  • return: Result of operation
  • since: 12.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 371)

Replace an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • since: 12.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 301)

Performs an LDAP search

  • return: Multidimensional array of results
  • since: 12.1
  • access: public
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).
setDN (line 198)

Sets the DN with some template replacements

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

Perform an LDAP search using comma separated search strings

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

Documentation generated on Tue, 19 Nov 2013 15:06:45 +0100 by phpDocumentor 1.4.3