-
-
05 Sep 2013 11:24:35 UTC
- Distribution: Dancer-Plugin-LDAP
- Module version: 0.0050
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (444 / 0 / 0)
- Kwalitee
Bus factor: 1- 11.87% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.62KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Dancer
- Net::LDAP
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Dancer::Plugin::LDAP::Handle - subclassed Net::LDAP object
SYNOPSIS
METHODS
quick_select
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
.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');
Attributes
In addition, there is a
values
option which determines how values for LDAP attributes are fetched:- first
-
First value of each attribute.
- last
-
Last value of each attribute.
- asref
-
Values as array reference.
quick_insert $dn $ref %opts
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.
quick_compare $type $a $b $pos
quick_update
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'});
quick_delete
Deletes entry given by distinguished name $dn.
ldap->quick_delete('uid=racke@linuxia.de,dc=linuxia,dc=de');
rename
Change distinguished name (DN) of a LDAP record from $old_dn to $new_dn.
base
Returns base DN, optionally prepending relative DN from @rdn.
ldap->base ldap->base('uid=racke@linuxia.de');
rebind
Rebind with credentials from settings.
dn_split $dn %options
dn_join $rdn1 $rdn2 ...
dn_escape
Escapes values in DN $dn and returns the altered string.
dn_unescape
Unescapes values in DN $dn and returns the altered string.
dn_value $dn $pos $attribute
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
DN
Our methods return and expect unescaped DN's.
AUTHOR
Stefan Hornburg (Racke), <racke@linuxia.de>
ACKNOWLEDGEMENTS
See "ACKNOWLEDGEMENTS" in Dancer::Plugin::LDAP
LICENSE AND COPYRIGHT
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.
SEE ALSO
Module Install Instructions
To install Dancer::Plugin::LDAP, copy and paste the appropriate command in to your terminal.
cpanm Dancer::Plugin::LDAP
perl -MCPAN -e shell install Dancer::Plugin::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.