You are here

function BotchaRecipeUsingJsAbstract::getJsChops in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeUsingJsAbstract::getJsChops()
  2. 7.2 controller/botcha_recipe.controller.inc \BotchaRecipeUsingJsAbstract::getJsChops()
  3. 7.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeUsingJsAbstract::getJsChops()

File

controller/botcha_recipe.controller.inc, line 580
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipeUsingJsAbstract

Code

function getJsChops() {
  $secure_token = $this
    ->getProperty($this->settings['js']['secure_token'], 'getJsSecureToken');

  // Chop the token in 3 parts.
  $js_chops = array();
  $chop1 = 2;
  $js_chops[$chop1] = substr($secure_token, 0, $chop1);
  $chop2 = mt_rand(5, 8);
  $js_chops[$chop2] = substr($secure_token, $chop1 + $chop2);
  return $js_chops;
}