def authenticate(self, username=None, password=None, request=None):
     """
     Return user if validated by LDAP.
     Return None otherwise.
     """
     if not ldap_validate(username, password):
         logger.debug("LDAP Authentication failed - "+username)
         return None
     ldap_attrs = ldap_lookupUser(username)
     attributes = ldap_formatAttrs(ldap_attrs)
     return get_or_create_user(username, attributes)
 def authenticate(self, username=None, password=None, request=None):
     """
     Return user if validated by LDAP.
     Return None otherwise.
     """
     # logger.debug("LDAPBackend-- U:%s P:%s R:%s"
     #              % (username, password, request))
     if not ldap_validate(username, password):
         logger.debug("LDAP Authentication failed - "+username)
         return None
     ldap_attrs = ldap_lookupUser(username)
     attributes = ldap_formatAttrs(ldap_attrs)
     logger.debug("[LDAP] Authentication Success - " + username)
     return get_or_create_user(username, attributes)
 def authenticate(self, username=None, password=None, request=None):
     """
     Return user if validated by LDAP.
     Return None otherwise.
     """
     # logger.debug("LDAPBackend-- U:%s P:%s R:%s"
     #              % (username, password, request))
     if not ldap_validate(username, password):
         logger.debug("LDAP Authentication failed - " + username)
         return None
     ldap_attrs = ldap_lookupUser(username)
     attributes = ldap_formatAttrs(ldap_attrs)
     logger.debug("[LDAP] Authentication Success - " + username)
     return get_or_create_user(username, attributes)