Explorar o código

Add demo mode verification checks to backend scripts

Kristan Kenney %!s(int64=6) %!d(string=hai) anos
pai
achega
782c155efe

+ 2 - 1
bin/v-add-cron-job

@@ -27,7 +27,6 @@ source $HESTIA/conf/hestia.conf
 
 HIDE=7
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -42,6 +41,8 @@ get_next_cronjob
 is_format_valid 'job'
 is_object_new 'cron' 'JOB' "$job"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 1
bin/v-add-database

@@ -30,7 +30,6 @@ source $HESTIA/func/main.sh
 source $HESTIA/func/db.sh
 source $HESTIA/conf/hestia.conf
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -50,6 +49,8 @@ is_package_full 'DATABASES'
 is_password_valid
 dbpass="$password"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 1
bin/v-add-dns-domain

@@ -36,7 +36,6 @@ source $HESTIA/conf/hestia.conf
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -51,6 +50,9 @@ is_package_full 'DNS_DOMAINS'
 template=$(get_user_value '$DNS_TEMPLATE')
 is_dns_template_valid $template
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 if [ ! -z "$ns1" ]; then
     ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
     is_format_valid 'ns1'

+ 3 - 1
bin/v-add-mail-account

@@ -26,7 +26,6 @@ if [[ "$account" =~ [[:upper:]] ]]; then
     account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
 fi
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -46,6 +45,9 @@ is_mail_new "$account"
 is_password_valid
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-add-mail-domain

@@ -48,6 +48,8 @@ is_domain_new 'mail' "$domain"
 is_package_full 'MAIL_DOMAINS'
 is_dir_symlink $HOMEDIR/$user/mail
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 1
bin/v-add-user

@@ -28,7 +28,6 @@ is_user_free() {
     fi
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -42,6 +41,8 @@ is_user_free "$user"
 is_password_valid
 is_package_valid
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-add-web-domain

@@ -35,6 +35,8 @@ format_domain
 format_domain_idn
 format_aliases
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #