Commit e960e1d3 authored by Till Brehm's avatar Till Brehm
Browse files

Set the min password length in password generator

parent 621f2702
...@@ -748,12 +748,19 @@ function password(minLength, special){ ...@@ -748,12 +748,19 @@ function password(minLength, special){
return password; return password;
} }
<?php
$min_password_length = 10;
if(isset($server_config_array['misc']['min_password_length'])) {
$min_password_length = $app->functions->intval($server_config_array['misc']['min_password_length']);
}
?>
function generatePassword(passwordFieldID, repeatPasswordFieldID){ function generatePassword(passwordFieldID, repeatPasswordFieldID){
var oldPWField = jQuery('#'+passwordFieldID); var oldPWField = jQuery('#'+passwordFieldID);
var newPWField = oldPWField.clone(); var newPWField = oldPWField.clone();
newPWField.attr('type', 'text').attr('id', 'tmp'+passwordFieldID).insertBefore(oldPWField); newPWField.attr('type', 'text').attr('id', 'tmp'+passwordFieldID).insertBefore(oldPWField);
oldPWField.remove(); oldPWField.remove();
var pword = password(10, false); var pword = password(<?php echo $min_password_length ?>, false);
jQuery('#'+repeatPasswordFieldID).val(pword); jQuery('#'+repeatPasswordFieldID).val(pword);
newPWField.attr('id', passwordFieldID).val(pword).trigger('keyup'); newPWField.attr('id', passwordFieldID).val(pword).trigger('keyup');
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment