Template::Plugin::LDAP is a Perl module that adds in functionality to the Template Toolkit, so that you can easily query an LDAP server and display results. It is based upon the popular Net::LDAP perl module.
It is in a pretty preliminary stage at the moment, though. But it does work. It needs a lot of tidying up and better documentation.
Here is an example of the usage:
[% USE LDAP('ldap.myco.com') %]
[% FOREACH entry = LDAP.search( base = 'dc=myco,dc=com',
filter = '(objectClass=person)',
attrs = [ 'email', 'cn' ] ) %]
Distinguished Name Is [% entry.dn %]
Email: [% entry.cn %]
[% END %]