| Catalyst-Model-LDAP documentation | Contained in the Catalyst-Model-LDAP distribution. |
Catalyst::Helper::Model::LDAP - Helper for LDAP models
script/myapp_create.pl model Person LDAP ldap.ufl.edu ou=People,dc=ufl,dc=edu dn=admin,dc=ufl,dc=edu mypass 1
Helper for the Catalyst LDAP model.
When creating a new LDAP model class using this helper, you can specify much of the configuration and have it filled automatically. Using the example from the SYNOPSIS section:
PersonThe name of the model. This is also used to determine the filename,
e.g. lib/MyApp/Model/Person.pm.
LDAPThe helper to use, i.e. this one.
ldap.ufl.eduThe LDAP server's fully qualified domain name (FQDN). Can also be an
IP address, e.g. 127.0.0.1.
ou=People,dc=ufl,dc=eduThe base distinguished name (DN) for searching the directory.
dn=admin,dc=ufl,dc=eduThe bind DN for connecting to the directory. This can be anyone that has permission to search under the base DN, as per your LDAP server's access control lists.
mypassThe password for the specified bind DN.
1Optionally uses TLS when binding to the LDAP server, for secure connections.
Makes the LDAP model class.
Makes tests for the LDAP model.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Catalyst-Model-LDAP documentation | Contained in the Catalyst-Model-LDAP distribution. |
package Catalyst::Helper::Model::LDAP; use strict; use warnings;
sub mk_compclass { my ($self, $helper, $host, $base, $dn, $password, $start_tls) = @_; $helper->{host} = $host || ''; $helper->{base} = $base || ''; $helper->{dn} = $dn || ''; $helper->{password} = $password || ''; $helper->{start_tls} = $start_tls ? 1 : 0; $helper->render_file('modelclass', $helper->{file}); return 1; }
sub mk_comptest { my ($self, $helper) = @_; $helper->render_file('modeltest', $helper->{test}); }
1; __DATA__
1; __modeltest__ use strict; use warnings; use Test::More tests => 2; use_ok('Catalyst::Test', '[% app %]'); use_ok('[% class %]');