From 5b90c93d6fc5bde62e5a4bf3717c01f5d18be766 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 21 Oct 2008 09:31:44 -0400 Subject: [PATCH] Implement --all option to display all attributes. Still need to strip the dn when not doing all. --- ipalib/plugins/f_user.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py index 6aebddfa4..972ee0751 100644 --- a/ipalib/plugins/f_user.py +++ b/ipalib/plugins/f_user.py @@ -265,6 +265,9 @@ api.register(user_find) class user_show(crud.Get): 'Examine an existing user.' + takes_options = ( + Param('all?', type=ipa_types.Bool(), doc='Display all user attributes'), + ) def execute(self, uid, **kw): """ Execute the user-show operation. @@ -275,12 +278,15 @@ class user_show(crud.Get): Returns the entry :param uid: The login name of the user to retrieve. - :param kw: Not used. + :param kw: "all" set to True = return all attributes """ ldap = self.api.Backend.ldap dn = ldap.find_entry_dn("uid", uid) # FIXME: should kw contain the list of attributes to display? - return ldap.retrieve(dn) + if kw.get('all', False): + return ldap.retrieve(dn) + else: + return ldap.retrieve(dn, ['uid','givenname','sn','homeDirectory','loginshell']) def output_for_cli(self, user): if user: for a in user.keys():