You are here

protected function BotchaRecipe::prepare in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipe::prepare()
4 calls to BotchaRecipe::prepare()
BotchaRecipe::apply in controller/recipe/botcha.recipe.controller.inc
BotchaRecipe::handle in controller/recipe/botcha.recipe.controller.inc
Handle form depending on the result of spam check.
BotchaRecipe::isSpam in controller/recipe/botcha.recipe.controller.inc
Spam check.
BotchaRecipeObscureUrl::prepare in controller/recipe/botcha.recipe.controller.inc
1 method overrides BotchaRecipe::prepare()
BotchaRecipeObscureUrl::prepare in controller/recipe/botcha.recipe.controller.inc

File

controller/recipe/botcha.recipe.controller.inc, line 252
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipe
Abstract class to describe recipe data structure.

Code

protected function prepare($form, $form_state) {
  if (!empty($_POST['form_build_id'])) {
    $build_id = $_POST['form_build_id'];
    $method = 'build_id_submit';
  }
  else {
    $build_id = $form['#build_id'];
    $method = 'build_id';
  }
  $secret = $this
    ->getSecret($build_id);

  // Set necessary parameters.
  $this
    ->setSecret($secret)
    ->setMethod($method);
}