Alert when the password lenght is less than 6 characters

This commit is contained in:
Diego Najar 2018-11-11 20:27:13 -03:00
parent 026d71e239
commit c7cec45039
2 changed files with 12 additions and 3 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ bl-themes/massively
bl-themes/hyperspace
bl-themes/striped
bl-themes/log
bl-themes/micro

View File

@ -423,7 +423,6 @@ function install($adminPassword, $timezone)
'tokenAuthTTL'=>'2009-03-15 14:00',
'twitter'=>'',
'facebook'=>'',
'googlePlus'=>'',
'instagram'=>'',
'codepen'=>'',
'linkedin'=>'',
@ -565,8 +564,13 @@ if (isset($_GET['demo'])) {
// Install by POST method
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
install($_POST['password'], $_POST['timezone']);
redirect(HTML_PATH_ROOT);
if (Text::length($_POST['password'])<6) {
$errorText = $L->g('password-must-be-at-least-6-characters-long');
error_log('[ERROR] '.$errorText, 0);
} else {
install($_POST['password'], $_POST['timezone']);
redirect(HTML_PATH_ROOT);
}
}
?>
@ -615,6 +619,10 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
?>
<p><?php echo $L->get('choose-a-password-for-the-user-admin') ?></p>
<?php if (!empty($errorText)): ?>
<div class="alert alert-danger"><?php echo $errorText ?></div>
<?php endif ?>
<form id="jsformInstaller" method="post" action="" autocomplete="off">
<input type="hidden" name="timezone" id="jstimezone" value="UTC">