diff options
author | rcritten@redhat.com <rcritten@redhat.com> | 2007-09-11 02:48:53 -0400 |
---|---|---|
committer | rcritten@redhat.com <rcritten@redhat.com> | 2007-09-11 02:48:53 -0400 |
commit | ed6ab17c9c703edb43c92a3205c5536771ce4d4f (patch) | |
tree | af34ee5fdda2896a180ac332b0db4d9e57d2533d /ipa-admintools | |
parent | 2ca655980b623a4a65a635a1467c0db90f421f25 (diff) | |
download | freeipa-ed6ab17c9c703edb43c92a3205c5536771ce4d4f.tar.gz freeipa-ed6ab17c9c703edb43c92a3205c5536771ce4d4f.tar.xz freeipa-ed6ab17c9c703edb43c92a3205c5536771ce4d4f.zip |
Add function to allow user's to set/reset their kerberos password
Remove some unused calls to retrieve the current realm
Diffstat (limited to 'ipa-admintools')
-rw-r--r-- | ipa-admintools/ipa-adduser | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ipa-admintools/ipa-adduser b/ipa-admintools/ipa-adduser index 99aadee40..dd99e1e4d 100644 --- a/ipa-admintools/ipa-adduser +++ b/ipa-admintools/ipa-adduser @@ -43,6 +43,8 @@ def parse_options(): help="User's first name") parser.add_option("-l", "--lastname", dest="sn", help="User's last name") + parser.add_option("-p", "--password", dest="password", + help="Set user's password") parser.add_option("-s", "--shell", dest="shell", help="Set user's login shell to shell") parser.add_option("--usage", action="store_true", @@ -75,10 +77,11 @@ def main(): else: user.setValue('loginshell', "/bin/bash") + username = args[1] + try: client = ipaclient.IPAClient() client.add_user(user) - print args[1] + " successfully added" except xmlrpclib.Fault, f: print f.faultString return 1 @@ -92,6 +95,14 @@ def main(): print "%s" % (e.message) return 1 + if options.password is not None: + try: + client.modifyPassword(username, None, options.password) + except ipa.ipaerror.IPAError, e: + print "%s" % (e.message) + return 1 + + print username + " successfully added" return 0 main() |