protected function BotchaRecipeNoResubmit::getToken in BOTCHA Spam Prevention 7.3
Same name and namespace in other branches
- 6.2 controller/botcha_recipe.controller.inc \BotchaRecipeNoResubmit::getToken()
- 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeNoResubmit::getToken()
- 7.2 controller/botcha_recipe.controller.inc \BotchaRecipeNoResubmit::getToken()
2 calls to BotchaRecipeNoResubmit::getToken()
- BotchaRecipeNoResubmit::apply in controller/
recipe/ botcha.recipe.controller.inc - BotchaRecipeNoResubmit::isSpam in controller/
recipe/ botcha.recipe.controller.inc - Spam check.
File
- controller/
recipe/ botcha.recipe.controller.inc, line 415 - Controller layer of the BotchaRecipe objects.
Class
Code
protected function getToken($value = '') {
// A bit customized version of drupal_get_token().
// @see drupal_get_token()
if (empty($_SESSION['botcha_session'])) {
$_SESSION['botcha_session'] = session_id();
}
// @todo Replace with function, depending on BOTCHA_SECRET.
// @see?
// @todo Abstract it.
//return md5($_SESSION['botcha_session'] . $value . BOTCHA_SECRET);
return drupal_hmac_base64($value, $_SESSION['botcha_session'] . drupal_get_private_key() . drupal_get_hash_salt());
}