You are here

final protected function RateWidget::getToken in Rate 7.2

Generate a rate token

This function is very similar to drupal_get_token(). The reason not to use drupal_get_token() is that that function uses session_id(), which generates different session id's for each page request when not logged in.

Parameters

string $values:

Return value

string

1 call to RateWidget::getToken()
RateDefaultWidget::loadButtons in classes/default.inc
Load buttons from database.

File

classes/widget.inc, line 277

Class

RateWidget

Code

protected final function getToken($value = '') {
  global $user;
  $value .= $this->entity_type;
  $value .= $this->entity_id;
  return drupal_hmac_base64($value, $user->uid . drupal_get_private_key() . drupal_get_hash_salt());
}