Browse Source

Add demo mode verification checks to backend scripts

Kristan Kenney 6 years ago
parent
commit
782c155efe
7 changed files with 16 additions and 5 deletions
  1. 2 1
      bin/v-add-cron-job
  2. 2 1
      bin/v-add-database
  3. 3 1
      bin/v-add-dns-domain
  4. 3 1
      bin/v-add-mail-account
  5. 2 0
      bin/v-add-mail-domain
  6. 2 1
      bin/v-add-user
  7. 2 0
      bin/v-add-web-domain

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

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

+ 2 - 1
bin/v-add-database

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

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

@@ -36,7 +36,6 @@ source $HESTIA/conf/hestia.conf
 format_domain
 format_domain
 format_domain_idn
 format_domain_idn
 
 
-
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -51,6 +50,9 @@ is_package_full 'DNS_DOMAINS'
 template=$(get_user_value '$DNS_TEMPLATE')
 template=$(get_user_value '$DNS_TEMPLATE')
 is_dns_template_valid $template
 is_dns_template_valid $template
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 if [ ! -z "$ns1" ]; then
 if [ ! -z "$ns1" ]; then
     ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
     ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
     is_format_valid 'ns1'
     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:]')
     account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
 fi
 fi
 
 
-
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -46,6 +45,9 @@ is_mail_new "$account"
 is_password_valid
 is_password_valid
 
 
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

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

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

+ 2 - 1
bin/v-add-user

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

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

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