Finish the email autosuggest.

For now I've added a new API call.  The field-specific searching is
a ways off.
This commit is contained in:
Kevin McCarthy
2007-10-18 14:33:55 -07:00
parent f018c2123c
commit 5e651a6496
5 changed files with 49 additions and 28 deletions

View File

@@ -377,7 +377,16 @@ class IPAServer:
filter = "(krbPrincipalName="+self.__safe_filter(principal)+")"
return self.__get_sub_entry(self.basedn, filter, sattrs, opts)
def get_user_by_email (self, email, sattrs=None, opts=None):
"""Get a specific user's entry. Return as a dict of values.
Multi-valued fields are represented as lists.
"""
email = self.__safe_filter(email)
filter = "(mail=" + email + ")"
return self.__get_sub_entry(self.basedn, filter, sattrs, opts)
def get_users_by_manager (self, manager_dn, sattrs=None, opts=None):
"""Gets the users that report to a particular manager.
"""

View File

@@ -323,6 +323,7 @@ def handler(req, profiling=False):
h.register_function(f.update_entry)
h.register_function(f.get_user_by_uid)
h.register_function(f.get_user_by_principal)
h.register_function(f.get_user_by_email)
h.register_function(f.get_users_by_manager)
h.register_function(f.add_user)
h.register_function(f.get_add_schema)