Net_LDAP
[ class tree: Net_LDAP ] [ index: Net_LDAP ] [ all elements ]

Class: Net_LDAP

Source Location: /Net_LDAP-0.6.6/LDAP.php

Class Overview

PEAR
   |
   --Net_LDAP

Net_LDAP - manipulate LDAP servers the right way!


Author(s):

  • Jan Wagner
  • Tarjei Huse

Version:

  • $Revision: 1.19.2.10 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 48]
Net_LDAP - manipulate LDAP servers the right way!
  • Author: Jan Wagner
  • Author: Tarjei Huse
  • Version: $Revision: 1.19.2.10 $


[ Top ]


Method Detail

Net_LDAP (Constructor)   [line 120]

void Net_LDAP( [array $_config = array()])

Net_LDAP constructor

Sets the config array

  • See: $_config
  • Access: protected

Parameters:

array   $_config   —  Configuration array

[ Top ]

add   [line 297]

mixed add( object Net_LDAP_Entry $entry)

Add a new entryobject to a directory.

Use add to add a new Net_LDAP_Entry object to the directory.

  • Return: Net_LDAP_Error or true

Parameters:

object Net_LDAP_Entry   $entry   — 

[ Top ]

bind   [line 164]

mixed bind( [array $config = array()])

Bind to the ldap-server

The function may be used if you do not create the object using Net_LDAP::connect.

  • Return: Net_LDAP_Error or true
  • See: $_config
  • Access: public

Parameters:

array   $config   —  Configuration array

[ Top ]

connect   [line 140]

mixed &connect( [array $config = array()])

Creates the initial ldap-object

Static function that returns either an error object or the new Net_LDAP object. Something like a factory. Takes a config array with the needed parameters.

  • Return: object Net_LDAP_Error or Net_LDAP
  • See: $_config
  • Access: public

Parameters:

array   $config   —  Configuration array

[ Top ]

delete   [line 319]

mixed delete( mixed $dn, [array $param = array()])

Delete an entry from the directory

The object may either be a string representing the dn or a Net_LDAP_Entry object. The param array may contain a boolean value named recursive. When set, all subentries of the Entry will be deleted as well

  • Return: Net_LDAP_Error or true
  • Access: public

Parameters:

mixed   $dn   —  string or Net_LDAP_Entry
array   $param   — 

[ Top ]

dnExists   [line 729]

boolean dnExists( string $dn)

Tell if a dn already exists

Parameters:

string   $dn   — 

[ Top ]

done   [line 274]

void done( )

Close LDAP connection.

Closes the connection. Use this when the session is over.


[ Top ]

errorMessage   [line 782]

string errorMessage( int $errorcode)

Returns the string for an ldap errorcode.

Made to be able to make better errorhandling Function based on DB::errorMessage() Tip: The best description of the errorcodes is found here: http://www.directory-info.com/LDAP/LDAPErrorCodes.html

  • Return: The errorstring for the error.

Parameters:

int   $errorcode   —  Error code

[ Top ]

getEntry   [line 758]

object Net_LDAP_Entry &getEntry( string $dn, [array $attr = array('')])

Get a specific entry based on the dn
  • Return: or Net_LDAP_Error

Parameters:

string   $dn   —  dn
array   $attr   —  Array of Attributes to select

[ Top ]

getLDAPVersion   [line 687]

int getLDAPVersion( )

Get the LDAP_PROTOCOL_VERSION that is used on the connection.

A lot of ldap functionality is defined by what protocol version the ldap server speaks. This might be 2 or 3.


[ Top ]

getOption   [line 655]

mixed getOption( string $option)

Get an LDAP option value
  • Return: Net_LDAP_Error or option value
  • Access: public

Parameters:

string   $option   —  Option to get

[ Top ]

getVersion   [line 718]

string getVersion( )

Get the Net_LDAP version.

Return the Net_LDAP version

  • Return: Net_LDAP version

[ Top ]

isError   [line 859]

boolean isError( mixed $value)

Tell whether value is a Net_LDAP_Error or not
  • Access: public

Parameters:

mixed   $value   — 

[ Top ]

modify   [line 418]

mixed modify( string $dn, [array $params = array()])

Modify an ldapentry

This is taken from the perlpod of net::ldap, and explains things quite nicely. modify ( DN, OPTIONS ) Modify the contents of DN on the server. DN May be a string or a Net::LDAP::Entry object.

dn This option is here for compatibility only, and may be removed in future. Previous releases did not take the DN argument which replaces this option.

add The add option should be a reference to a HASH. The values of the HASH are the attributes to add, and the values may be a string or a reference to a list of values.

delete A reference to an ARRAY of attributes to delete. TODO: This does not support deleting one or two values yet - use replace.

changes This is an alternative to add, delete and replace where the whole operation can be given in a single argument. The argument should be a array

Values in the ARRAY are used in pairs, the first is the operation add, delete or replace and the second is a reference to an ARRAY of attribute values.

The attribute value list is also used in pairs. The first value in each pair is the attribute name and the second is a reference to a list of values.

Example: $ldap->modify ( $dn, array (changes => array( 'delete' => array('faxNumber' => ''), 'add' => array('sn' => 'Barr'), 'replace' => array(email => 'tarjei@nu.no'))));

  • Return: Net_LDAP_Error or true
  • Access: public

Parameters:

string   $dn   — 
array   $params   — 

[ Top ]

reBind   [line 227]

mixed reBind( [string $dn = null], [ $password = null])

ReBind to the ldap-server using another dn and password

The function may be used if you do not create the object using Net_LDAP::connect.

  • Return: Net_LDAP_Error or true
  • See: $_config
  • Access: public

Parameters:

string   $dn   —  - the DN to bind as. string $password - the bassword to use.
   $password   — 

[ Top ]

rootDse   [line 872]

object mixed &rootDse( [array $attrs = null])

gets a root dse object
  • Return: Net_LDAP_Error or Net_LDAP_RootDSE
  • Author: Jan Wagner <wagner@netsols.de>
  • Access: public

Parameters:

array   $attrs   —  Array of attributes to search for

[ Top ]

root_dse   [line 902]

void &root_dse( )

alias function of rootDse() for perl-ldap interface

[ Top ]

schema   [line 916]

object mixed &schema( [string $dn = null])

get a schema object
  • Return: Net_LDAP_Schema or Net_LDAP_Error
  • Author: Jan Wagner <wagner@netsols.de>
  • Access: public

Parameters:

string   $dn   —  Subschema entry dn

[ Top ]

search   [line 550]

object mixed search( [string $base = null], [string $filter = null], [array $params = array()])

Run a ldap query

Search is used to query the ldap-database. $base and $filter may be ommitted. BaseDN and default filter will then be used. Params may contain:

scope: The scope which will be used for searching base - Just one entry sub - The whole tree one - Immediately below $base sizelimit: Limit the number of entries returned (default: 0), timelimit: Limit the time spent for searching (default: 0), attrsonly: If true, the search will only return the attribute names, NO values attributes: Array of attribute names, which the entry should contain. It is good practice to limit this to just the ones you need, so by default this function does not return any attributes at all. [NOT IMPLEMENTED] deref: By default aliases are dereferenced to locate the base object for the search, but not when searching subordinates of the base object. This may be changed by specifying one of the following values:

never - Do not dereference aliases in searching or in locating the base object of the search. search - Dereference aliases in subordinates of the base object in searching, but not in locating the base object of the search. find always

  • Return: Net_LDAP_Search or Net_LDAP_Error
  • Access: public

Parameters:

string   $base   —  LDAP searchbase
string   $filter   —  LDAP search filter
array   $params   —  Array of options

[ Top ]

setLDAPVersion   [line 703]

mixed setLDAPVersion( [int $version = 0])

Set the LDAP_PROTOCOL_VERSION that is used on the connection.
  • Return: Net_LDAP_Error or TRUE

Parameters:

int   $version   —  Version to set

[ Top ]

setOption   [line 624]

mixed setOption( string $option, mixed $value)

Set an LDAP option
  • Return: Net_LDAP_Error or true
  • Access: public

Parameters:

string   $option   —  Option to set
mixed   $value   —  Value to set Option to

[ Top ]

startTLS   [line 248]

mixed startTLS( )

Starts an encrypted session
  • Return: True or Net_LDAP_Error
  • Access: public

[ Top ]

start_tls   [line 261]

void start_tls( )

alias function of startTLS() for perl-ldap interface

[ Top ]

utf8Decode   [line 976]

array utf8Decode( array $attributes)

Decodes the given attribute values
  • Return: Array with decoded attribute values
  • Access: public

Parameters:

array   $attributes   —  Array of attributes

[ Top ]

utf8Encode   [line 964]

array utf8Encode( array $attributes)

Encodes given attributes to UTF8 if needed

This function takes attributes in an array and then checks against the schema if they need UTF8 encoding. If that is so, they will be encoded. An encoded array will be returned and can be used for adding or modifying.

  • Return: Array of UTF8 encoded attributes
  • Access: public

Parameters:

array   $attributes   —  Array of attributes

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:26:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.