Net_LDAP2 |
![]() |
[ class tree: Net_LDAP2 ] [ index: Net_LDAP2 ] [ all elements ] |
![]() |
Packages: Net_LDAP2 Classes:
Net_LDAP2
Files:Net_LDAP2_Entry Net_LDAP2_Error Net_LDAP2_Filter Net_LDAP2_LDIF Net_LDAP2_RootDSE Net_LDAP2_Schema Net_LDAP2_Search Net_LDAP2_Util
add_entry.php
connecting.php Entry.php fetch_entry.php Filter.php LDAP2.php LDIF.php modify_entry.php modify_entry2.php RootDSE.php Schema.php SchemaCache.interface.php schema_cache.php Search.php search_entries.php SimpleFileSchemaCache.php Util.php |
[ Top ] $_down_host_list = array()[line 117] List of hosts that are known to be down.
[ Top ] $_host_list = array()[line 109] List of hosts we try to establish a connection to
[ Top ] $_link = false[line 125] LDAP resource link.
[ Top ] $_rootDSE_cache = array()[line 167] Cache for rootDSE objectsHash with requested rootDSE attr names as key and rootDSE object as value Since the RootDSE object itself may request a rootDSE object, rootDse() caches successful requests. Internally, Net_LDAP2 needs several lookups to this object, so caching increases performance significally.
[ Top ] $_schema = null[line 135] Net_LDAP2_Schema objectThis gets set and returned by schema()
[ Top ] $_schemaAttrs = array()[line 152] Cache for attribute encoding checks
[ Top ] $_schema_cache = null[line 143] Schema cacher function callback
[ Top ] Method Detail__construct (Constructor) [line 230]
Net_LDAP2 constructor Sets the config array Please note that the usual way of getting Net_LDAP2 to work is to call something like:
Parameters:
[ Top ]
_Net_LDAP2 (Destructor) [line 699]add [line 715]
Add a new entryobject to a directory. Use add to add a new Net_LDAP2_Entry object to the directory. This also links the entry to the connection used for the add, if it was a fresh entry (Net_LDAP2_Entry::createFresh())
Parameters:
[ Top ]
bind [line 315]
Bind or rebind to the ldap-server This function binds with the given dn and password to the server. In case no connection has been made yet, it will be started and startTLS issued if appropiate. The internal bind configuration is not being updated, so if you call bind() without parameters, you can rebind with the credentials provided at first connecting to the server.
Parameters:
[ Top ]
checkLDAPExtension [line 1630]
Checks if phps ldap-extension is loaded If it is not loaded, it tries to load it manually using PHPs dl(). It knows both windows-dll and *nix-so.
[ Top ]
connect [line 195]
Configure Net_LDAP2, connect and bind Use this method as starting point of using Net_LDAP2 to establish a connection to your LDAP server. Static function that returns either an error object or the new Net_LDAP2 object. Something like a factory. Takes a config array with the needed parameters.
Parameters:
[ Top ]
copy [line 1382]
Copy an entry to a new location The entry will be immediately copied. Please note that only attributes you have selected will be copied.
Parameters:
[ Top ]
delete [line 782]
Delete an entry from the directory The object may either be a string representing the dn or a Net_LDAP2_Entry object. When the boolean paramter recursive is set, all subentries of the entry will be deleted as well.
Parameters:
[ Top ]
disconnect [line 689]dnExists [line 1247]
Tells if a DN does exist in the directory
Parameters:
[ Top ]
done [line 678]
Close LDAP connection. Closes the connection. Use this when the session is over.
[ Top ]
errorMessage [line 1411]
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/LDAP2/LDAPErrorCodes.html
Parameters:
[ Top ]
getEntry [line 1286]
Get a specific entry based on the DN
Parameters:
[ Top ]
getLDAPVersion [line 1186]
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 ]
getLink [line 1749]
Get the LDAP link resource. It will loop attempting to re-establish the connection if the connection attempt fails and auto_reconnect has been turned on (see the _config array documentation).
[ Top ]
getOption [line 1154]
Get an LDAP option value
Parameters:
[ Top ]
getVersion [line 175]
Returns the Net_LDAP2 Release version, may be called statically
[ Top ]
modify [line 887]
Modify an ldapentry directly on the server This one takes the DN or a Net_LDAP2_Entry object and an array of actions. This array should be something like this: array('add' => array('attribute1' => array('val1', 'val2'), 'attribute2' => array('val1')), 'delete' => array('attribute1'), 'replace' => array('attribute1' => array('val1')), 'changes' => array('add' => ..., 'replace' => ..., 'delete' => array('attribute1', 'attribute2' => array('val1'))) The changes array is there so the order of operations can be influenced (the operations are done in order of appearance). The order of execution is as following:
The function calls the corresponding functions of an Net_LDAP2_Entry object. A detailed description of array structures can be found there. Unlike the modification methods provided by the Net_LDAP2_Entry object, this method will instantly carry out an update() after each operation, thus modifying "directly" on the server.
Parameters:
[ Top ]
move [line 1325]
Rename or move an entry This method will instantly carry out an update() after the move, so the entry is moved instantly. You can pass an optional Net_LDAP2 object. In this case, a cross directory move will be performed which deletes the entry in the source (THIS) directory and adds it in the directory $target_ldap. A cross directory move will switch the Entrys internal LDAP reference so updates to the entry will go to the new directory. Note that if you want to do a cross directory move, you need to pass an Net_LDAP2_Entry object, otherwise the attributes will be empty.
Parameters:
[ Top ]
performConnect [line 377]
Connect to the ldap-server This function connects to the LDAP server specified in the configuration, binds and set up the LDAP protocol as needed.
[ Top ]
performReconnect [line 557]
Reconnect to the ldap-server. In case the connection to the LDAP service has dropped out for some reason, this function will reconnect, and re-bind if a bind has been attempted in the past. It is probably most useful when the server list provided to the new() or connect() function is an array rather than a single host name, because in that case it will be able to connect to a failover or secondary server in case the primary server goes down. This doesn't return anything, it just tries to re-establish the current connection. It will sleep for the current backoff period (seconds) before attempting the connect, and if the connection fails it will double the backoff period, but not try again. If you want to ensure a reconnection during a transient period of server downtime then you need to call this function in a loop.
[ Top ]
registerSchemaCache [line 1609]
Enable/disable persistent schema caching Sometimes it might be useful to allow your scripts to cache the schema information on disk, so the schema is not fetched every time the script runs which could make your scripts run faster. This method allows you to register a custom object that implements your schema cache. Please see the SchemaCache interface (SchemaCache.interface.php) for informations on how to implement this. To unregister the cache, pass null as $cache parameter. For ease of use, Net_LDAP2 provides a simple file based cache which is used in the example below. You may use this, for example, to store the schema in a linux tmpfs which results in the schema beeing cached inside the RAM which allows nearly instant access.
Parameters:
[ Top ]
rootDse [line 1494]
Gets a rootDSE object This either fetches a fresh rootDSE object or returns it from the internal cache for performance reasons, if possible.
Parameters:
[ Top ]
root_dse [line 1523]
Alias function of rootDse() for perl-ldap interface
[ Top ]
schema [line 1537]
Get a schema object
Parameters:
[ Top ]
search [line 1025]
Run a ldap search query Search is used to query the ldap-database. $base and $filter may be ommitted. The one from config will then be used. $base is either a DN-string or an Net_LDAP2_Entry object in which case its DN willb e 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 = unlimited), timelimit: Limit the time spent for searching (default: 0 = unlimited), attrsonly: If true, the search will only return the attribute names, attributes: Array of attribute names, which the entry should contain. It is good practice to limit this to just the ones you need. [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 Please note, that you cannot override server side limitations to sizelimit and timelimit: You can always only lower a given limit.
Parameters:
[ Top ]
setConfig [line 244]
Sets the internal configuration array
Parameters:
[ Top ]
setLDAPVersion [line 1205]
Set the LDAP_PROTOCOL_VERSION that is used on the connection.
Parameters:
[ Top ]
setOption [line 1122]
Set an LDAP option
Parameters:
[ Top ]
startTLS [line 613]
Starts an encrypted session
[ Top ]
start_tls [line 665]
alias function of startTLS() for perl-ldap interface
[ Top ]
utf8 [line 1687]
Encodes or decodes UTF-8/ISO-8859-1 attribute values if needed by schema
Parameters:
[ Top ]
utf8Decode [line 1673]
Decodes the given attribute values from UTF-8 to ISO-8859-1 if needed by schema $attributes is expected to be an array with keys describing the attribute names and the values as the value of this attribute:
Parameters:
[ Top ]
utf8Encode [line 1655]
Encodes given attributes from ISO-8859-1 to UTF-8 if needed by schema 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. $attributes is expected to be an array with keys describing the attribute names and the values as the value of this attribute:
Parameters:
[ Top ]
Documentation generated on Mon, 11 Mar 2019 16:03:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004. |