diff options
author | Rob Crittenden <rcritten@redhat.com> | 2007-11-09 15:45:11 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2007-11-09 15:45:11 -0500 |
commit | f7358533d0b81f70f10e9116652f4e7d71e29b02 (patch) | |
tree | 44381681b243ee27ede56d55fb6de0bae2c8a330 | |
parent | d9194cdd098f24f85443cda3dbda730172d6234a (diff) | |
download | freeipa-f7358533d0b81f70f10e9116652f4e7d71e29b02.tar.gz freeipa-f7358533d0b81f70f10e9116652f4e7d71e29b02.tar.xz freeipa-f7358533d0b81f70f10e9116652f4e7d71e29b02.zip |
Add the capability to completely delete a user from the database. The
default remains to inactivate them.
-rw-r--r-- | ipa-admintools/ipa-deluser | 11 | ||||
-rw-r--r-- | ipa-admintools/man/ipa-deluser.1 | 14 |
2 files changed, 19 insertions, 6 deletions
diff --git a/ipa-admintools/ipa-deluser b/ipa-admintools/ipa-deluser index 18adf75c0..d14961c84 100644 --- a/ipa-admintools/ipa-deluser +++ b/ipa-admintools/ipa-deluser @@ -33,6 +33,8 @@ 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") @@ -47,11 +49,16 @@ def main(): if len(args) != 2: usage() + msg = "inactivated" try: client = ipaclient.IPAClient() - ret = client.mark_user_deleted(args[1]) + if options.deluser: + ret = client.delete_user(args[1]) + msg = "deleted" + else: + ret = client.mark_user_deleted(args[1]) if (ret == "Success"): - print args[1] + " successfully deleted" + print args[1] + " successfully %s" % msg else: print args[1] + " " + ret except xmlrpclib.Fault, f: diff --git a/ipa-admintools/man/ipa-deluser.1 b/ipa-admintools/man/ipa-deluser.1 index ab0303d75..8d82dcebe 100644 --- a/ipa-admintools/man/ipa-deluser.1 +++ b/ipa-admintools/man/ipa-deluser.1 @@ -19,14 +19,20 @@ .\" .TH "ipa-deluser" "1" "Oct 10 2007" "freeipa" "" .SH "NAME" -ipa\-deluser \- Delete a user +ipa\-deluser \- Delete or inactivate a user .SH "SYNOPSIS" -ipa\-deluser \fIuser\fR +ipa\-deluser [\fIOPTION\fR]... \fIuser\fR .SH "DESCRIPTION" -Deletes a user with name \fIname\fR. +Inactivates a user with login name \fIname\fR. -Users are not completely removed with the command, just marked as inactive. +By default users are not completely removed. They are marked as inactive. Use the [\-d|\-\-delete] option to completely remove them. + +Users are automatically removed from groups when they are deleted. The are not when inactivated. +.SH "OPTIONS" +.TP +\fB\-d\fR, \fB\-\-delete +Completely remove the user from the database. The default is to mark the user inactive. .SH "EXIT STATUS" The exit status is 0 on success, nonzero on error. |