Closed (outdated)
Project:
CAPTCHA
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2010 at 21:07 UTC
Updated:
17 Jan 2018 at 01:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
soxofaan commentedGood idea,
And maybe, we can take this a bit further:
- provide a hook "hook_captcha_log($form_id, $solution, $response, ...)" that would be called on CAPTCHA issues: wrong response, empty response, CAPTCHA session reuse attack, ...
- move the handling of these log items to a separate module, to make the core CAPTCHA module a bit lighter (both in UI and in code) and still allow for more advanced processing of the issues in the external/optional module (e.g. daily summary, weekly summary, email warnings, ...)
What do you think?
PS: if you create patches, it is indeed recommended to do it against 6.x-2.x-dev (CVS branch DRUPAL-6--2), there seem to be a problem with the automated test system. Anyway, even though you created the patch against 6.x-2.3, it could still be applicable to CVS branch DRUPAL-6--2. Let's try...
Comment #3
miopa commentedlog_fail.patch queued for re-testing.
Comment #4
miopa commentedUnfortunately I can't contribute serious code right now.
The one feature that I need the most is a summary similar to /admin/reports/visitors, where I can list and ban hosts from where most of the failed CAPTCHA originates. I'll try to implement this next week and post a patch.
Comment #6
soxofaan commented#1002246: variable_set('captcha_wrong_response_counter',...) is expensive performance wise (clears cache) might also be relevant to take into account here
Comment #7
miopa commentedHere is an updated version, including new 'Log' tab, and removing the counter in the variable.
I think the absolute counter is not that needed, and the performance pressure could be great because of all the spam bots trying to submit unaware of the CAPTCHA (my captcha_wrong_response_counter is
i:14125;).With this patch only stats about the period covered in the Watchdog table can be seen, but for me this is even better because it reflects current situation.
I don't have time to take this further, so if anybody is willing and able, please do :)
Comment #8
miopa commentedI'm sure I attached the patch in the previous message.
Comment #10
miopa commentedI don't get this 'failed testing' thing.
Undefined variable: wrongCountIt isn't defined because there is no need for it to be.
Comment #11
miopa commentedI hope I won't annoy the test bot :)
Comment #13
soxofaan commentedThe problem is that when the variable "captcha_log_wrong_responses" is false, you use the
$wrongCountvariable (in the description) without it being defined/assigned a value.Also some minor remarks about code style:
- In Drupal code, we use two spaces for indentation
- we put the opening brace "{" on the same line as the "for", "function", "if"
- we don't use camel case/dromedaris case (
$wrongCount), but underscores:$wrong_countmore info here: http://drupal.org/coding-standards
thanks for your work
Comment #14
miopa commentedThe problem is that when the variable "captcha_log_wrong_responses" is false, you use the $wrongCount variable (in the description) without it being defined/assigned a value.
I forget that PHP fires notices for that shit. This should pass.
Comment #15
wundo commented