diff --git a/bin/v-add-web-domain b/bin/v-add-web-domain index 8924d148..87be9570 100755 --- a/bin/v-add-web-domain +++ b/bin/v-add-web-domain @@ -75,6 +75,9 @@ if [ ! -z "$WEB_BACKEND" ]; then fi get_domain_backend_values backend=$(get_user_value '$BACKEND_TEMPLATE') + if [ -z "$backend" ]; then + backend='default' + fi fi # Defining variables for add_config function diff --git a/bin/v-add-web-domain-backend b/bin/v-add-web-domain-backend index 66273e81..7787afbe 100755 --- a/bin/v-add-web-domain-backend +++ b/bin/v-add-web-domain-backend @@ -13,7 +13,7 @@ user=$1 domain=$2 domain_idn=$(idn -t --quiet -a "$domain") -template=$3 +template=${3-default} # Includes source $VESTA/func/main.sh diff --git a/func/main.sh b/func/main.sh index 2dd448f7..94f64e29 100644 --- a/func/main.sh +++ b/func/main.sh @@ -341,7 +341,7 @@ search_objects() { # Get user value get_user_value() { - grep "^${1//$/}=" $USER_DATA/user.conf| cut -f 2 -d \' + grep "^${1//$/}=" $USER_DATA/user.conf |awk -F "'" '{print $2}' } # Update user value in user.conf diff --git a/web/add/firewall/index.php b/web/add/firewall/index.php index 917da067..caae650c 100644 --- a/web/add/firewall/index.php +++ b/web/add/firewall/index.php @@ -26,7 +26,7 @@ if (!empty($_POST['ok'])) { // Check empty fields if (empty($_POST['v_action'])) $errors[] = __('action'); if (empty($_POST['v_protocol'])) $errors[] = __('protocol'); - if (empty($_POST['v_port'])) $errors[] = __('port'); + if (!isset($_POST['v_port'])) $errors[] = __('port'); if (empty($_POST['v_ip'])) $errors[] = __('ip address'); if (!empty($errors[0])) { foreach ($errors as $i => $error) {