Skip to content

Commit c333956

Browse files
committed
check ftp password only if ftp support is enabled
1 parent 4614df5 commit c333956

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

web/add/web/index.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
if (empty($_POST['v_ip'])) $errors[] = __('ip');
1919
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = __('ssl certificate');
2020
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = __('ssl key');
21-
if ((!empty($_POST['v_stats_user'])) && (empty($_POST['v_stats_password']))) $errors[] = __('stats user password');
22-
if ((!empty($_POST['v_ftp_user'])) && (empty($_POST['v_ftp_password']))) $errors[] = __('ftp user password');
23-
2421
if ((!empty($_POST['v_aliases'])) && ($_POST['v_aliases'] != 'www.'.$_POST['v_domain'])) $v_adv = 'yes';
2522
if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes';
2623
if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes';
@@ -67,15 +64,15 @@
6764
}
6865

6966
// Check ftp password length
70-
if (empty($_SESSION['error_msg'])) {
67+
if ((!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
7168
if (!empty($_POST['v_ftp_user'])) {
7269
$pw_len = strlen($_POST['v_ftp_password']);
7370
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
7471
}
7572
}
7673

7774
// Check stats password length
78-
if (empty($_SESSION['error_msg'])) {
75+
if ((!empty($v_stats)) && (empty($_SESSION['error_msg']))) {
7976
if (!empty($_POST['v_stats_user'])) {
8077
$pw_len = strlen($_POST['v_stats_password']);
8178
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);

0 commit comments

Comments
 (0)