Joomla! 1.5 API

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2011 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JLDAP

Description

LDAP client class

  • since: 1.5

Located in /joomla/client/ldap.php (line 25)

Class JObject   (Subpackage Base)

Class JLDAP   (Subpackage Client)
Variable Summary
Variable string $base_dn
Variable string $host
Variable boolean $negotiate_tls
Variable boolean $no_referrals
Variable string $password
Variable int $port
Variable string $username
Variable string $users_dn
Variable boolean $use_ldapV3
Variable string $_dn
Variable mixed $_resource
Method Summary
Constructor JLDAP __construct ([object An $configObj = null])
Method bool add (string $dn, array $entry)
Method void anonymous_bind ()
Method boolean bind ([string $username = null], [string $password = null], [ $nosub = 0])
Method void close ()
Method mixed compare (string $dn, string $attribute, string $value)
Method boolean connect ()
Method bool create (string $dn, array $entries)
Method bool delete (string $dn)
Method string generatePassword (string $password, [string $type = 'md5'])
Method string getDN ()
Method string getErrorMsg ()
Method string ipToNetAddress (string $ip)
Method void LDAPNetAddr ( $networkaddress)
Method mixed modify (string $dn, string $attribute)
Method array read (string $dn, [string $attribute = array()])
Method mixed remove (string $dn, string $attribute)
Method bool rename (string $dn, string $newdn, string $newparent, bool $deleteolddn)
Method mixed replace (string $dn, string $attribute)
Method array search (array $filters, [string $dnoverride = null])
Method void setDN (string $username, [ $nosub = 0])
Method void simple_search (string $search)
Variables
bool $auth_method = null (line 32)
  • var: Authorization Method to use
string $base_dn = null (line 38)
  • var: Base DN (e.g. o=MyDir)
string $host = null (line 29)
  • var: Hostname of LDAP server
boolean $negotiate_tls = null (line 53)
  • var: Negotiate TLS (encrypted communications)
boolean $no_referrals = null (line 50)
  • var: No referrals (server transfers)
string $password = null (line 60)
  • var: Password to connect to server
int $port = null (line 35)
  • var: Port of LDAP server
string $search_string = null (line 44)
  • var: Search String
string $username = null (line 57)
  • var: Username to connect to server
string $users_dn = null (line 41)
  • var: User DN (e.g. cn=Users,o=MyDir)
boolean $use_ldapV3 = null (line 47)
  • var: Use LDAP Version 3
string $_dn = null (line 67)
  • var: Current DN
mixed $_resource = null (line 64)
  • var: LDAP Resource Identifier

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 75)

Constructor

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

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

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

  • return: Result of operation
bool add (string $dn, array $entry)
  • string $dn: dn The DN of the entry to add the attribute
  • array $entry: entry An array of arrays with attributes to add
anonymous_bind (line 159)

Anonymously Binds to LDAP Directory

void anonymous_bind ()
bind (line 173)

Binds to the LDAP directory

  • return: Result
  • access: public
boolean bind ([string $username = null], [string $password = null],  $nosub)
  • string $username: The username
  • string $password: The password
  • $nosub
close (line 127)

Close the connection

  • access: public
void close ()
compare (line 300)

Compare an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
  • access: public
mixed compare (string $dn, string $attribute, string $value)
  • string $dn: dn The DN which contains the attribute you want to compare
  • string $attribute: attribute The attribute whose value you want to compare
  • string $value: value The value you want to check against the LDAP attribute
connect (line 96)

Connect to server

  • return: True if successful
  • access: public
boolean connect ()
create (line 343)

Create a new DN

  • return: result of operation
bool create (string $dn, array $entries)
  • string $dn: dn The DN where you want to put the object
  • array $entries: entries An array of arrays describing the object to add
delete (line 332)

Deletes a given DN from the tree

  • return: result of operation
  • access: public
bool delete (string $dn)
  • string $dn: dn The DN of the object you want to delete
generatePassword (line 475)

Generates a LDAP compatible password

  • return: encrypted password
string generatePassword (string $password, [string $type = 'md5'])
  • string $password: password Clear text password to encrypt
  • string $type: type Type of password hash, either md5 or SHA
getDN (line 152)
  • return: The current dn
  • access: public
string getDN ()
getErrorMsg (line 377)

Returns the error message

  • return: error message
string getErrorMsg ()
ipToNetAddress (line 388)

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

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

extract readable network address from the LDAP encoded networkAddress attribute.

  • author:

    Jay Burrell, Systems & Networks, Mississippi State University 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

void LDAPNetAddr ( $networkaddress)
  • $networkaddress
modify (line 274)

Modifies an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
mixed modify (string $dn, string $attribute)
  • string $dn: dn The DN which contains the attribute you want to modify
  • string $attribute: attribute The attribute values you want to modify
read (line 312)

Read all or specified attributes of given dn

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

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

  • return: result of comparison (true, false, -1 on error)
mixed remove (string $dn, string $attribute)
  • string $dn: dn The DN which contains the attribute you want to remove
  • string $attribute: attribute The attribute values you want to remove
rename (line 368)

Rename the entry

  • return: Result of operation
bool rename (string $dn, string $newdn, string $newparent, bool $deleteolddn)
  • string $dn: dn The DN of the entry at the moment
  • string $newdn: newdn The DN of the entry should be (only cn=newvalue)
  • string $newparent: newparent The full DN of the parent (null by default)
  • bool $deleteolddn: deleteolddn Delete the old values (default)
replace (line 262)

Replace an entry and return a true or false result

  • return: result of comparison (true, false, -1 on error)
mixed replace (string $dn, string $attribute)
  • string $dn: dn The DN which contains the attribute you want to replace
  • string $attribute: attribute The attribute values you want to replace
search (line 210)

Perform an LDAP search

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

Sets the DN with some template replacements

  • access: public
void setDN (string $username,  $nosub)
  • string $username: The username
  • $nosub
simple_search (line 192)

Perform an LDAP search using comma seperated search strings

void simple_search (string $search)
  • string $search: search string of search values

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()
Support Joomla!