Fix #1487
Add a password length check and display an error, if the password is not at least 6 signs. Add html5 tag "minlength" to password input
This commit is contained in:
parent
6cce49f0be
commit
26ac249c9e
1 changed files with 12 additions and 0 deletions
12
install.php
12
install.php
|
@ -295,6 +295,13 @@ function install($adminPassword, $timezone)
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check the length of the password
|
||||||
|
if (Text::length($adminPassword)<PASSWORD_LENGTH) {
|
||||||
|
$errorText = sprintf('The password must have a length of minimum %s signs.', PASSWORD_LENGTH);
|
||||||
|
error_log('[ERROR] ' . $errorText, 0);
|
||||||
|
redirect(sprintf('install.php?language=%s&error=PASSWORD_LENGTH', $_GET['language'] ?? 'en_EN'));
|
||||||
|
}
|
||||||
|
|
||||||
$currentDate = Date::current(DB_DATE_FORMAT);
|
$currentDate = Date::current(DB_DATE_FORMAT);
|
||||||
|
|
||||||
// Load the examples pages
|
// Load the examples pages
|
||||||
|
@ -746,6 +753,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-0">
|
<div class="form-group mb-0">
|
||||||
|
<?php if(isset($_GET['error']) && 'PASSWORD_LENGTH' === $_GET['error']) { ?>
|
||||||
|
<div class="text-danger">
|
||||||
|
<?php $L->p('The password needs to be contain at least ' . PASSWORD_LENGTH . ' signs') ?>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="<?php $L->p('Password') ?>">
|
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="<?php $L->p('Password') ?>">
|
||||||
</div>
|
</div>
|
||||||
<div id="jsshowPassword" style="cursor: pointer;" class="text-center pt-0 text-muted"><?php $L->p('Show password') ?></div>
|
<div id="jsshowPassword" style="cursor: pointer;" class="text-center pt-0 text-muted"><?php $L->p('Show password') ?></div>
|
||||||
|
|
Loading…
Reference in a new issue