function prod_check_generate_key in Production check & Production monitor 7
Same name and namespace in other branches
- 6 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 745
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;
}