NAME Catalyst::Model::LDAP - LDAP model class for Catalyst SYNOPSIS # Use the Catalyst helper script/myapp_create.pl model People LDAP ldap.ufl.edu ou=People,dc=ufl,dc=edu # lib/MyApp/Model/People.pm package MyApp::Model::People; use base 'Catalyst::Model::LDAP'; __PACKAGE__->config( host => 'ldap.ufl.edu', base => 'ou=People,dc=ufl,dc=edu', options => {}, dn => '', password => '', bind_options => {}, # Options to pass to Net::LDAP::bind # (e.g. if you need SASL) cache => undef, # Reference to a Cache object # (e.g. Cache::FastMmap) ); 1; # As object method $c->comp('MyApp::Model::People')->search('(sn=Test)'); # As class method MyApp::Model::People->search('(sn=Test)'); DESCRIPTION This is the Net::LDAP model class for Catalyst. It is nothing more than a simple wrapper for Net::LDAP. If a Cache object is specified in the configuration, it is used to store responses from the LDAP server. On subsequent searches using the same filter, the cached response is used. METHODS new Create a new Catalyst LDAP model component. search Search the directory using a given filter. See Net::LDAP for format of arguments. If successful, returns the entries from the server. Otherwise, dies with the error message from Net::LDAP. If you specified a Cache object in the "config" block, it is checked for a value with the given filter as its key before contacting the LDAP server. _client Return a reference to an LDAP client bound using the current configuration. _cache 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. SEE ALSO Catalyst, Net::LDAP, Cache AUTHOR Daniel Westermann-Clark Based on work started by on the Catalyst mailing list: LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.