password length verification

This commit is contained in:
Serghey Rodin 2013-03-31 19:19:59 +03:00
parent b82899e557
commit 878d239538
7 changed files with 31 additions and 0 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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) {