diff --git a/web/add/db/index.php b/web/add/db/index.php index 13517852..e85dab13 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -49,6 +49,11 @@ if (!empty($_POST['ok'])) { $v_charset = $_POST['v_charset']; $v_db_email = $_POST['v_db_email']; + // Check password length + if (empty($_SESSION['error_msg'])) { + $pw_len = strlen($_POST['v_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg); + } if (empty($_SESSION['error_msg'])) { // Add Database diff --git a/web/add/user/index.php b/web/add/user/index.php index 044f5bd7..2cc773df 100644 --- a/web/add/user/index.php +++ b/web/add/user/index.php @@ -53,6 +53,12 @@ if ($_SESSION['user'] == 'admin') { $_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg); } + // Check password length + if (empty($_SESSION['error_msg'])) { + $pw_len = strlen($_POST['v_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg); + } + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-user ".$v_username." ".$v_password." ".$v_email." ".$v_package." ".$v_fname." ".$v_lname, $output, $return_var); if ($return_var != 0) { diff --git a/web/add/web/index.php b/web/add/web/index.php index 10195ac6..921fae46 100644 --- a/web/add/web/index.php +++ b/web/add/web/index.php @@ -70,6 +70,22 @@ $v_ftp_email = $panel[$user]['CONTACT']; $_SESSION['error_msg'] = _('Please enter valid email address.'); } + // Check ftp password length + if (empty($_SESSION['error_msg'])) { + if (!empty($_POST['v_ftp_user']) { + $pw_len = strlen($_POST['v_ftp_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg); + } + } + + // Check stats password length + if (empty($_SESSION['error_msg'])) { + if (!empty($_POST['v_stats_user']) { + $pw_len = strlen($_POST['v_stats_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg); + } + } + // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { diff --git a/web/inc/i18n/en.php b/web/inc/i18n/en.php index 80b1e15c..5eb79077 100644 --- a/web/inc/i18n/en.php +++ b/web/inc/i18n/en.php @@ -362,6 +362,7 @@ $LANG['en'] = array( 'Passwords not match' => 'Passwords not match', 'Please enter valid email address.' => 'Please enter valid email address.', 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', + 'Password is too short.' => 'Password is too short (minimum is 6 characters)', 'Error code:' => 'Error code: %s', 'SERVICE_ACTION_FAILED' => '"%s" "%s" failed', 'IP address is in use' => 'IP address is in use', diff --git a/web/inc/i18n/es.php b/web/inc/i18n/es.php index d9f5af4f..54f52bab 100644 --- a/web/inc/i18n/es.php +++ b/web/inc/i18n/es.php @@ -361,6 +361,7 @@ $LANG['es'] = array( 'Passwords not match' => 'Las contraseñas no coinciden', 'Please enter valid email address.' => 'Por favor ingrese un correo válido.', 'Field "%s" can not be blank.' => 'El campo "%s" no puede estar en blanco.', + 'Password is too short.' => "La contraseña es demasiado corta (mínima es de 6 caracteres)", 'Error code:' => 'Código de Error:', 'SERVICE_ACTION_FAILED' => '"%s" "%s" fallo', 'IP address is in use' => 'La IP esta en uso', diff --git a/web/inc/i18n/ru.php b/web/inc/i18n/ru.php index be294878..e7df285e 100644 --- a/web/inc/i18n/ru.php +++ b/web/inc/i18n/ru.php @@ -363,6 +363,7 @@ $LANG['ru'] = array( 'Passwords not match' => 'Пароли не совпадают', 'Please enter valid email address.' => 'Пожалуйста, введите реальный email адрес.', 'Field "%s" can not be blank.' => 'Поле "%s" не может быть пустым.', + 'Password is too short.' => 'Пароль слишком короткий. Используйте не менее 6 символов.', 'Error code:' => 'Код ошибки: %s', 'SERVICE_ACTION_FAILED' => 'Не удалось "%s" "%s"', 'IP address is in use' => 'IP адрес используется', diff --git a/web/inc/i18n/ua.php b/web/inc/i18n/ua.php index 5aae2199..6350b476 100644 --- a/web/inc/i18n/ua.php +++ b/web/inc/i18n/ua.php @@ -363,6 +363,7 @@ $LANG['ua'] = array( 'Passwords not match' => 'Паролі не збігаються', 'Please enter valid email address.' => 'Будь-ласка, введіть реальну email адресу.', 'Field "%s" can not be blank.' => 'Поле "%s" не може бути пустим.', + 'Password is too short.' => 'Пароль занадто короткий. Використовуйте не менше 6 символів.', 'Error code:' => 'Код помилки: %s', 'SERVICE_ACTION_FAILED' => 'Не вдалось "%s" "%s"', 'IP address is in use' => 'IP адреса використовується',