drupal_get_private_key

Versions
4.6 – 7
drupal_get_private_key()

Ensure the private key variable used to generate tokens is set.

Return value

The private key.

▾ 2 functions call drupal_get_private_key()

drupal_get_token in includes/common.inc
Generate a token based on $value, the current user session and private key.
_update_process_fetch_task in modules/update/update.fetch.inc
Process a task to fetch available update data for a single project.

Code

includes/common.inc, line 4425

<?php
function drupal_get_private_key() {
  if (!($key = variable_get('drupal_private_key', 0))) {
    $key = md5(drupal_random_bytes(64));
    variable_set('drupal_private_key', $key);
  }
  return $key;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.