Skip to content

Commit 878d239

Browse files
committed
password length verification
1 parent b82899e commit 878d239

File tree

7 files changed

+31
-0
lines changed

7 files changed

+31
-0
lines changed

web/add/db/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
$v_charset = $_POST['v_charset'];
5050
$v_db_email = $_POST['v_db_email'];
5151

52+
// Check password length
53+
if (empty($_SESSION['error_msg'])) {
54+
$pw_len = strlen($_POST['v_password']);
55+
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
56+
}
5257

5358
if (empty($_SESSION['error_msg'])) {
5459
// Add Database

web/add/user/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
5454
}
5555

56+
// Check password length
57+
if (empty($_SESSION['error_msg'])) {
58+
$pw_len = strlen($_POST['v_password']);
59+
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
60+
}
61+
5662
if (empty($_SESSION['error_msg'])) {
5763
exec (VESTA_CMD."v-add-user ".$v_username." ".$v_password." ".$v_email." ".$v_package." ".$v_fname." ".$v_lname, $output, $return_var);
5864
if ($return_var != 0) {

web/add/web/index.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@
7070
$_SESSION['error_msg'] = _('Please enter valid email address.');
7171
}
7272

73+
// Check ftp password length
74+
if (empty($_SESSION['error_msg'])) {
75+
if (!empty($_POST['v_ftp_user']) {
76+
$pw_len = strlen($_POST['v_ftp_password']);
77+
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
78+
}
79+
}
80+
81+
// Check stats password length
82+
if (empty($_SESSION['error_msg'])) {
83+
if (!empty($_POST['v_stats_user']) {
84+
$pw_len = strlen($_POST['v_stats_password']);
85+
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
86+
}
87+
}
88+
7389
// Check for errors
7490
if (!empty($errors[0])) {
7591
foreach ($errors as $i => $error) {

web/inc/i18n/en.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362
'Passwords not match' => 'Passwords not match',
363363
'Please enter valid email address.' => 'Please enter valid email address.',
364364
'Field "%s" can not be blank.' => 'Field "%s" can not be blank.',
365+
'Password is too short.' => 'Password is too short (minimum is 6 characters)',
365366
'Error code:' => 'Error code: %s',
366367
'SERVICE_ACTION_FAILED' => '"%s" "%s" failed',
367368
'IP address is in use' => 'IP address is in use',

web/inc/i18n/es.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@
361361
'Passwords not match' => 'Las contraseñas no coinciden',
362362
'Please enter valid email address.' => 'Por favor ingrese un correo válido.',
363363
'Field "%s" can not be blank.' => 'El campo "%s" no puede estar en blanco.',
364+
'Password is too short.' => "La contraseña es demasiado corta (mínima es de 6 caracteres)",
364365
'Error code:' => 'Código de Error:',
365366
'SERVICE_ACTION_FAILED' => '"%s" "%s" fallo',
366367
'IP address is in use' => 'La IP esta en uso',

web/inc/i18n/ru.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
'Passwords not match' => 'Пароли не совпадают',
364364
'Please enter valid email address.' => 'Пожалуйста, введите реальный email адрес.',
365365
'Field "%s" can not be blank.' => 'Поле "%s" не может быть пустым.',
366+
'Password is too short.' => 'Пароль слишком короткий. Используйте не менее 6 символов.',
366367
'Error code:' => 'Код ошибки: %s',
367368
'SERVICE_ACTION_FAILED' => 'Не удалось "%s" "%s"',
368369
'IP address is in use' => 'IP адрес используется',

web/inc/i18n/ua.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
'Passwords not match' => 'Паролі не збігаються',
364364
'Please enter valid email address.' => 'Будь-ласка, введіть реальну email адресу.',
365365
'Field "%s" can not be blank.' => 'Поле "%s" не може бути пустим.',
366+
'Password is too short.' => 'Пароль занадто короткий. Використовуйте не менше 6 символів.',
366367
'Error code:' => 'Код помилки: %s',
367368
'SERVICE_ACTION_FAILED' => 'Не вдалось "%s" "%s"',
368369
'IP address is in use' => 'IP адреса використовується',

0 commit comments

Comments
 (0)