]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Search for nicknames as well
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Oct 2019 11:09:56 +0000 (11:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 30 Oct 2019 11:09:56 +0000 (11:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py

index 2a88cab0bc507e78c103031725823d68b7de2be5..9e2049fd203c6ebb5c37bb91cf0ee940bed66a2f 100644 (file)
@@ -108,12 +108,12 @@ class Accounts(Object):
        def search(self, query):
                # Search for exact matches
                accounts = self._search(
-                       "(&(objectClass=person)(|(uid=%s)(mail=%s)(sipAuthenticationUser=%s)(telephoneNumber=%s)(homePhone=%s)(mobile=%s)))" \
-                       % (query, query, query, query, query, query))
+                       "(&(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*)))" % (query, query)):
+                       for account in self._search("(&(objectClass=person)(|(cn=*%s*)(uid=*%s*)(displayName=*%s*)))" % (query, query, query)):
                                if not account in accounts:
                                        accounts.append(account)