function BotchaRecipeNoResubmit::handle in BOTCHA Spam Prevention 6.2
Same name and namespace in other branches
- 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeNoResubmit::handle()
- 7.2 controller/botcha_recipe.controller.inc \BotchaRecipeNoResubmit::handle()
- 7.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeNoResubmit::handle()
Handle form depending on the result of spam check.
_state
Parameters
type $result:
type $form:
Overrides BotchaRecipe::handle
File
- controller/
botcha_recipe.controller.inc, line 404 - Controller layer of the BotchaRecipe objects.
Class
Code
function handle($mode, $form, $form_state) {
parent::handle($mode, $form, $form_state);
// !!~ @todo Reduce code duplication.
// @see BotchaRecipe.applyRecipe()
$build_id = isset($_POST['form_build_id']) ? $_POST['form_build_id'] : $form['#build_id'];
// Invalidate cache so resubmit will not work.
// Make it to expire immediately.
$expire = 0;
$data = array();
// @todo Abstract it.
//cache_set('botcha_' . $build_id, $data, 'cache_form', REQUEST_TIME + $expire);
cache_set('botcha_' . $build_id, $data, 'cache_form', $_SERVER['REQUEST_TIME'] + $expire);
}