Catalyst::Model::LDAP::Cached - Cached LDAP model class for Catalyst
# lib/MyApp/Model/People.pm package MyApp::Model::People; use base 'Catalyst::Model::LDAP::Cached'; __PACKAGE__->config( host => 'ldap.ufl.edu', base => 'ou=People,dc=ufl,dc=edu', dn => '', password => '', options => {}, # Net::LDAP method options (e.g. SASL # for bind or sizelimit for search) cache => undef, # Reference to a Cache object (e.g. # Cache::FastMmap) to cache results ); 1; # In your controller my $entries = $c->comp('M::People')->search('(sn=TEST)'); 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.
Search the directory using a given filter, but check the configured cache first for a matching filter. Returns an arrayref containing the matching Net::LDAP::Entry objects (if any).
my $entries = $c->comp('M::People')->search('(sn=TEST)'); print $entries->[0]->get_value('sn');
Get and set cache values, if a Cache object is configured. If only a key is specified, return the cached value, if one exists. If a value is also given, set the value in the cache.
Catalyst
Net::LDAP
Cache
Catalyst::Model::LDAP
Cache the LDAP code value and error message?
Create Helper class
Helper
Daniel Westermann-Clark <danieltwc@cpan.org>
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.