code: def ldap_login(self, username, password):
          
          self.connect()
  
          if self.config.get('USER_SEARCH'):
              result = self.bind_search(username, password)
          else:
              result = self.direct_bind(username, password)
          return result
docs: Authenticate a user using ldap. This will return a userdata dict
          if successfull.
          ldap_login will return None if the user does not exist or if the credentials are invalid