':param srv: The server instance
:param ldapsrv: Which LDAP server to us
:param return_to: Where to send the user after authentication
:return:'

def __init__(self, srv, ldapsrv, return_to, dn_pattern, mako_template, template_lookup):

    UsernamePasswordMako.__init__(self, srv, mako_template, template_lookup, None, return_to)
    self.ldap = ldap.initialize(ldapsrv)
    self.ldap.protocol_version = 3
    self.ldap.set_option(ldap.OPT_REFERRALS, 0)
    self.dn_pattern = dn_pattern
