You are here

function webform_protected_downloads_create_hash in Webform Protected Downloads 6

Same name and namespace in other branches
  1. 7 webform_protected_downloads.module \webform_protected_downloads_create_hash()

Create a hash that users can use to access the download page

Parameters

string $row :

Return value

void

2 calls to webform_protected_downloads_create_hash()
webform_protected_downloads_configuration_form_submit in ./webform_protected_downloads.form.inc
Implementation of hook_submit().
webform_protected_downloads_process_submissions in ./webform_protected_downloads.module
Process unprocessed webform submissions

File

./webform_protected_downloads.module, line 684
This file contains hook declarations and functions for the Webform Protected Downloads module.

Code

function webform_protected_downloads_create_hash() {
  $seed = 'JvKnrQWPsThuJteNQAuH';
  $hash = sha1(uniqid($seed . mt_rand(), true));
  $hash = substr($hash, 0, 32);
  return $hash;
}