Update of /cvsroot/tmda/tmda/contrib/cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv28580
Modified Files:
Release.py
Log Message:
Changed to accept UID instead of user name in URL.
Index: Release.py
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/Release.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Release.py 6 Dec 2002 20:35:15 -0000 1.2
+++ Release.py 7 Dec 2002 02:50:44 -0000 1.3
@@ -24,6 +24,7 @@
This module is run when a user clicks a URL in a confirmation e-mail."""
import os
+import pwd
import re
import CgiUtil
from email.Utils import parseaddr
@@ -33,15 +34,15 @@
def Release(QueryString):
"""Release the message represented in the QueryString.
-QueryString is in the format <user>&<timestamp>.<PID>.<HMAC>
+QueryString is in the format <UID>.<timestamp>.<PID>.<HMAC>
-Where <user> is the login name of the TMDA account, <HMAC> must be used to
-validate <timestamp>.<PID>, and the pending e-mail filename is
-"<timestamp>.<PID>.msg"."""
+Where <UID> is the UID of the TMDA account, <HMAC> must be used to validate
+<timestamp>.<PID>, and the pending e-mail filename is "<timestamp>.<PID>.msg".
+"""
try:
- User, Message = QueryString.split("&")
- Timestamp, PID, HMAC = Message.split(".")
+ UID, Timestamp, PID, HMAC = QueryString.split(".")
+ User = pwd.getpwuid(int(UID))[0]
except ValueError:
Fatal("format")
MsgID = "%s.%s.msg" % (Timestamp, PID)
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs