summaryrefslogtreecommitdiffstats
path: root/ipa-admintools/ipa-finduser
diff options
context:
space:
mode:
authorKarl MacMillan <kmacmillan@mentalrootkit.com>2007-07-31 12:09:38 -0400
committerKarl MacMillan <kmacmillan@mentalrootkit.com>2007-07-31 12:09:38 -0400
commit7d95cd612c1b340add692038c835e7cd8d8ad18b (patch)
tree144813760c6ff19d85285496293270385af74fde /ipa-admintools/ipa-finduser
parent1d8d4222ab05ee7cf84203d4917174f7fbca1200 (diff)
downloadfreeipa-7d95cd612c1b340add692038c835e7cd8d8ad18b.tar.gz
freeipa-7d95cd612c1b340add692038c835e7cd8d8ad18b.tar.xz
freeipa-7d95cd612c1b340add692038c835e7cd8d8ad18b.zip
Final reorginzation to reflect packaging.
Diffstat (limited to 'ipa-admintools/ipa-finduser')
-rw-r--r--ipa-admintools/ipa-finduser58
1 files changed, 58 insertions, 0 deletions
diff --git a/ipa-admintools/ipa-finduser b/ipa-admintools/ipa-finduser
new file mode 100644
index 000000000..928eff753
--- /dev/null
+++ b/ipa-admintools/ipa-finduser
@@ -0,0 +1,58 @@
+#! /usr/bin/python -E
+# Authors: Rob Crittenden <rcritten@redhat.com>
+#
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; version 2 only
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+from optparse import OptionParser
+import ipa
+import ipa.rpcclient
+import ipa.ipaldap
+import base64
+import sys
+import xmlrpclib
+
+def usage():
+ print "ipa-finduser <uid>"
+ sys.exit()
+
+def parse_options():
+ parser = OptionParser()
+
+ (options, args) = parser.parse_args()
+
+ return options, args
+
+def main():
+ user={}
+ (options, args) = parse_options()
+
+ if len(args) != 1:
+ usage()
+
+ try:
+ ent = ipa.rpcclient.get_user(args[0])
+ entry = ipa.ipaldap.Entry(ent['dn'])
+ for e in ent:
+ entry.setValues(e, ent[e])
+ print entry
+ except xmlrpclib.Fault, fault:
+ print fault.faultString
+
+ return 0
+
+main() \ No newline at end of file