Public Method Details |
addObject |
public boolean addObject( string $dn, array $entry, string &$errmsg )
|
|
Adds new object to the ldap tree
A new object and its attributes are added to the location where $dnpoints to. All attributes which should belong to this object are storedin $entry, which is an associative array and contains subarrays with oneor more values.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name (name and path) of the new object |
|
|
array |
$entry |
|
|
The associative array contains the attributes of this object |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
deleteObject |
public boolean deleteObject( string $dn, string &$errmsg )
|
|
Removes an object from the ldap tree
The dn string of the object which should be deleted is required toremove the object. It is not possible to delete all children by removingthe parent object. Prior to LDAPv3 this fails and an error is returned,but since then behaviour has changed. Now it is possible to delete theparent without the need to remove the children first, but then thesechildren are not deleted and are accessible as before.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name (name and path) of the object |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
modifyObject |
public boolean modifyObject( string $dn, array $entry, string &$errmsg )
|
|
Modifies an object in the ldap tree
Add new attributes to the object where $dn points to. The attributes arestored in $entry, which is an associative array and contains subarrayswith one or more values.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name (name and path) of the object |
|
|
array |
$entry |
|
|
The associative array contains the new attributes for this object |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
renameObject |
public boolean renameObject( string $dn, string $newrdn, string $newparent, boolean $delete, string &$errmsg )
|
|
Renames or moves an object in the ldap tree
If only $newrdn differs from the former name in $dn, then the object isrenamed to $newrdn. Otherwise the object is renamed and moved to thelocation specified by $newparent. If $delete ist set to false, the objectis only copied.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name (name and path) of the object |
|
|
string |
$newrdn |
|
|
New name of the object, e.g. "cn=newname" |
|
|
string |
$newparent |
|
|
Dn of the new parent node |
|
|
boolean |
$delete |
|
|
Flag to indicate if the object should be moved or only be copied |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
searchSubLevel |
public boolean searchSubLevel( string $basedn, string $filter, string $attr, array &$result, string &$errmsg )
|
|
Searches for objects in the subtree below the given node
It compares each object which is located in the subtree below the basenode with the filter string in $filter. The content of the filter must bean ldap compatible expression and if $attr is set, then only theseattributes are returned.
|
Parameter |
|
string |
$basedn |
|
|
Distinguish name of the base node |
|
|
string |
$filter |
|
|
Ldap search filter, e.g. "(&(uid=t*)(sn=test))" |
|
|
string |
$attr |
|
|
Return only these attriutes |
|
|
array |
&$result |
|
|
Array of objects matching the criteria |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
searchOneLevel |
public boolean searchOneLevel( string $basedn, string $filter, string $attr, array &$result, string &$errmsg )
|
|
Searches for objects in the tree only one level below the given node
Unlike searchSubLevel(), this functions searches only for objectswhich are one level below the base node given by $basedn.The content of the filter must be an ldap compatible expression and if$attr is set, then only these attributes are returned.
|
Parameter |
|
string |
$basedn |
|
|
Distinguish name of the base node |
|
|
string |
$filter |
|
|
Ldap search filter, e.g. "(uid=test)" |
|
|
string |
$attr |
|
|
Return only these attriutes |
|
|
array |
&$result |
|
|
Array of objects matching the criteria |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
searchBaseLevel |
public boolean searchBaseLevel( string $basedn, string $filter, string $attr, array &$result, string &$errmsg )
|
|
Compares the criterias with the attributes of the given node
This function checks if the object given by $basedn matches the criteriasin $filter. The content of the filter must be an ldap compatibleexpression and if $attr is set, then only these attributes are returned.
|
Parameter |
|
string |
$basedn |
|
|
Distinguish name of the base node |
|
|
string |
$filter |
|
|
Ldap search filter, e.g. "(|(cn=test)(sn=test))" |
|
|
string |
$attr |
|
|
Return only these attriutes |
|
|
array |
&$result |
|
|
Array of objects matching the criteria |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
addAttributes |
public boolean addAttributes( string $dn, string $entry, string &$errmsg )
|
|
Adds new attributes to an existing object
The attribute arrays in $entry are added to an existing object specifiedby $dn.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name of the object |
|
|
string |
$entry |
|
|
Associative array containing arrays of values |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
deleteAttributes |
public boolean deleteAttributes( string $dn, string $entry, string &$errmsg )
|
|
Deletes attributes in an existing object
The $entry array contains the name of the attributes, which should bedeleted from the object specified by $dn.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name of the object |
|
|
string |
$entry |
|
|
Array containing the names of the attributes |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
replaceAttributes |
public boolean replaceAttributes( string $dn, string $entry, string &$errmsg )
|
|
Replaces attributes in an existing object
The attributes stored in the associative array $entry replace thecorresponding attributes in the object. If only new attribute valuesshould be added, then the old values of the object attribute must be partof the subarray of $entry. Furthermore new attributes are addadautomatically and existing attributes are only replaced if they differfrom the values of the $entry subarrays.
|
Parameter |
|
string |
$dn |
|
|
Distinguish name of the object |
|
|
string |
$entry |
|
|
Associative array containing arrays of new values |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|
dn2ufn |
public boolean dn2ufn( string $dn, string &$result, string &$errmsg )
|
|
Translates a dn to a user friendly name string
Cuts the type and the equal sign of each dn part and returns a commaseperated string of the names, e.g. "cn=test,ou=mynode" is translated to"test,mynode".
|
Parameter |
|
string |
$dn |
|
|
Distinguish name of an object |
|
|
string |
&$result |
|
|
Reference for storing the resulting user friendly name |
|
|
string |
&$errmsg |
|
|
Reference for storing error messages in case of a failure |
|
Returns |
boolean True on success, false otherwise |
|