X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-info;h=a99a3ebc55fc8ab730145f27ebb745c987768ccd;hb=7d9a29b89e32fb3997d50407987a9ac6b6623f68;hp=9739380ba5d19d3c185476b4d569f1f29af1075c;hpb=57d51d7e5cc0a79bb97a55d9eaa0263a4cfc2005;p=mirror%2Fuserdir-ldap.git diff --git a/ud-info b/ud-info index 9739380..a99a3eb 100755 --- a/ud-info +++ b/ud-info @@ -16,10 +16,8 @@ # database # -r Enable 'root' functions, do this if your uid has access to # restricted variables. -# -# http://www.geocode.com/eagle.html-ssi -import string, time, posix, pwd, sys, getopt, ldap, crypt, whrandom, readline, copy; +import string, time, os, pwd, sys, getopt, ldap, crypt, whrandom, readline, copy; from userdir_ldap import *; RootMode = 0; @@ -44,8 +42,10 @@ AttrInfo = {"cn": ["First Name", 101], "labeledurl": ["Home Page",11], "latitude": ["Latitude",12], "longitude": ["Longitude",13], - "comment": ["Comment",114], - "userpassword": ["Crypted Password",115]}; + "icqUIN": ["ICQ UIN",14], + "comment": ["Comment",115], + "userpassword": ["Crypted Password",116], + "dnszoneentry": ["d.net Entry",117]}; AttrPrompt = {"cn": ["Common name or first name"], "mn": ["Middle name (or initial if it ends in a dot)"], @@ -67,7 +67,9 @@ AttrPrompt = {"cn": ["Common name or first name"], "member": ["LDAP Group Member for slapd ACLs"], "latitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"], "longitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"], - "labeledurl": ["Web home page"]}; + "dnszoneentry": ["DNS Zone fragment associated this this user"], + "labeledurl": ["Web home page"], + "icqUIN": ["ICQ UIN Number"]}; # Create a map of IDs to desc,value,attr OrderedIndex = {}; @@ -119,26 +121,7 @@ def PrintKeys(Attrs): First = 1; else: print "%-24s:" % (""), - - # PGP Print - if (len(x) == 32): - I = 0; - while (I < len(x)): - print x[I]+x[I+1], - I = I + 2; - if I == 32/2: - print "", - elif (len(x) == 40): - # GPG Print - I = 0; - while (I < len(x)): - print x[I]+x[I+1]+x[I+2]+x[I+3], - I = I + 4; - if I == 40/2: - print "", - else: - print x, - print; + print FormatPGPKey(x); # Print the SSH RSA Authentication keys for a user def PrintSshRSAKeys(Attrs): @@ -151,11 +134,8 @@ def PrintSshRSAKeys(Attrs): First = 1; else: print "%-24s:" % (""), - Split = string.split(x," "); - - if len(Split) != 4: - del Split[0]; - print Split[0],Split[1],Split[2][:8]+".."+Split[2][-8:],string.join(Split[3:]); + + print FormatSSHAuth(x); # Display all of the attributes in a numbered list def ShowAttrs(Attrs): @@ -189,7 +169,8 @@ def ShowAttrs(Attrs): # Change a single attribute def ChangeAttr(Attrs,Attr): - if (Attr == "supplementarygid" or Attr == "allowedhosts" or Attr == "member"): + if (Attr == "supplementarygid" or Attr == "allowedhosts" or \ + Attr == "member" or Attr == "dnszoneentry"): return MultiChangeAttr(Attrs,Attr); print "Old value: '%s'" % (GetAttr(Attrs,Attr,"")); @@ -256,7 +237,7 @@ def MultiChangeAttr(Attrs,Attr): print; # Main program starts here -User = pwd.getpwuid(posix.getuid())[0]; +User = pwd.getpwuid(os.getuid())[0]; BindUser = User; # Process options (options, arguments) = getopt.getopt(sys.argv[1:], "nu:c:a:r")