From: Michael Tremer Date: Wed, 30 Oct 2019 11:09:56 +0000 (+0000) Subject: people: Search for nicknames as well X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=785fe27cf8c7c514006b483959636493d8547694;p=ipfire.org.git people: Search for nicknames as well Signed-off-by: Michael Tremer --- diff --git a/src/backend/accounts.py b/src/backend/accounts.py index 2a88cab0..9e2049fd 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -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)