Skip to content

Commit e960e1d

Browse files
author
Till Brehm
committed
Set the min password length in password generator
1 parent 621f270 commit e960e1d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

interface/web/js/scrigo.js.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,19 @@ function password(minLength, special){
748748
return password;
749749
}
750750

751+
<?php
752+
$min_password_length = 10;
753+
if(isset($server_config_array['misc']['min_password_length'])) {
754+
$min_password_length = $app->functions->intval($server_config_array['misc']['min_password_length']);
755+
}
756+
?>
757+
751758
function generatePassword(passwordFieldID, repeatPasswordFieldID){
752759
var oldPWField = jQuery('#'+passwordFieldID);
753760
var newPWField = oldPWField.clone();
754761
newPWField.attr('type', 'text').attr('id', 'tmp'+passwordFieldID).insertBefore(oldPWField);
755762
oldPWField.remove();
756-
var pword = password(10, false);
763+
var pword = password(<?php echo $min_password_length ?>, false);
757764
jQuery('#'+repeatPasswordFieldID).val(pword);
758765
newPWField.attr('id', passwordFieldID).val(pword).trigger('keyup');
759766
}

0 commit comments

Comments
 (0)