]> git.ipfire.org Git - ipfire.org.git/commitdiff
accounts: Drop exact search
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Nov 2019 11:25:44 +0000 (11:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Nov 2019 11:25:44 +0000 (11:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py

index 5251ef331589baa0ea3a5b1e02be42aedf4c3ff7..c5982cacffe1b5c25b10e0f1073a95eae2992df6 100644 (file)
@@ -107,16 +107,8 @@ class Accounts(Object):
                return self._search("(&(objectClass=person)(createTimestamp>=%s))" % t)
 
        def search(self, query):
-               # Search for exact matches
-               accounts = self._search(
-                       "(&(objectClass=person)(|(uid=%s)(mail=%s)(displayName=%s)(sipAuthenticationUser=%s)(telephoneNumber=%s)(homePhone=%s)(mobile=%s)))" \
-                       % (query, query, query, query, query, query, query))
-
-               # Find accounts by name
-               if not accounts:
-                       for account in self._search("(&(objectClass=person)(|(cn=*%s*)(uid=*%s*)(displayName=*%s*)))" % (query, query, query)):
-                               if not account in accounts:
-                                       accounts.append(account)
+               accounts = self._search("(&(objectClass=person)(|(cn=*%s*)(uid=*%s*)(displayName=*%s*)(mail=*%s*)))" \
+                       % (query, query, query, query))
 
                return sorted(accounts)