Changeset 7297
- Timestamp:
- 7 Dec 2011, 05:51:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/captcha.py
r7296 r7297 65 65 class ICaptcha(Interface): 66 66 67 def verify(request _data):68 """Verify data entered in a request.69 70 Expects some I CaptchaRequest object and returns an67 def verify(request): 68 """Verify data entered in an HTTP request. 69 70 Expects some IHTTPRequest object and returns an 71 71 ICaptchaResponse indicating that the solution was correct or 72 72 not. … … 173 173 grok.implements(ICaptcha) 174 174 175 def verify(self, captcha_request):175 def verify(self, request): 176 176 return CaptchaResponse(True, None) 177 177 … … 191 191 grok.implements(ICaptcha) 192 192 193 #: name of solution field in HTTP request 194 sol_field = 'solution' 195 #: name of challenge field in HTTP request 196 chal_field = 'challenge' 197 193 198 def verify(self, request): 194 if request.solution == request.challenge and request.solution: 199 form = getattr(request, 'form', {}) 200 solution=form.get(self.sol_field, None) 201 challenge=form.get(self.chal_field, None) 202 if solution == challenge and solution: 195 203 return CaptchaResponse(is_valid=True) 196 204 return CaptchaResponse(is_valid=False)
Note: See TracChangeset for help on using the changeset viewer.