function drupal_get_private_key
7.x common.inc | drupal_get_private_key() |
6.x common.inc | drupal_get_private_key() |
Ensure the private key variable used to generate tokens is set.
Return value
The private key.
2 calls to drupal_get_private_key()
- drupal_get_token in drupal-6.x/
includes/ common.inc - Generate a token based on $value, the current user session and private key.
- _update_refresh in drupal-6.x/
modules/ update/ update.fetch.inc - Fetch project info via XML from a central server.
File
- drupal-6.x/
includes/ common.inc, line 2635 - Common functions that many Drupal modules will need to reference.
Code
function drupal_get_private_key() {
if (!($key = variable_get('drupal_private_key', 0))) {
$key = drupal_random_key();
variable_set('drupal_private_key', $key);
}
return $key;
}