NAME
Dua - DUA/Perl interface to an X.500 directory
SYNOPSIS
use Dua;
DESCRIPTION
This module provides a set of subroutines which allow a Perl script to
access to the X.500 directory.
SUBROUTINES
$dua = new Dua()
Creates a new instance of a Dua object.
$dua->open($dsa, $port, $dn, $passwd)
Open an association to the DSA specified in dsa and
running on the port specified by port. If no port is
specified, then duaperl will use the default port
number. duaperl will bind to the DSA as dn, using the
credentials supplied in passwd. Currently, only simple
authentication is supported.
$dua->error()
This routine returns a description of the problem when an error
occurs.
$dua->settmout($seconds, $microseconds)
This routine sets the asynchronous timeout value for
all operations. The default is 30 seconds.
$dua->close()
This routine closes the association to the X.500 DSA.
$dua->moveto($dn)
Move to the location in the DIT specified by dn.
$dua->modrdn($rdn, $newrdn)
Modify the object whose RDN is rdn to newrdn.
$dua->delete($rdn)
Delete the object specified by rdn from the DIT.
$dua->add($rdn, %attrs)
Add a new object to the DIT with an RDN of rdn with the
attributes attrs.
$dua->modattr($rdn, %attrs)
Modify the object specified by rdn with the attribute-
value pairs in attrs. If a value is set to an empty string
the associated attribute is deleted from the entry.
$dua->show($rdn)
Returns in an associative array the attribute-value
pairs found in the object specified by rdn.
$dua->attribute($rdn,$attribute)
Returns an array of values for the specified attribute
found in the object specified by rdn.
This method maybe used to retrieve binary attributes not
accessible via the show method.
$dua->find($rdn, $filter, $scope, $all)
Returns in an associative array the attribute-value pairs found
beneath the object specified by rdn. filter is a string
representation of a filter to apply to the search. A
Backus-Naur Form definition is given below. scope refers to how
deep the search is to progress in the DIT. A value of 0
specifies the immediate children of the object; a value of 1
specifies the entire sub- tree beneath the object. all refers
to what will be returned in the associative array. A value of 0
will return just the DN's of matching objects, keyed by their
ordinality in the search response; a value of 1 specifies that
the attribute-value pairs of all match- ing objects are to be
returned. This routine is used for non-leaf objects.
NOTES
$dua->moveto() determines the path which is prepended to the rdn of all
other functions. This simulates ``standing'' at a particular position
in the DIT, and being able to specify DN's relative to the current
position. If a fully-qualified DN is more appropriate for a
particular call, begin the rdn string with an `@' character.
The Backus-Naur Form (BNF) for the filter specified in dua_find()
is as follows:
<filter> ::= '(' <filtercomp> ')'
<filtercomp> ::= <and> | <or> | <not> | <simple>
<and> ::= '&' <filterlist>
<or> ::= '|' <filterlist>
<not> ::= '!' <filter>
<filterlist> ::= <filter> | <filter> <filterlist>
<simple> ::= <attributetype> <filtertype> <attributevalue>
<filtertype> ::= '=' | '~=' | '<=' | '>='
RETURN VALUES
All routines except $dua->show() and $dua->find() will return 1 on
success, 0 otherwise. For those routines which return associative
arrays ( $dua->show() and $dua->find() ), the array is returned
empty if an error occurs. The description of the problem may be
obtained by use of $dua->error().
AUTHOR
Converted from duaperl Version 1.0a3 to a Perl 5 module by
Stephen Pillinger, School of Computer Science,
The University of Birmingham, UK.
duaperl was written by Eric W. Douglas, California State University,
Fresno.
SEE ALSO
perl(1), ldap(3).