NAME

Catalyst::Model::LDAP - LDAP model class for Catalyst

SYNOPSIS

# 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     => '',
    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('(sn=TEST)');
my @entries = $mesg->entries;
print $entries[0]->get_value('sn');

DESCRIPTION

This is the Net::LDAP model class for Catalyst. It is nothing more than a simple wrapper for Net::LDAP.

This class simplifies LDAP searches by letting you configure a base DN. Other Net::LDAP methods are supported via Perl's AUTOLOAD mechanism.

METHODS

new

Create a new Catalyst LDAP model component.

_client

Bind the client using the current configuration and return it.

_execute

Execute the specified LDAP command.

SEE ALSO

AUTHOR

Daniel Westermann-Clark <danieltwc@cpan.org>

Based on work started by <salih@ip-plus.net> on the Catalyst mailing list:

http://lists.rawmode.org/pipermail/catalyst/2005-June/000712.html

ACKNOWLEDGEMENTS

  • Christopher H. Laco, for AUTOLOAD idea

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.