mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
@@ -98,6 +98,13 @@ class IPAClient:
|
||||
result = self.transport.get_user_by_principal(principal,sattrs)
|
||||
return user.User(result)
|
||||
|
||||
def get_user_by_email(self,email,sattrs=None):
|
||||
"""Get a specific user's entry. Return as a dict of values.
|
||||
Multi-valued fields are represented as lists.
|
||||
"""
|
||||
result = self.transport.get_user_by_email(email,sattrs)
|
||||
return user.User(result)
|
||||
|
||||
def get_users_by_manager(self,manager_dn,sattrs=None):
|
||||
"""Gets the users the report to a particular manager.
|
||||
If sattrs is not None then only those
|
||||
|
||||
@@ -165,7 +165,23 @@ class RPCClient:
|
||||
raise xmlrpclib.Fault(value, msg)
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
|
||||
def get_user_by_email(self,email,sattrs=None):
|
||||
"""Get a specific user's entry. Return as a dict of values.
|
||||
Multi-valued fields are represented as lists.
|
||||
"""
|
||||
server = self.setup_server()
|
||||
if sattrs is None:
|
||||
sattrs = "__NONE__"
|
||||
try:
|
||||
result = server.get_user_by_email(email, sattrs)
|
||||
except xmlrpclib.Fault, fault:
|
||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||
except socket.error, (value, msg):
|
||||
raise xmlrpclib.Fault(value, msg)
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def get_users_by_manager(self,manager_dn,sattrs=None):
|
||||
"""Gets the users that report to a manager.
|
||||
If sattrs is not None then only those
|
||||
|
||||
Reference in New Issue
Block a user