Skip to content
Snippets Groups Projects
Commit be0c7116 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use system.min/max_password_length properties

parent 66191a24
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,10 @@
<?xjs write(locale.strings.page_register.input_password); ?>
</label>
<span title="<?xjs write(locale.strings.page_register.label_field_required); ?>" class="glyphicon glyphicon-asterisk"></span>
<input type="password" data-minlength="4" maxlength="8" class="form-control" id="password1" name="password1" placeholder="<?xjs write(locale.strings.page_register.input_password); ?>" required>
<input type="password" data-minlength="<?xjs write(system.min_password_length) ?>" maxlength="<?xjs write(system.max_password_length) ?>" class="form-control" id="password1" name="password1" placeholder="<?xjs write(locale.strings.page_register.input_password); ?>" required>
<span class="help-block">
<?xjs write(format(locale.strings.page_register.help_text_minimum_characters, settings.minimum_password_length)); ?>,
<?xjs write(format(locale.strings.page_register.help_text_maximum_characters, LEN_PASS)); ?>
<?xjs write(format(locale.strings.page_register.help_text_minimum_characters, system.min_password_length)); ?>,
<?xjs write(format(locale.strings.page_register.help_text_maximum_characters, system.max_password_length)); ?>
</span>
</div>
<div class="form-group">
......@@ -78,7 +78,7 @@
<?xjs write(locale.strings.page_register.input_password_confirm); ?>
</label>
<span title="<?xjs write(locale.strings.page_register.label_field_required); ?>" class="glyphicon glyphicon-asterisk"></span>
<input type="password" data-minlength="4" maxlength="8" class="form-control" id="password2" name="password2" placeholder="<?xjs write(locale.strings.page_register.input_password_confirm); ?>" data-match="#password1" required>
<input type="password" data-minlength="<?xjs write(system.min_password_length) ?>" maxlength="<?xjs write(system.max_password_length) ?>" class="form-control" id="password2" name="password2" placeholder="<?xjs write(locale.strings.page_register.input_password_confirm); ?>" data-match="#password1" required>
</div>
<div class="form-group">
......
......@@ -101,8 +101,8 @@ if (!valid_param('alias', MIN_ALIAS, LEN_ALIAS) || !system.check_name(clean_para
if (!Request.has_param('password1') || !Request.has_param('password2') || clean_param('password1') != clean_param('password2')) {
reply.errors.push(locale.strings.api_register.error_password_mismatch);
} else if (!in_range(clean_param('password1').length, settings.minimum_password_length, LEN_PASS)) {
reply.errors.push(format(locale.strings.api_register.error_password_length, settings.minimum_password_length, LEN_PASS));
} else if (!in_range(clean_param('password1').length, system.min_password_length, system.max_password_length)) {
reply.errors.push(format(locale.strings.api_register.error_password_length, system.min_password_length, system.max_password_length));
} else {
prepUser.password = clean_param('password1');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment