Browse Source

Add additional checks for demo mode

Kristan Kenney 6 years ago
parent
commit
6127cd46cc

+ 3 - 0
bin/v-change-sys-release

@@ -19,6 +19,9 @@ branch=$1
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 3 - 0
bin/v-change-sys-service-config

@@ -29,6 +29,9 @@ if [ ! -e "$src" ]; then
     check_result "$E_NOTEXIST" "$src config doesn't exist"
     check_result "$E_NOTEXIST" "$src config doesn't exist"
 fi
 fi
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 2 - 1
bin/v-change-user-password

@@ -17,7 +17,6 @@ password=$2; HIDE=2
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
-
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -28,6 +27,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_password_valid
 is_password_valid
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 2 - 1
bin/v-change-user-shell

@@ -17,7 +17,6 @@ shell=$2
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
-
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -27,6 +26,8 @@ is_format_valid 'user' 'shell'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 2 - 0
bin/v-delete-cron-job

@@ -30,6 +30,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'cron' 'JOB' "$job"
 is_object_valid 'cron' 'JOB' "$job"
 is_object_unsuspended 'cron' 'JOB' "$job"
 is_object_unsuspended 'cron' 'JOB' "$job"
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 2 - 0
bin/v-delete-database

@@ -32,6 +32,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'db' 'DB' "$database"
 is_object_valid 'db' 'DB' "$database"
 is_object_unsuspended 'db' 'DB' "$database"
 is_object_unsuspended 'db' 'DB' "$database"
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 2 - 0
bin/v-delete-firewall-rule

@@ -29,6 +29,8 @@ is_format_valid 'rule'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
 is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 3 - 0
bin/v-delete-mail-domain

@@ -38,6 +38,9 @@ is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 
 
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 2 - 0
bin/v-delete-sys-ip

@@ -30,6 +30,8 @@ is_ip_valid "$ip"
 is_ip_key_empty '$U_WEB_DOMAINS'
 is_ip_key_empty '$U_WEB_DOMAINS'
 is_ip_key_empty '$U_SYS_USERS'
 is_ip_key_empty '$U_SYS_USERS'
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 3 - 0
bin/v-delete-user

@@ -34,6 +34,9 @@ if [ "$user" = 'admin' ]; then
     exit
     exit
 fi
 fi
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 3 - 0
bin/v-delete-user-log

@@ -15,6 +15,9 @@ date=$(date "+%F %T")
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 3 - 0
bin/v-delete-user-package

@@ -37,6 +37,9 @@ is_package_valid
 is_package_in_use
 is_package_in_use
 
 
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#

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

@@ -42,6 +42,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
 is_object_valid 'web' 'DOMAIN' "$domain"
 is_object_unsuspended 'web' 'DOMAIN' "$domain"
 is_object_unsuspended 'web' 'DOMAIN' "$domain"
 
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #