mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add utility to lock user accounts. Remove lock capability from ipa-deluser
Fix bootstrap.ldif to add new Class of Service entries properly Include some man pages that weren't being installed
This commit is contained in:
@@ -34,8 +34,6 @@ def usage():
|
||||
|
||||
def parse_options():
|
||||
parser = OptionParser()
|
||||
parser.add_option("-d", "--delete", action="store_true", dest="deluser",
|
||||
help="Delete the user, don't inactivate them.")
|
||||
parser.add_option("--usage", action="store_true",
|
||||
help="Program usage")
|
||||
|
||||
@@ -50,21 +48,10 @@ def main():
|
||||
if len(args) != 2:
|
||||
usage()
|
||||
|
||||
msg = "inactivated"
|
||||
try:
|
||||
client = ipaclient.IPAClient()
|
||||
if options.deluser:
|
||||
ret = client.delete_user(args[1])
|
||||
msg = "deleted"
|
||||
else:
|
||||
try:
|
||||
ret = client.mark_user_inactive(args[1])
|
||||
except ipa.ipaerror.exception_for(ipa.ipaerror.LDAP_EMPTY_MODLIST):
|
||||
print "User is already marked inactive"
|
||||
return 0
|
||||
except:
|
||||
raise
|
||||
print args[1] + " successfully %s" % msg
|
||||
ret = client.delete_user(args[1])
|
||||
print args[1] + " successfully deleted"
|
||||
except xmlrpclib.Fault, fault:
|
||||
if fault.faultCode == errno.ECONNREFUSED:
|
||||
print "The IPA XML-RPC service is not responding."
|
||||
|
||||
Reference in New Issue
Block a user