Skip to content

Commit 782c155

Browse files
author
Kristan Kenney
committed
Add demo mode verification checks to backend scripts
1 parent bec38b4 commit 782c155

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

bin/v-add-cron-job

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ source $HESTIA/conf/hestia.conf
2727

2828
HIDE=7
2929

30-
3130
#----------------------------------------------------------#
3231
# Verifications #
3332
#----------------------------------------------------------#
@@ -42,6 +41,8 @@ get_next_cronjob
4241
is_format_valid 'job'
4342
is_object_new 'cron' 'JOB' "$job"
4443

44+
# Perform verification if read-only mode is enabled
45+
check_hestia_demo_mode
4546

4647
#----------------------------------------------------------#
4748
# Action #

bin/v-add-database

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ source $HESTIA/func/main.sh
3030
source $HESTIA/func/db.sh
3131
source $HESTIA/conf/hestia.conf
3232

33-
3433
#----------------------------------------------------------#
3534
# Verifications #
3635
#----------------------------------------------------------#
@@ -50,6 +49,8 @@ is_package_full 'DATABASES'
5049
is_password_valid
5150
dbpass="$password"
5251

52+
# Perform verification if read-only mode is enabled
53+
check_hestia_demo_mode
5354

5455
#----------------------------------------------------------#
5556
# Action #

bin/v-add-dns-domain

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ source $HESTIA/conf/hestia.conf
3636
format_domain
3737
format_domain_idn
3838

39-
4039
#----------------------------------------------------------#
4140
# Verifications #
4241
#----------------------------------------------------------#
@@ -51,6 +50,9 @@ is_package_full 'DNS_DOMAINS'
5150
template=$(get_user_value '$DNS_TEMPLATE')
5251
is_dns_template_valid $template
5352

53+
# Perform verification if read-only mode is enabled
54+
check_hestia_demo_mode
55+
5456
if [ ! -z "$ns1" ]; then
5557
ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
5658
is_format_valid 'ns1'

bin/v-add-mail-account

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ if [[ "$account" =~ [[:upper:]] ]]; then
2626
account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
2727
fi
2828

29-
3029
#----------------------------------------------------------#
3130
# Verifications #
3231
#----------------------------------------------------------#
@@ -46,6 +45,9 @@ is_mail_new "$account"
4645
is_password_valid
4746

4847

48+
# Perform verification if read-only mode is enabled
49+
check_hestia_demo_mode
50+
4951
#----------------------------------------------------------#
5052
# Action #
5153
#----------------------------------------------------------#

bin/v-add-mail-domain

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ is_domain_new 'mail' "$domain"
4848
is_package_full 'MAIL_DOMAINS'
4949
is_dir_symlink $HOMEDIR/$user/mail
5050

51+
# Perform verification if read-only mode is enabled
52+
check_hestia_demo_mode
5153

5254
#----------------------------------------------------------#
5355
# Action #

bin/v-add-user

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ is_user_free() {
2828
fi
2929
}
3030

31-
3231
#----------------------------------------------------------#
3332
# Verifications #
3433
#----------------------------------------------------------#
@@ -42,6 +41,8 @@ is_user_free "$user"
4241
is_password_valid
4342
is_package_valid
4443

44+
# Perform verification if read-only mode is enabled
45+
check_hestia_demo_mode
4546

4647
#----------------------------------------------------------#
4748
# Action #

bin/v-add-web-domain

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ format_domain
3535
format_domain_idn
3636
format_aliases
3737

38+
# Perform verification if read-only mode is enabled
39+
check_hestia_demo_mode
3840

3941
#----------------------------------------------------------#
4042
# Verifications #

0 commit comments

Comments
 (0)