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/hyperspace
bl-themes/striped bl-themes/striped
bl-themes/log bl-themes/log
bl-themes/micro

View File

@ -423,7 +423,6 @@ function install($adminPassword, $timezone)
'tokenAuthTTL'=>'2009-03-15 14:00', 'tokenAuthTTL'=>'2009-03-15 14:00',
'twitter'=>'', 'twitter'=>'',
'facebook'=>'', 'facebook'=>'',
'googlePlus'=>'',
'instagram'=>'', 'instagram'=>'',
'codepen'=>'', 'codepen'=>'',
'linkedin'=>'', 'linkedin'=>'',
@ -565,9 +564,14 @@ if (isset($_GET['demo'])) {
// Install by POST method // Install by POST method
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['REQUEST_METHOD'] == 'POST') {
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']); install($_POST['password'], $_POST['timezone']);
redirect(HTML_PATH_ROOT); redirect(HTML_PATH_ROOT);
} }
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -615,6 +619,10 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
?> ?>
<p><?php echo $L->get('choose-a-password-for-the-user-admin') ?></p> <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"> <form id="jsformInstaller" method="post" action="" autocomplete="off">
<input type="hidden" name="timezone" id="jstimezone" value="UTC"> <input type="hidden" name="timezone" id="jstimezone" value="UTC">