Dancer::Plugin::LDAP::Handle - subclassed Net::LDAP object
quick_select performs a search in the LDAP directory.
The simplest form is to just specify the filter:
ldap->quick_select({objectClass => 'inetOrgPerson'});
This retrieves all records of the object class inetOrgPerson.
inetOrgPerson
A specific record can be fetched by using the distinguished name (DN) as only key in the hash reference:
ldap->quick_select({dn => 'uid=racke@linuxia.de,dc=linuxia,dc=de'});
The base of your search can be passed as first argument, otherwise the base defined in your settings will be used.
ldap->quick_select('dc=linuxia,dc=de', {objectClass => 'inetOrgPerson'});
You may add any options supported by the Net::LDAP search method, e.g.:
ldap->quick_select('dc=linuxia,dc=de', {objectClass => 'inetOrgPerson'}, scope => 'one');
In addition, there is a values option which determines how values for LDAP attributes are fetched:
values
First value of each attribute.
Last value of each attribute.
Values as array reference.
Adds an entry to LDAP directory.
ldap->quick_insert('uid=racke@linuxia.de,ou=people,dc=linuxia,dc=de', {cn => 'racke@linuxia.de', uid => 'racke@linuxia.de', givenName = 'Stefan', sn => 'Hornburg', c => 'Germany', l => 'Wedemark', objectClass => [qw/top person organizationalPerson inetOrgPerson/], }
The fields which hold empty strings or undefined values will not be inserted, but just ignored.
Modifies LDAP entry with distinguished name $dn by replacing the values from $replace. If the value is the empty string, delete the attribute.
Returns DN in case of success.
ldap->quick_update('uid=racke@linuxia.de,dc=linuxia,dc=de', {l => 'Vienna'});
Deletes entry given by distinguished name $dn.
ldap->quick_delete('uid=racke@linuxia.de,dc=linuxia,dc=de');
Change distinguished name (DN) of a LDAP record from $old_dn to $new_dn.
Returns base DN, optionally prepending relative DN from @rdn.
ldap->base ldap->base('uid=racke@linuxia.de');
Rebind with credentials from settings.
Escapes values in DN $dn and returns the altered string.
Unescapes values in DN $dn and returns the altered string.
Returns DN attribute value from $dn at position $pos, matching attribute name $attribute.
$pos and $attribute are optional.
Returns undef in the following cases:
* invalid DN * $pos exceeds number of entries in the DN * attribute name doesn't match $attribute
Examples:
ldap->dn_value('ou=Testing,dc=linuxia,dc=de'); Testing ldap->dn_value('ou=Testing,dc=linuxia,dc=de', 1); linuxia
Our methods return and expect unescaped DN's.
Stefan Hornburg (Racke), <racke@linuxia.de>
See "ACKNOWLEDGEMENTS" in Dancer::Plugin::LDAP
Copyright 2010-2013 Stefan Hornburg (Racke) <racke@linuxia.de>.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Dancer::Plugin::LDAP
Dancer
Net::LDAP
To install Dancer::Plugin::LDAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::LDAP
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.