mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
user-lock and user-unlock commands now use textui, which finishes the user plugins
This commit is contained in:
parent
12dc0a0aa9
commit
5c16047092
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user