From 5c16047092652d2d56c86d83259c56eff883b485 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Mon, 17 Nov 2008 18:15:40 -0700 Subject: user-lock and user-unlock commands now use textui, which finishes the user plugins --- ipalib/plugins/f_user.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'ipalib/plugins/f_user.py') diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py index eed6d8ab..ad7572c2 100644 --- a/ipalib/plugins/f_user.py +++ b/ipalib/plugins/f_user.py @@ -348,28 +348,37 @@ api.register(user_show) class user_lock(frontend.Command): 'Lock a user account.' + takes_args = ( Param('uid', primary_key=True), ) + def execute(self, uid, **kw): ldap = self.api.Backend.ldap dn = ldap.find_entry_dn("uid", uid) return ldap.mark_entry_inactive(dn) - def output_for_cli(self, ret): - if ret: - print "User locked" + + def output_for_cli(self, textui, result, uid): + if result: + textui.print_plain('Locked user "%s"' % uid) + api.register(user_lock) + class user_unlock(frontend.Command): 'Unlock a user account.' + takes_args = ( Param('uid', primary_key=True), ) + def execute(self, uid, **kw): ldap = self.api.Backend.ldap dn = ldap.find_entry_dn("uid", uid) return ldap.mark_entry_active(dn) - def output_for_cli(self, ret): - if ret: - print "User unlocked" + + def output_for_cli(self, textui, result, uid): + if result: + textui.print_plain('Unlocked user "%s"' % uid) + api.register(user_unlock) -- cgit