You are here

function simplenews_private_key in Simplenews 5

Same name and namespace in other branches
  1. 6.2 simplenews.module \simplenews_private_key()
  2. 6 simplenews.module \simplenews_private_key()
  3. 7.2 simplenews.module \simplenews_private_key()
  4. 7 simplenews.module \simplenews_private_key()
2 calls to simplenews_private_key()
simplenews_confirm_subscription in ./simplenews.module
Menu callback; confirm the user's (un)subscription request when they click on the confirm link in the e-mail footer.
_simplenews_generate_hash in ./simplenews.module
Helper function to generate the hash key used for subscribe/unsubscribe link in e-mail footer.

File

./simplenews.module, line 2707

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;
}