[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/ldap/src/ -> LdapClient.php (summary)

Part of the Joomla Framework LDAP Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 807 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

LdapClient:: (26 methods):
  __construct()
  __destruct()
  connect()
  close()
  setDn()
  getDn()
  anonymous_bind()
  bind()
  unbind()
  simple_search()
  search()
  replace()
  modify()
  remove()
  compare()
  read()
  delete()
  create()
  add()
  rename()
  escape()
  getErrorMsg()
  isConnected()
  ipToNetAddress()
  ldapNetAddr()
  generatePassword()


Class: LdapClient  - X-Ref

LDAP client class

__construct($configObj = null)   X-Ref
Constructor

param: object  $configObj  An object of configuration variables

__destruct()   X-Ref
Class destructor.


connect()   X-Ref
Connect to an LDAP server

return: boolean

close()   X-Ref
Close the connection

return: void

setDn($username, $nosub = 0)   X-Ref
Sets the DN with some template replacements

param: string  $username  The username
param: string  $nosub     ...
return: void

getDn()   X-Ref
Get the configured DN

return: string

anonymous_bind()   X-Ref
Anonymously binds to LDAP directory

return: boolean

bind($username = null, $password = null, $nosub = 0)   X-Ref
Binds to the LDAP directory

param: string  $username  The username
param: string  $password  The password
param: string  $nosub     ...
return: boolean

unbind()   X-Ref
Unbinds from the LDAP directory

return: boolean

simple_search($search)   X-Ref
Perform an LDAP search using comma separated search strings

param: string  $search  search string of search values
return: array  Search results

search(array $filters, $dnoverride = null, array $attributes = array()   X-Ref
Performs an LDAP search

param: array   $filters     Search Filters (array of strings)
param: string  $dnoverride  DN Override
param: array   $attributes  An array of attributes to return (if empty, all fields are returned).
return: array  Multidimensional array of results

replace($dn, $attribute)   X-Ref
Replace attribute values with new ones

param: string  $dn         The DN which contains the attribute you want to replace
param: string  $attribute  The attribute values you want to replace
return: boolean

modify($dn, $attribute)   X-Ref
Modify an LDAP entry

param: string  $dn         The DN which contains the attribute you want to modify
param: string  $attribute  The attribute values you want to modify
return: boolean

remove($dn, $attribute)   X-Ref
Delete attribute values from current attributes

param: string  $dn         The DN which contains the attribute you want to remove
param: string  $attribute  The attribute values you want to remove
return: boolean

compare($dn, $attribute, $value)   X-Ref
Compare value of attribute found in entry specified with DN

param: string  $dn         The DN which contains the attribute you want to compare
param: string  $attribute  The attribute whose value you want to compare
param: string  $value      The value you want to check against the LDAP attribute
return: boolean|integer  Boolean result of the comparison or -1 on error

read($dn)   X-Ref
Read attributes of a given DN

param: string  $dn  The DN of the object you want to read
return: array|boolean  Array of attributes for the given DN or boolean false on failure

delete($dn)   X-Ref
Delete an entry from a directory

param: string  $dn  The DN of the object you want to delete
return: boolean

create($dn, array $entries)   X-Ref
Add entries to LDAP directory

param: string  $dn       The DN where you want to put the object
param: array   $entries  An array of arrays describing the object to add
return: boolean

add($dn, array $entry)   X-Ref
Add attribute values to current attributes

param: string  $dn     The DN of the entry to add the attribute
param: array   $entry  An array of arrays with attributes to add
return: boolean

rename($dn, $newdn, $newparent, $deleteolddn)   X-Ref
Modify the name of an entry

param: string   $dn           The DN of the entry at the moment
param: string   $newdn        The DN of the entry should be (only cn=newvalue)
param: string   $newparent    The full DN of the parent (null by default)
param: boolean  $deleteolddn  Delete the old values (default)
return: boolean

escape($value, $ignore = '', $flags = 0)   X-Ref
Escape a string

param: string   $value   The subject string
param: string   $ignore  Characters to ignore when escaping.
param: integer  $flags   The context the escaped string will be used in LDAP_ESCAPE_FILTER or LDAP_ESCAPE_DN
return: string

getErrorMsg()   X-Ref
Return the LDAP error message of the last LDAP command

return: string

isConnected()   X-Ref
Check if the connection is established

return: boolean

ipToNetAddress($ip)   X-Ref
Converts a dot notation IP address to net address (e.g. for Netware, etc)

param: string  $ip  IP Address (e.g. xxx.xxx.xxx.xxx)
return: string

ldapNetAddr($networkaddress)   X-Ref
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
param: string  $networkaddress  The network address
return: array

generatePassword($password, $type = 'md5')   X-Ref
Generates a LDAP compatible password

param: string  $password  Clear text password to encrypt
param: string  $type      Type of password hash, either md5 or SHA
return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer