You are here

function simplenews_private_key in Simplenews 7.2

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_private_key()
  2. 6.2 simplenews.module \simplenews_private_key()
  3. 6 simplenews.module \simplenews_private_key()
  4. 7 simplenews.module \simplenews_private_key()

Create a 32 character identifier.

2 calls to simplenews_private_key()
simplenews_generate_old_hash in ./simplenews.module
Generate a hash key in the old format.
simplenews_subscriber_load_by_hash in ./simplenews.module
Load a simplenews subscriber using the hash.

File

./simplenews.module, line 2111
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_private_key() {
  $key = variable_get('simplenews_private_key', FALSE);
  if (!$key) {

    //  This will create a 32 character identifier (a 128 bit hex number) that is extremely difficult to predict
    $key = md5(uniqid(rand()));
    variable_set('simplenews_private_key', $key);
  }
  return $key;
}