function rules_link_get_token in Rules Link 7
Same name and namespace in other branches
- 7.2 rules_link.module \rules_link_get_token()
Generates a token used to protect links from spoofing.
3 calls to rules_link_get_token()
- rules_link_check_token in ./
rules_link.module - Checks if the given token is correct.
- rules_link_render_link in ./
rules_link.module - Renders a link.
- rules_link_tokens in ./
rules_link.module - Implements hook_tokens().
File
- ./
rules_link.module, line 282 - Rules Link - module file.
Code
function rules_link_get_token($content_id) {
// Anonymous users get a less secure token, since it must be the same for all
// anonymous users on the entire site to work with page caching.
return $GLOBALS['user']->uid ? drupal_get_token($content_id) : drupal_hmac_base64($content_id, drupal_get_private_key() . drupal_get_hash_salt());
}