File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ format_aliases
4242# ----------------------------------------------------------#
4343
4444# Parsing domain values as they are used to get the current alias usage
45- get_domain_values ' web '
45+
4646
4747if [ -z " $aliases " ]; then
4848 check_result $E_INVALID " invalid alias format: empty"
@@ -56,8 +56,6 @@ is_object_unsuspended 'user' 'USER' "$user"
5656is_object_valid ' web' ' DOMAIN' " $domain "
5757is_object_unsuspended ' web' ' DOMAIN' " $domain "
5858is_domain_new ' web' " $aliases "
59- is_package_full ' WEB_ALIASES'
60-
6159is_base_domain_owner " $aliases "
6260
6361# Perform verification if read-only mode is enabled
@@ -68,6 +66,8 @@ check_hestia_demo_mode
6866# Action #
6967# ----------------------------------------------------------#
7068
69+ get_domain_values ' web'
70+
7171# Preparing domain values for the template substitution
7272local_ip=$( get_real_ip $IP )
7373if [ -z " $ALIAS " ]; then
7777fi
7878prepare_web_domain_values
7979
80+ is_package_full ' WEB_ALIASES'
81+
8082# Rebuilding vhost
8183del_web_config " $WEB_SYSTEM " " $TPL .tpl"
8284add_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