function flag_get_token in Flag 6.2
Same name and namespace in other branches
- 5 flag.module \flag_get_token()
- 6 flag.module \flag_get_token()
- 7.3 flag.module \flag_get_token()
- 7.2 flag.module \flag_get_token()
Get a private token used to protect links from spoofing - CSRF.
2 calls to flag_get_token()
- flag_check_token in ./
flag.module - Check to see if a token value matches the specified node.
- flag_flag_link in ./
flag.module - Implementation of hook_flag_link().
File
- ./
flag.module, line 1651 - The Flag module.
Code
function flag_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) : md5(drupal_get_private_key() . $content_id);
}