You are here

function prod_check_generate_key in Production check & Production monitor 6

Same name and namespace in other branches
  1. 7 includes/prod_check.admin.inc \prod_check_generate_key()

Generate default key if none is present.

1 call to prod_check_generate_key()
prod_check_settings_form in includes/prod_check.admin.inc
Build settings form.

File

includes/prod_check.admin.inc, line 764

Code

function prod_check_generate_key($length = 25) {
  $chars = 'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ+-*#&@!?';
  $size = strlen($chars);
  $key = '';
  for ($i = 0; $i < $length; $i++) {
    $key .= $chars[rand(0, $size - 1)];
  }
  return $key;
}