Beispiel #1
0
 def test_ldap_connectivity(self):
     with make_connection(
             'ldap://%s:%d' %
         ('localhost', self._ldap_test_server.config['port']),
             self._ldap_test_server.config['bind_dn'], 'toor') as conn:
         if not conn.bind():
             ok_(False, "Cannot establish connection with LDAP test server")
         else:
             ok_(True)
Beispiel #2
0
 def test_ldap_connectivity(self):
     with make_connection(
             'ldap://%s:%d' % ('localhost', self._ldap_test_server.config['port']),
             self._ldap_test_server.config['bind_dn'],
             'toor'
     ) as conn:
         if not conn.bind():
             ok_(False, "Cannot establish connection with LDAP test server")
         else:
             ok_(True)
Beispiel #3
0
    def user_exist(self, email):
        with make_connection(self.url, self.bind_dn, self.bind_pass) as conn:
            if self.start_tls:
                conn.start_tls()

            if not conn.bind():
                return False

            search = self.search_pattern % email
            conn.search(self.base_dn, search, self.search_scope)

            if len(conn.response) > 0:
                return True

            return False
Beispiel #4
0
    def user_exist(self, email):
        with make_connection(self.url, self.bind_dn, self.bind_pass) as conn:
            if self.start_tls:
                conn.start_tls()

            if not conn.bind():
                return False

            search = self.search_pattern % email
            conn.search(self.base_dn, search, self.search_scope)

            if len(conn.response) > 0:
                return True

            return False