NAME

Net::LDAP::posixAccount - Creates new Net::LDAP::Entry objects for a posixAccount entry.

VERSION

Version 1.0.0

SYNOPSIS

    use Net::LDAP::posixAccount;

    # Initiates the module with a base DN of 'ou=users,dc=foo'.
    my $foo = Net::LDAP::posixAccount->new(baseDN=>'ou=user,dc=foo');

    # create the user vvelox with a gid of 404 and a uid of 404
    my $entry = $foo->create(name=>'vvelox', gid=>'404', uid=>'404');

    # add it using $ldap, a previously created Net::LDAP object
    $entry->update($ldap);

METHODS

new

This initiates the module. It accepts one arguement, a hash. Please See below for accepted values.

    - baseDN :: This is a required value and is the base that the entry will
            be created under.

    - topless :: This is a perl boolean value. If this is set to true, the
            objectClass top is not present.

create

Creates a new Net::LDAP::Entry object.

    - name :: The name of the user.

    - cn :: What the common name should be for a user. This defaults to the username if it is not defined.

    - uid ::This is the UID number of a user. If set to 'AUTO', Sys::User::UIDhelper will be used.

    - gid :: This is GID number of a user. If set to 'AUTO', Sys::Group::GIDhelper will be used.

    - gecos :: This is the GECOS field for a user. If it is not defined, the name is used.

    - loginShell This is the login shell for the user.
        - default :: /sbin/nologin

    - home ::This is the home directory of a user.
        - default :: /home/$name

    - primary :: This is the attribute that will be used for when creating the entry.
            'uid', 'uidNumber', or 'cn' are the accepted value. The default is 'uid'.

    - description :: This is the LDAP description field. If it is not defined, it is set to gecos.

    - minUID :: This is the min UID that will be used if 'uid' is set to 'AUTO'.
        - default :: 1001

    - maxUID This is the max UID that will be used if 'uid' is set to 'AUTO'.
        - default :: 64000

    - minGID :: This is the min GID that will be used if 'gid' is set to 'AUTO'.
        - default :: 1001

    - maxGID ::  This is the max GID that will be used if 'gid' is set to 'AUTO'.
        - default :: 64000

errorBlank

A internal function user for clearing an error.

Error Codes/Flags

Error::Helper is used and all errors are considered fatal.

1/missing_name

'name' not defined.

2/missing_uid

'uid' not defined.

3/missing_gid

'gid' not defined.

4/invalid_value

The primary value is a invalid value.

5/missing_baseDN

Missing baseDN.

6/invalid_baseDN

The specified base DN does does not appear to be a DN.

Checked via the regex below.

    ^(?:(?:[A-Za-z0-9]+=[^,]+),\s*)*(?:[A-Za-z0-9]+=[^,]+)$

AUTHOR

Zane C. Bowers, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-net-ldap-posixaccount at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-LDAP-posixAccount. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Net::LDAP::posixAccount

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008 Zane C. Bowers, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.