OSS-LDAPops
view release on metacpan or search on metacpan
lib/OSS/LDAPops.pm view on Meta::CPAN
Also included is ldapops.pl. This script implements a command-line utility using
OSS::LDAPops.
netgroupcache.pl is also included. This uses OSS::LDAPops to create a local cache of
LDAP-backed netgroups in /etc/netgroup.
=head1 AUTHOR
Simon <simon@hacknix.net>
=head1 ASSUMPTIONS ABOUT THE DIRECTORY
This module and associated sripts make some assumptions about how your directory is
configured. these include:
=over
=item *
Storage of maxuid
=item *
Conventions for use of netgroups
=item *
nis.schema is patched to allow equalityMatch on nisNetgroupTriple objects
=back
=head1 FILES TO HELP WITH SETTING UP A DIRECTORY
In the "examples" directory, there are several files to help you out, including:
=over
=item *
An example skeleton directory.
=item *
A patched version of nis.schema, suitable for use with OpenLDAP
=item *
An example of OpenLDAP's slapd.conf, showing example acls
=item *
changepassword.pl - an example simple CGI script using OSS::LDAPops
=item *
notifypasswordexpiry.pl - a script to send an email to users when their password expires.
=item *
ppolicy.ldif - an example password policy to use with the ppolicy overlay.
=item *
Several other example files, to asisst in setting up *NIX servers to use the directory are also included.
=back
=head1 USING THE DIRECTORY WITH *NIX SERVERS
The reader should consider looking at nss_ldap and pam_ldap, here:
http://www.padl.com/Contents/OpenSourceSoftware.html
=head1 METHODS
This section describes the methods that are implemented and their use.
=head2 new
#Define config hash
$GLOBAL::config =
{
LDAPHOST => 'ldap01.mydomain.net',
BINDDN => 'uid=webportal, ou=writeaccess, dc=auth, dc=lastminute,dc=com',
BASEDN => 'dc=auth,dc=mydomain,dc=net',
NISDOMAIN => 'auth.mydomain.net',
PASSWORD => 'xyzzy',
};
#Instantiate new object and connect to server
my($ldapopsobj) = OSS::LDAPops->new($GLOBAL::config);
if (ref($ldapopsobj) !~ m/OSS::LDAPops/ ) {die("Error instantiating object: $ldapopsobj")};
Instantiates an object and connects to the LDAP server. Returns an object on success and false on error.
=cut
#Define version
$OSS::LDAPops::VERSION = '1.033';
#Please also note, proper error checking MUST be used to ensure
#the integrity of the directory.
#
#Most of the methods in this package return 0 on sucess
#and an error string on fail.
#
#You can therefore test for truth of the return. The string
#describes the error.
#
#Exceptions to this are described in the comments for the methods
#themselves.
#
#The only exceptions to this are the new() method, which returns an object
#or false on error and the salt() method which only ever returns a salt.
#
#********N.B.***********
#
#A change to the file /etc/openldap/nis.schema is required to make
#deleting of single entries from nisNetgroupTriple attributes within nisNetgroups
( run in 2.382 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )