diff --git a/CHANGES.txt b/CHANGES.txt index 5836412..4d8afb8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,9 +4,14 @@ Changelog 1.0b1 - 2010-06-02 ------------------ +* Fix _generate_words method. The "nowish" variable tells us in which 5 minutes + slot we are in. Therefore we increment the time slot by 1, not by 5 (minutes). + [tbesluau] + * Declare that plone.formwidget.captcha provides a Captcha field that can be used by plone.app.discussion to add a Captcha field to comment forms. - [timo] + [timo] + 1.0a2 - 2010-01-28 ------------------ diff --git a/plone/formwidget/captcha/browser/captcha.py b/plone/formwidget/captcha/browser/captcha.py index ddbc6a1..f6e647e 100644 --- a/plone/formwidget/captcha/browser/captcha.py +++ b/plone/formwidget/captcha/browser/captcha.py @@ -74,9 +74,13 @@ class Captcha(BrowserView): """ session = self.request[COOKIE_ID] nowish = _TEST_TIME or int(time.time() / 300) + # The line above defines nowish, which tells us what five minutes slot + # we're in. Indeed, every second, int(time.time()) increments by 1, so + # int(time.time() / 300) will increment by 1 every 5 minutes. secret = getUtility(IKeyManager).secret() seeds = [sha.new(secret + session + str(nowish)).digest(), - sha.new(secret + session + str(nowish - 5)).digest()] + sha.new(secret + session + str(nowish - 1)).digest()] + # The line above generates a seed based on the "nowish" of 5 minutes ago. words = [] for seed in seeds: