Net::LDAP::Class::User::POSIX - user class for POSIX LDAP schema
# subclass this class for your local LDAP package MyLDAPUser; use base qw( Net::LDAP::Class::User::POSIX ); __PACKAGE__->metadata->setup( base_dn => 'dc=mycompany,dc=com', attributes => __PACKAGE__->POSIX_attributes, unique_attributes => __PACKAGE__->POSIX_unique_attributes, ); 1; # then use your class my $ldap = get_and_bind_LDAP_object(); # you write this use MyLDAPUser; my $user = MyLDAPUser->new( ldap => $ldap, uid => 'foobar' ); $user->read_or_create; for my $group ($user->group, @{ $user->groups }) { printf("user %s in group %s\n", $user, $group); }
Net::LDAP::Class::User::POSIX isa Net::LDAP::Class::User implementing the POSIX LDAP schema.
Returns array ref of default POSIX attributes.
Returns array ref of unique POSIX attributes: uid and uidNumber.
All the init_* methods can be specified to the new() constructor without the init_ prefix.
Returns /bin/bash.
Returns /home.
Returns an empty string.
Returns hash ref suitable for creating a Net::LDAP::Batch::Action::Add.
May be called as a class method with explicit uid and uidNumber key/value pairs.
Utility method for generating default values for various attributes. Called by both action_for_create() and action_for_update().
Returns array of values in this order:
$groupname, $gid, $givenName, $sn, $gecos, $email, $passwordHash
Returns array ref suitable for creating a Net::LDAP::Batch::Action::Update.
Returns hash ref suitable for creating a Net::LDAP::Batch::Action::Delete.
Required MethodMaker method for retrieving primary group from LDAP.
Returns an object of type group_class().
Required MethodMaker method for retrieving secondary groups from LDAP.
Returns array or array ref (based on context) of objects of type group_class().
Returns a Net::LDAP::Class::Iterator object for same data as fetch_groups().
See the advice in Net::LDAP::Class::Iterator about iterators versus arrays.
Alias for gidNumber() attribute.
Convenience wrapper around userPassword() attribute method.
This method will SHA-1-hashify plain_password using ssha_hash() and set the hash in the ldap_entry(). If no argument is supplied, returns the hash string set in ldap_entry() (if any).
Returns a SHA-1-hashed password from a random string of length len. Default length is 8 characters. This method is just a simple wrapper around ssha_hash() and random_string().
Returns seeded hash of string using SHA-1. See http://www.openldap.org/faq/data/cache/347.html
NOTE: The hash will contain the LDAP-required {SSHA} prefix. If the prefix is already present, will return string untouched.
{SSHA}
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-net-ldap-class at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-LDAP-Class. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-ldap-class at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::LDAP::Class
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-LDAP-Class
CPAN Ratings
http://cpanratings.perl.org/d/Net-LDAP-Class
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-LDAP-Class
Search CPAN
http://search.cpan.org/dist/Net-LDAP-Class
The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.
http://www.msi.umn.edu/
Copyright 2008 by the Regents of the University of Minnesota. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::LDAP
To install Net::LDAP::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::LDAP::Class
CPAN shell
perl -MCPAN -e shell install Net::LDAP::Class
For more information on module installation, please visit the detailed CPAN module installation guide.