File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ check_args '2' "$#" 'USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]'
5252is_format_valid ' user' ' domain' ' aliases' ' ip' ' proxy_ext'
5353is_object_valid ' user' ' USER' " $user "
5454is_object_unsuspended ' user' ' USER' " $user "
55- is_package_full ' WEB_DOMAINS' ' WEB_ALIASES'
55+ is_package_full ' WEB_DOMAINS'
56+
57+ if [ " $aliases " != " none" ]; then
58+ ALIAS=$aliases
59+ is_package_full ' WEB_ALIASES'
60+ fi
5661
5762if [ " $( $BIN /v-list-web-domain $user $domain_utf plain | cut -f 1) " != " $domain " ]; then
5863 is_domain_new ' web' " $domain_utf ,$aliases "
Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ is_object_unsuspended 'user' 'USER' "$user"
5353is_object_valid ' web' ' DOMAIN' " $domain "
5454is_object_unsuspended ' web' ' DOMAIN' " $domain "
5555is_domain_new ' web' " $aliases "
56- is_package_full ' WEB_ALIASES'
57-
5856is_base_domain_owner " $aliases "
5957
6058# Perform verification if read-only mode is enabled
@@ -65,7 +63,6 @@ check_hestia_demo_mode
6563# Action #
6664# ----------------------------------------------------------#
6765
68- # Parsing domain values
6966get_domain_values ' web'
7067
7168# Preparing domain values for the template substitution
7774fi
7875prepare_web_domain_values
7976
77+ is_package_full ' WEB_ALIASES'
78+
8079# Rebuilding vhost
8180del_web_config " $WEB_SYSTEM " " $TPL .tpl"
8281add_web_config " $WEB_SYSTEM " " $TPL .tpl"
Original file line number Diff line number Diff line change @@ -179,8 +179,15 @@ is_package_full() {
179179 esac
180180 used=$( echo " $used " | cut -f 1 -d \ )
181181 limit=$( grep " ^$1 =" $USER_DATA /user.conf | cut -f 2 -d \' )
182- if [ " $limit " != ' unlimited' ] && [[ " $used " -ge " $limit " ]]; then
183- check_result $E_LIMIT " $1 limit is reached :: upgrade user package"
182+ if [ " $1 " = WEB_ALIASES ]; then
183+ # Used is always calculated with the new alias added
184+ if [ " $limit " != ' unlimited' ] && [[ " $used " -gt " $limit " ]]; then
185+ check_result $E_LIMIT " $1 limit is reached :: upgrade user package"
186+ fi
187+ else
188+ if [ " $limit " != ' unlimited' ] && [[ " $used " -ge " $limit " ]]; then
189+ check_result $E_LIMIT " $1 limit is reached :: upgrade user package"
190+ fi
184191 fi
185192}
186193
You can’t perform that action at this time.
0 commit comments