function captcha_after_db_set_form in CAPTCHA After 7
Same name and namespace in other branches
- 6 captcha_after.module \captcha_after_db_set_form()
Saves captcha_after form settings in database.
4 calls to captcha_after_db_set_form()
- CaptchaAfterGlobalThresholdTestCase::doTestCaptchaAfterFloodingThreshold in ./
captcha_after.test - Testing of flooding threshold for node/add/page form.
- CaptchaAfterGlobalThresholdTestCase::testCaptchaAfterSubmitThreshold in ./
captcha_after.test - Testing of submit threshold for user login form.
- CaptchaAfterPerFormThresholdTestCase::testCaptchaAfterSubmitThreshold in ./
captcha_after.test - Testing of per form submit threshold for user login form.
- captcha_after_settings_form_submit in ./
captcha_after.admin.inc - CAPTCHA after settings form submit.
File
- ./
captcha_after.module, line 257 - Show CAPTCHA protection on selected forms after specified number of unsuccessful form submit attempts has been made.
Code
function captcha_after_db_set_form($form_id, array $options) {
$enable = $options['enable'];
unset($options['enable']);
db_delete('captcha_after')
->condition('form_id', $form_id)
->execute();
db_insert('captcha_after')
->fields(array(
'form_id' => $form_id,
'enable' => $enable,
'options' => serialize($options),
))
->execute();
}