X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-info;h=8fde99a39343a85b00ff285fcb217882a56b5337;hp=5f144bd13a01f80bdc1eefa2bc4ef31eeef8577d;hb=a6fb69805c3999a85c064a96c93417bb1c284c5c;hpb=b5fb9ea2f797cc33f179e66050553560433f7a81 diff --git a/ud-info b/ud-info index 5f144bd..8fde99a 100755 --- a/ud-info +++ b/ud-info @@ -17,7 +17,7 @@ # -r Enable 'root' functions, do this if your uid has access to # restricted variables. -import string, time, os, pwd, sys, getopt, ldap, crypt, whrandom, readline, copy; +import time, os, pwd, sys, getopt, ldap, crypt, readline, copy; from userdir_ldap import *; RootMode = 0; @@ -45,6 +45,14 @@ AttrInfo = {"cn": ["First Name", 101], "icqUin": ["ICQ UIN",14], "jabberJID": ["Jabber ID",15], "privateSub": ["Debian-Private",16], + "gender": ["Gender",17], + "birthDate": ["Date of Birth",18], + "mailDisableMessage": ["Mail Disabled",19], + "mailGreylisting": ["Mail Greylisting",20], + "mailCallout": ["Mail Callouts",21], + "mailRBL": ["Mail RBLs",22], + "mailRHSBL": ["Mail RHSBLs",23], + "mailWhitelist": ["Mail Whitelist",24], "comment": ["Comment",116], "userPassword": ["Crypted Password",117], "dnsZoneEntry": ["d.net Entry",118]}; @@ -67,6 +75,14 @@ AttrPrompt = {"cn": ["Common name or first name"], "supplementaryGid": ["Groups the user is in"], "allowedHost": ["Grant access to certain hosts"], "privateSub": ["Debian-Private mailing list subscription"], + "gender": ["ISO5218 Gender code (1=male,2=female,9=unspecified)"], + "birthDate": ["Date of Birth (YYYYMMDD)"], + "mailDisableMessage": ["Error message to return via SMTP"], + "mailGreylisting": ["SMTP Greylisting (TRUE/FALSE)"], + "mailCallout": ["SMTP Callouts (TRUE/FALSE)"], + "mailRBL": ["SMTP time RBL lists"], + "mailRHSBL": ["SMTP time RHSBL lists"], + "mailWhitelist": ["SMTP time whitelist from other checks"], "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"], @@ -174,7 +190,8 @@ def ShowAttrs(Attrs): # Change a single attribute def ChangeAttr(Attrs,Attr): if (Attr == "supplementaryGid" or Attr == "allowedHost" or \ - Attr == "member" or Attr == "dnsZoneEntry"): + Attr == "member" or Attr == "dnsZoneEntry" or Attr == "mailWhitelist" or \ + Attr == "mailRBL" or Attr == "mailRHSBL"): return MultiChangeAttr(Attrs,Attr); print "Old value: '%s'" % (GetAttr(Attrs,Attr,"")); @@ -212,7 +229,7 @@ def MultiChangeAttr(Attrs,Attr): Attrs[1][Attr].sort(); print "Old values: ",Attrs[1][Attr]; - Mode = string.upper(raw_input("[D]elete or [A]dd? ")); + Mode = raw_input("[D]elete or [A]dd? ").upper() if (Mode != 'D' and Mode != 'A'): return; @@ -244,7 +261,12 @@ def MultiChangeAttr(Attrs,Attr): User = pwd.getpwuid(os.getuid())[0]; BindUser = User; # Process options -(options, arguments) = getopt.getopt(sys.argv[1:], "nu:c:a:r") +try: + (options, arguments) = getopt.getopt(sys.argv[1:], "nu:c:a:r") +except getopt.GetoptError, data: + print data + sys.exit(1) + for (switch, val) in options: if (switch == '-u'): User = val;