Catalyst::Model::LDAP - LDAP model class for Catalyst
# Use the Catalyst helper script/myapp_create.pl model Person LDAP ldap.ufl.edu ou=People,dc=ufl,dc=edu # lib/MyApp/Model/Person.pm package MyApp::Model::Person; use base 'Catalyst::Model::LDAP'; __PACKAGE__->config( host => 'ldap.ufl.edu', base => 'ou=People,dc=ufl,dc=edu', dn => '', password => '', start_tls => 1, start_tls_options => { verify => 'require' }, options => {}, # Options passed to all Net::LDAP methods # (e.g. SASL for bind or sizelimit for # search) ); 1; # In your controller my $mesg = $c->model('Person')->search('(cn=Lou Rhodes)'); my @entries = $mesg->entries; print $entries[0]->get_value('sn');
This is the Net::LDAP model class for Catalyst. It is nothing more than a simple wrapper for Net::LDAP.
This class simplifies LDAP access by letting you configure a common set of bind arguments and options. It also lets you configure a base DN for searching.
Net::LDAP methods are supported via Perl's AUTOLOAD mechanism. Please refer to the Net::LDAP documentation for information on what's available.
AUTOLOAD
Create a new Catalyst LDAP model component.
Bind the client using the current configuration and return it. This method is automatically called when you use a Net::LDAP method.
If the start_tls configuration option is present, the client will use the Net::LDAP start_tls method to make your connection secure.
start_tls
Execute the specified LDAP command. Call the appropriate Net::LDAP methods directly instead of this method. For example:
# In your controller my $mesg = $c->model('Person')->search('(cn=Andy Barlow)');
Catalyst::Helper::Model::LDAP
Catalyst
Net::LDAP
Daniel Westermann-Clark <danieltwc@cpan.org>
Adam Jacob <holoway@cpan.org> (TLS support)
Salih Gonullu, for initial work on Catalyst mailing list
Christopher H. Laco, for AUTOLOAD idea
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Model::LDAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::LDAP
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.