diff MoinMoin/user.py @ 5985:0063e98b14aa

cfg.recovery_token_lifetime to determine how long the recovery token will be valid
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 02 May 2013 22:57:54 +0200
parents 96ef8a8ecc80
children
line wrap: on
line diff
--- a/MoinMoin/user.py	Sun Apr 07 01:58:43 2013 +0200
+++ b/MoinMoin/user.py	Thu May 02 22:57:54 2013 +0200
@@ -1109,8 +1109,8 @@
             stamp = int(parts[0])
         except ValueError:
             return False
-        # only allow it to be valid for twelve hours
-        if stamp + 12*60*60 < time.time():
+        lifetime = self._request.cfg.recovery_token_lifetime * 3600
+        if time.time() > stamp + lifetime:
             return False
         # check hmac
         # key must be of type string