From 92a150b4f11e18f29c9eb7719b9ff8a0d7759717 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 29 Jan 2009 00:38:16 -0700 Subject: Some tweaks in user plugins, ported to new crud base classes --- ipalib/plugins/f_user.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ipalib/plugins') diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py index ce880b24e..04e0edb42 100644 --- a/ipalib/plugins/f_user.py +++ b/ipalib/plugins/f_user.py @@ -61,6 +61,7 @@ class user(Object): ), Str('uid', cli_name='user', + doc="User's login name", primary_key=True, default_from=lambda givenname, sn: givenname[0] + sn, normalizer=lambda value: value.lower(), @@ -107,8 +108,10 @@ class user(Object): api.register(user) -class user_add(crud.Add): - 'Add a new user.' +class user_add(crud.Create): + """ + Add a new user. + """ def execute(self, uid, **kw): """ @@ -251,11 +254,15 @@ class user_mod(crud.Update): api.register(user_mod) -class user_find(crud.Find): - 'Search the users.' +class user_find(crud.Search): + """ + Search for users. + """ + takes_options = ( Flag('all', doc='Retrieve all user attributes'), ) + def execute(self, term, **kw): ldap = self.api.Backend.ldap @@ -301,7 +308,7 @@ class user_find(crud.Find): api.register(user_find) -class user_show(crud.Get): +class user_show(crud.Retrieve): 'Examine an existing user.' takes_options = ( Flag('all', doc='Retrieve all user attributes'), -- cgit