Quellcode durchsuchen

password length verification

Serghey Rodin vor 13 Jahren
Ursprung
Commit
878d239538
7 geänderte Dateien mit 31 neuen und 0 gelöschten Zeilen
  1. 5 0
      web/add/db/index.php
  2. 6 0
      web/add/user/index.php
  3. 16 0
      web/add/web/index.php
  4. 1 0
      web/inc/i18n/en.php
  5. 1 0
      web/inc/i18n/es.php
  6. 1 0
      web/inc/i18n/ru.php
  7. 1 0
      web/inc/i18n/ua.php

+ 5 - 0
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

+ 6 - 0
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) {

+ 16 - 0
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) {

+ 1 - 0
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',

+ 1 - 0
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',

+ 1 - 0
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 адрес используется',

+ 1 - 0
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 адреса використовується',