function _node_registration_secret in Node registration 7
Creates a secret (to save in the registration to identify anonymous registrations).
1 call to _node_registration_secret()
- node_registration_form_submit in includes/
node_registration.forms.inc - Submit handler for node_registration_form().
File
- includes/
node_registration.api.inc, line 626 - Registration API functions.
Code
function _node_registration_secret() {
$secret = drupal_hash_base64(uniqid(mt_rand(), TRUE) . drupal_random_bytes(55));
$secret = str_replace(array(
'-',
'_',
), '', $secret);
$secret = substr($secret, 0, 40);
return $secret;
}