summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/f_user.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py
index 6aebddfa..972ee075 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():