JOOMLA中国
  • Joomla中国首页
  • 社区
  • 教程
  • 应用市场
  • B计划
Joomla! Framework TM
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Composer
    • Autoload
  • Joomla
    • Application
      • Cli
        • Output
          • Processor
      • Web
    • Data
    • DI
      • Exception
    • Event
    • Filter
    • Input
    • Ldap
    • Registry
      • Format
    • Session
      • Storage
    • String
    • Uri
    • Utilities
  • None
  • PasswordCompat
    • binary
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Yaml
        • Exception
    • Polyfill
      • Util

Classes

  • LdapClient

Class LdapClient

LDAP client class

Direct known subclasses

JClientLdap

Indirect known subclasses

JLDAP

Namespace: Joomla\Ldap
Since: 1.0
Located at vendor/joomla/ldap/src/LdapClient.php

Methods summary

public
# __construct( object $configObj = null )

Constructor

Constructor

Parameters

$configObj
object - $configObj An object of configuration variables

Since

1.0
public boolean
# connect( )

Connect to server

Connect to server

Returns

boolean - True if successful

Since

1.0
public
# close( )

Close the connection

Close the connection

Since

1.0
public
# setDN( string $username, string $nosub = 0 )

Sets the DN with some template replacements

Sets the DN with some template replacements

Parameters

$username
string - $username The username
$nosub
string - $nosub ...

Since

1.0
public string
# getDN( )

Get the DN

Get the DN

Returns

string - The current dn

Since

1.0
public array
# anonymous_bind( )

Anonymously binds to LDAP directory

Anonymously binds to LDAP directory

Returns

array

Since

1.0
public boolean
# bind( string $username = null, string $password = null, string $nosub = 0 )

Binds to the LDAP directory

Binds to the LDAP directory

Parameters

$username
string - $username The username
$password
string - $password The password
$nosub
string - $nosub ...

Returns

boolean

Since

1.0
public array
# simple_search( string $search )

Perform an LDAP search using comma separated search strings

Perform an LDAP search using comma separated search strings

Parameters

$search
string - $search search string of search values

Returns

array - Search results

Since

1.0
public array
# search( array $filters, string $dnoverride = null, array $attributes = array() )

Performs an LDAP search

Performs an LDAP search

Parameters

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

Returns

array - Multidimensional array of results

Since

1.0
public mixed
# replace( string $dn, string $attribute )

Replace an entry and return a true or false result

Replace an entry and return a true or false result

Parameters

$dn
string - $dn The DN which contains the attribute you want to replace
$attribute
string - $attribute The attribute values you want to replace

Returns

mixed - result of comparison (true, false, -1 on error)

Since

1.0
public mixed
# modify( string $dn, string $attribute )

Modifies an entry and return a true or false result

Modifies an entry and return a true or false result

Parameters

$dn
string - $dn The DN which contains the attribute you want to modify
$attribute
string - $attribute The attribute values you want to modify

Returns

mixed - result of comparison (true, false, -1 on error)

Since

1.0
public mixed
# remove( string $dn, string $attribute )

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

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

Parameters

$dn
string - $dn The DN which contains the attribute you want to remove
$attribute
string - $attribute The attribute values you want to remove

Returns

mixed - result of comparison (true, false, -1 on error)

Since

1.0
public mixed
# compare( string $dn, string $attribute, string $value )

Compare an entry and return a true or false result

Compare an entry and return a true or false result

Parameters

$dn
string - $dn The DN which contains the attribute you want to compare
$attribute
string - $attribute The attribute whose value you want to compare
$value
string - $value The value you want to check against the LDAP attribute

Returns

mixed - result of comparison (true, false, -1 on error)

Since

1.0
public mixed
# read( string $dn )

Read all or specified attributes of given dn

Read all or specified attributes of given dn

Parameters

$dn
string - $dn The DN of the object you want to read

Returns

mixed - array of attributes or -1 on error

Since

1.0
public boolean
# delete( string $dn )

Deletes a given DN from the tree

Deletes a given DN from the tree

Parameters

$dn
string - $dn The DN of the object you want to delete

Returns

boolean - Result of operation

Since

1.0
public boolean
# create( string $dn, array $entries )

Create a new DN

Create a new DN

Parameters

$dn
string - $dn The DN where you want to put the object
$entries
array - $entries An array of arrays describing the object to add

Returns

boolean - Result of operation

Since

1.0
public boolean
# add( string $dn, array $entry )

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

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

Parameters

$dn
string - $dn The DN of the entry to add the attribute
$entry
array - $entry An array of arrays with attributes to add

Returns

boolean - Result of operation

Since

1.0
public boolean
# rename( string $dn, string $newdn, string $newparent, boolean $deleteolddn )

Rename the entry

Rename the entry

Parameters

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

Returns

boolean - Result of operation

Since

1.0
public string
# getErrorMsg( )

Returns the error message

Returns the error message

Returns

string - error message

Since

1.0
public static string
# ipToNetAddress( string $ip )

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

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

Parameters

$ip
string - $ip IP Address (e.g. xxx.xxx.xxx.xxx)

Returns

string - Net address

Since

1.0
public static array
# LDAPNetAddr( string $networkaddress )

Extract readable network address from the LDAP encoded networkAddress attribute.

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

Parameters

$networkaddress
string - $networkaddress The network address

Returns

array

Author

Jay Burrell, Systems & Networks, Mississippi State University

Since

1.0
public static string
# generatePassword( string $password, string $type = 'md5' )

Generates a LDAP compatible password

Generates a LDAP compatible password

Parameters

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

Returns

string - Encrypted password

Since

1.0

Magic methods summary

Properties summary

public string $host
#

Hostname of LDAP server

Hostname of LDAP server

Since

1.0
public boolean $auth_method
#

Authorization Method to use

Authorization Method to use

Since

1.0
public integer $port
#

Port of LDAP server

Port of LDAP server

Since

1.0
public string $base_dn
#

Base DN (e.g. o=MyDir)

Base DN (e.g. o=MyDir)

Since

1.0
public string $users_dn
#

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

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

Since

1.0
public string $search_string
#

Search String

Search String

Since

1.0
public boolean $use_ldapV3
#

Use LDAP Version 3

Use LDAP Version 3

Since

1.0
public boolean $no_referrals
#

No referrals (server transfers)

No referrals (server transfers)

Since

1.0
public boolean $negotiate_tls
#

Negotiate TLS (encrypted communications)

Negotiate TLS (encrypted communications)

Since

1.0
public string $username
#

Username to connect to server

Username to connect to server

Since

1.0
public string $password
#

Password to connect to server

Password to connect to server

Since

1.0
Joomla! Framework TM API documentation generated by ApiGen 2.8.0
Joomla!® and Joomla! Framework™ are trademarks of Open Source Matters, Inc. in the United States and other countries.