You are here

function sharedblocks_get_token in Shared Blocks 7.2

Given a module and delta, return the security token for this block.

Cannot use drupal_get_token() because it adds session_id() to the token information. Which means a subscribe URL with a token copied while a user is logged in, will not work when fetched by another user or server (anonymous user).

See also

sharedblocks_is_valid_token()

2 calls to sharedblocks_get_token()
sharedblocks_get_publish_uri in ./sharedblocks.publish.inc
Returns the URI of a shared block.
sharedblocks_is_valid_token in ./sharedblocks.publish.inc
Validates a shared block security token.

File

./sharedblocks.publish.inc, line 33
Publish block page callbacks for the sharedblocks module.

Code

function sharedblocks_get_token($module, $delta) {
  return drupal_hmac_base64("{$module}:{$delta}", drupal_get_private_key() . drupal_get_hash_salt());
}