projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch by Thomas Viehmann: Also add IPv6 to debianhosts
[mirror/userdir-ldap.git]
/
ud-info
diff --git
a/ud-info
b/ud-info
index
795584b
..
73e040d
100755
(executable)
--- a/
ud-info
+++ b/
ud-info
@@
-24,6
+24,7
@@
# Copyright (c) 2008 Martin Zobel-Helas <zobel@debian.org>
# Copyright (c) 2008 Marc 'HE' Brockschmidt <he@debian.org>
# Copyright (c) 2008 Mark Hymers <mhy@debian.org>
# Copyright (c) 2008 Martin Zobel-Helas <zobel@debian.org>
# Copyright (c) 2008 Marc 'HE' Brockschmidt <he@debian.org>
# Copyright (c) 2008 Mark Hymers <mhy@debian.org>
+# Copyright (c) 2008 Joey Schulze <joey@infodrom.org>
#
# 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
#
# 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
@@
-75,7
+76,8
@@
AttrInfo = {"cn": ["First Name", 101],
"mailRBL": ["Mail RBLs",22],
"mailRHSBL": ["Mail RHSBLs",23],
"mailWhitelist": ["Mail Whitelist",24],
"mailRBL": ["Mail RBLs",22],
"mailRHSBL": ["Mail RHSBLs",23],
"mailWhitelist": ["Mail Whitelist",24],
- "VoIP": ["VoIP Address",25],
+ "mailSpamOptOut": ["Mail Spam Filtering",25],
+ "VoIP": ["VoIP Address",26],
"comment": ["Comment",116],
"userPassword": ["Crypted Password",117],
"dnsZoneEntry": ["d.net Entry",118],
"comment": ["Comment",116],
"userPassword": ["Crypted Password",117],
"dnsZoneEntry": ["d.net Entry",118],
@@
-109,6
+111,7
@@
AttrPrompt = {"cn": ["Common name or first name"],
"mailRBL": ["SMTP time RBL lists"],
"mailRHSBL": ["SMTP time RHSBL lists"],
"mailWhitelist": ["SMTP time whitelist from other checks"],
"mailRBL": ["SMTP time RBL lists"],
"mailRHSBL": ["SMTP time RHSBL lists"],
"mailWhitelist": ["SMTP time whitelist from other checks"],
+ "mailSpamOptOut": ["Mail Spam Filtering"],
"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"],
"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"],
@@
-116,7
+119,10
@@
AttrPrompt = {"cn": ["Common name or first name"],
"labeledURI": ["Web home page"],
"jabberJID": ["Jabber ID"],
"icqUin": ["ICQ UIN Number"],
"labeledURI": ["Web home page"],
"jabberJID": ["Jabber ID"],
"icqUin": ["ICQ UIN Number"],
- "VoIP": ["VoIP Address"]};
+ "VoIP": ["VoIP Address"],
+ "accountStatus": ["DD status"],
+ "accountComment": ["DD status comment"],
+ };
# Create a map of IDs to desc,value,attr
OrderedIndex = {};
# Create a map of IDs to desc,value,attr
OrderedIndex = {};
@@
-125,6
+131,10
@@
for at in AttrInfo.keys():
OrderedIndex[AttrInfo[at][1]] = [AttrInfo[at][0], "", at];
OrigOrderedIndex = copy.deepcopy(OrderedIndex);
OrderedIndex[AttrInfo[at][1]] = [AttrInfo[at][0], "", at];
OrigOrderedIndex = copy.deepcopy(OrderedIndex);
+for id in OrderedIndex:
+ if not AttrPrompt.has_key( OrderedIndex[id][2] ):
+ print "Warning: no AttrPrompt for %s"%(id)
+
# Show shadow information
def PrintShadow(Attrs):
Changed = int(GetAttr(Attrs,"shadowLastChange","0"));
# Show shadow information
def PrintShadow(Attrs):
Changed = int(GetAttr(Attrs,"shadowLastChange","0"));
@@
-242,6
+252,14
@@
def ChangeAttr(Attrs,Attr):
Attrs[1][Attr] = [""];
return;
Attrs[1][Attr] = [""];
return;
+ if (Attr == "mailSpamOptOut" and NewValue != "true" and NewValue != "false"):
+ if (NewValue == "1"): NewValue = "true"
+ else:
+ if (NewValue == "0"): NewValue = "false"
+ else:
+ print "Need a boolean value"
+ return
+
# Set a new value
print "Setting.",;
l.modify_s(UserDn,[(ldap.MOD_REPLACE,Attr,NewValue)]);
# Set a new value
print "Setting.",;
l.modify_s(UserDn,[(ldap.MOD_REPLACE,Attr,NewValue)]);
@@
-292,10
+310,10
@@
def Lock(UserDn, Attrs, DisableMail=True):
(ldap.MOD_REPLACE,"shadowExpire","1")];
if DisableMail:
recs.append( (ldap.MOD_REPLACE,"mailDisableMessage","account locked") )
(ldap.MOD_REPLACE,"shadowExpire","1")];
if DisableMail:
recs.append( (ldap.MOD_REPLACE,"mailDisableMessage","account locked") )
- Attrs[0][1]["
shadowLastChange"] = [shadowLast
];
+ Attrs[0][1]["
mailDisableMessage"] = ["account locked"
];
l.modify_s(UserDn,recs);
Attrs[0][1]["userPassword"] = ["{crypt}*LK*"];
l.modify_s(UserDn,recs);
Attrs[0][1]["userPassword"] = ["{crypt}*LK*"];
- Attrs[0][1]["
mailDisableMessage"] = ["account locked"
];
+ Attrs[0][1]["
shadowLastChange"] = [shadowLast
];
Attrs[0][1]["shadowExpire"] = ["1"];
# Main program starts here
Attrs[0][1]["shadowExpire"] = ["1"];
# Main program starts here
@@
-437,7
+455,7
@@
while(1):
print "Set account to:"
print " 1) retiring (lock account but do not disable mail):"
print "Set account to:"
print " 1) retiring (lock account but do not disable mail):"
- print " 2)
retired (
lock account and disable mail):"
+ print " 2)
inactive (removed/emeritus/... -
lock account and disable mail):"
print " 3) memorial (lock account and disable mail):"
print " 4) active (do not change other settings, you will have to deal with them)"
print " q) return (no change)"
print " 3) memorial (lock account and disable mail):"
print " 4) active (do not change other settings, you will have to deal with them)"
print " q) return (no change)"
@@
-447,7
+465,7
@@
while(1):
if Resp == "1":
newstatus = "retiring %s"%(time.strftime("%Y-%m-%d"))
else:
if Resp == "1":
newstatus = "retiring %s"%(time.strftime("%Y-%m-%d"))
else:
- newstatus = "
retired
%s"%(time.strftime("%Y-%m-%d"))
+ newstatus = "
inactive
%s"%(time.strftime("%Y-%m-%d"))
l.modify_s(UserDn,[(ldap.MOD_REPLACE,"accountStatus",newstatus)])
Attrs[0][1]["accountStatus"] = [newstatus]
l.modify_s(UserDn,[(ldap.MOD_REPLACE,"accountStatus",newstatus)])
Attrs[0][1]["accountStatus"] = [newstatus]