diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-09-25 15:44:49 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-09-25 15:44:49 -0700 |
commit | fa7759684f97f1faa174db234865cea6442ac6f8 (patch) | |
tree | 65363205d758c7d107c61fc53309f6feeb2fbd63 /ipa-server/xmlrpc-server/funcs.py | |
parent | 765279d82b24da0aac1821fea0c4c02859ffe00c (diff) | |
download | freeipa-fa7759684f97f1faa174db234865cea6442ac6f8.tar.gz freeipa-fa7759684f97f1faa174db234865cea6442ac6f8.tar.xz freeipa-fa7759684f97f1faa174db234865cea6442ac6f8.zip |
Adds manager and direct reports to usershow page.
Fixes a bug with the group by member where is wasn't trapping not found errors.
Diffstat (limited to 'ipa-server/xmlrpc-server/funcs.py')
-rw-r--r-- | ipa-server/xmlrpc-server/funcs.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index 2f9606d0f..d226ac863 100644 --- a/ipa-server/xmlrpc-server/funcs.py +++ b/ipa-server/xmlrpc-server/funcs.py @@ -308,7 +308,18 @@ class IPAServer: filter = "(objectClass=*)" return self.__get_entry(dn, filter, sattrs, opts) - + + def get_users_by_manager (self, manager_dn, sattrs=None, opts=None): + """Gets the users that report to a particular manager. + """ + + filter = "(&(objectClass=person)(manager=%s))" % manager_dn + + try: + return self.__get_list(self.basedn, filter, sattrs, opts) + except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): + return [] + def add_user (self, user, user_container=None, opts=None): """Add a user in LDAP. Takes as input a dict where the key is the attribute name and the value is either a string or in the case @@ -601,7 +612,10 @@ class IPAServer: filter = "(&(objectClass=posixGroup)(uniqueMember=%s))" % member_dn - return self.__get_list(self.basedn, filter, sattrs, opts) + try: + return self.__get_list(self.basedn, filter, sattrs, opts) + except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): + return [] def add_group (self, group, group_container=None, opts=None): """Add a group in LDAP. Takes as input a dict where the key is the |