- Timestamp:
- Oct 7, 2007, 5:17:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/main.py
r113 r118 6 6 import string 7 7 import subprocess 8 import time 9 import cPickle 10 import base64 8 11 9 12 print 'Content-Type: text/html\n' … … 207 210 if machine is None: #gave error page already 208 211 return 209 token = 'quentin' 212 213 TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" 214 215 data = {} 216 data["user"] = user 217 data["machine"]=machine 218 data["expires"]=time.time()+(5*60) 219 pickledData = cPickle.dumps(data) 220 m = hmac.new(TOKEN_KEY, digestmod=sha) 221 m.update(pickledData) 222 token = {'data': pickledData, 'digest': m.digest()} 223 token = cPickle.dumps(token) 224 token = base64.urlsafe_b64encode(token) 225 210 226 d = dict(user=user, 211 227 machine=machine,
Note: See TracChangeset
for help on using the changeset viewer.