Explorar el Código

Merge pull request #1778 from hestiacp/revert-1768-fix/1767-web-alias-limit-broken

Revert "Fix #1767 Limit Web aliases"
Kristan Kenney hace 4 años
padre
commit
e8a962b339
Se han modificado 3 ficheros con 5 adiciones y 8 borrados
  1. 1 4
      bin/v-add-web-domain
  2. 3 3
      bin/v-add-web-domain-alias
  3. 1 1
      func/main.sh

+ 1 - 4
bin/v-add-web-domain

@@ -52,10 +52,7 @@ check_args '2' "$#" 'USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]'
 is_format_valid 'user' 'domain' 'aliases' 'ip' 'proxy_ext'
 is_format_valid 'user' 'domain' 'aliases' 'ip' 'proxy_ext'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
-# Make the new aliases are also counted for when creating a new domain. 
-ALIAS=$aliases
-is_package_full 'WEB_DOMAINS'
-is_package_full 'WEB_ALIASES'
+is_package_full 'WEB_DOMAINS' 'WEB_ALIASES'
 
 
 if [ "$($BIN/v-list-web-domain $user $domain_utf plain |cut -f 1) " != "$domain" ]; then
 if [ "$($BIN/v-list-web-domain $user $domain_utf plain |cut -f 1) " != "$domain" ]; then
     is_domain_new 'web' "$domain_utf,$aliases"
     is_domain_new 'web' "$domain_utf,$aliases"

+ 3 - 3
bin/v-add-web-domain-alias

@@ -41,9 +41,6 @@ format_aliases
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-# Parsing domain values as they are used to get the current alias usage
-get_domain_values 'web'
-
 if [ -z "$aliases" ]; then
 if [ -z "$aliases" ]; then
     check_result $E_INVALID "invalid alias format: empty"
     check_result $E_INVALID "invalid alias format: empty"
 fi
 fi
@@ -68,6 +65,9 @@ check_hestia_demo_mode
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+# Parsing domain values
+get_domain_values 'web'
+
 # Preparing domain values for the template substitution
 # Preparing domain values for the template substitution
 local_ip=$(get_real_ip $IP)
 local_ip=$(get_real_ip $IP)
 if [ -z "$ALIAS" ]; then
 if [ -z "$ALIAS" ]; then

+ 1 - 1
func/main.sh

@@ -169,7 +169,7 @@ is_system_enabled() {
 is_package_full() {
 is_package_full() {
     case "$1" in
     case "$1" in
         WEB_DOMAINS) used=$(wc -l $USER_DATA/web.conf);;
         WEB_DOMAINS) used=$(wc -l $USER_DATA/web.conf);;
-        WEB_ALIASES) used=$(echo $ALIAS |tr ',' '\n' | wc -l );;
+        WEB_ALIASES) used=$(echo $aliases |tr ',' '\n' |wc -l);;
         DNS_DOMAINS) used=$(wc -l $USER_DATA/dns.conf);;
         DNS_DOMAINS) used=$(wc -l $USER_DATA/dns.conf);;
         DNS_RECORDS) used=$(wc -l $USER_DATA/dns/$domain.conf);;
         DNS_RECORDS) used=$(wc -l $USER_DATA/dns/$domain.conf);;
         MAIL_DOMAINS) used=$(wc -l $USER_DATA/mail.conf);;
         MAIL_DOMAINS) used=$(wc -l $USER_DATA/mail.conf);;