comparison MoinMoin/wikiutil.py @ 5474:a2128aa8b830

merge moin/1.7
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 01 Feb 2010 01:45:22 +0100
parents 10785c0fd48f bba0ab704aa9
children 575601b3117d
comparison
equal deleted inserted replaced
5406:0dd02729b3b5 5474:a2128aa8b830
2494 digest = hash_new('sha1', secret) 2494 digest = hash_new('sha1', secret)
2495 2495
2496 ticket = "%s.%s.%s" % (tm, pagename, action) 2496 ticket = "%s.%s.%s" % (tm, pagename, action)
2497 digest.update(ticket) 2497 digest.update(ticket)
2498 2498
2499 if request.session:
2500 sid = request.session.name
2501 else:
2502 sid = 'None'
2503 if request.user.valid:
2504 uid = request.user.id
2505 else:
2506 uid = 'None'
2507 digest.update(sid+uid)
2508
2499 return "%s.%s" % (ticket, digest.hexdigest()) 2509 return "%s.%s" % (ticket, digest.hexdigest())
2500 2510
2501 2511
2502 def checkTicket(request, ticket): 2512 def checkTicket(request, ticket):
2503 """Check validity of a previously created ticket""" 2513 """Check validity of a previously created ticket"""