function _rate_get_token in Rate 6.2
Same name and namespace in other branches
- 7 rate.module \_rate_get_token()
Get a token for the voting button.
This is a wrapper around drupal_get_token() to make this compatible with Pressflow. This function uses session_id(), which will generate a different id for each request from anonymous users when using Pressflow. Tokens will never match in this case, thus the votes are not cast.
Parameters
string $value:
Return value
string
2 calls to _rate_get_token()
- rate_generate_widget in ./
rate.module - Generate a widget.
- rate_vote_ahah in ./
rate.module - AHAH callback for the vote buttons.
File
- ./
rate.module, line 887 - Rate module
Code
function _rate_get_token($value) {
global $user;
if ($user->uid) {
return drupal_get_token($value);
}
else {
return md5($value . drupal_get_private_key());
}
}