Skip to content

Commit f5e82b7

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/user-roles' into main
2 parents 96817a9 + 497ae08 commit f5e82b7

File tree

549 files changed

+16435
-17292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+16435
-17292
lines changed

bin/v-add-cron-hestia-autoupdate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ $BIN/v-restart-cron
9494
check_result $? "Cron restart failed" >/dev/null
9595

9696
# Logging
97-
log_history "enabled automatic updates"
97+
$BIN/v-log-action "system" "Info" "Updates" "Automatic updates enabled."
9898
log_event "$OK" "$ARGUMENTS"
9999

100100
exit

bin/v-add-cron-job

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ sync_cron_jobs
8484
increase_user_value $user '$U_CRON_JOBS'
8585

8686
# Restarting crond
87-
$BIN/v-restart-cron
87+
$BIN/v-restart-cron $restart
8888
check_result $? "Cron restart failed" >/dev/null
8989

9090
# Logging
91-
log_history "added cron job $job"
91+
$BIN/v-log-action "$user" "Info" "Cron Jobs" "Cron job added (ID: $job, Command: $command)"
9292
log_event "$OK" "$ARGUMENTS"
9393

9494
exit

bin/v-add-cron-reports

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $BIN/v-restart-cron
5656
check_result $? "Cron restart failed" >/dev/null
5757

5858
# Logging
59-
log_history "enabled cron reporting"
59+
$BIN/v-log-action "$user" "Info" "Cron Jobs" "Cron job notifications and reporting enabled."
6060
log_event "$OK" "$ARGUMENTS"
6161

6262
exit

bin/v-add-database

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ increase_dbhost_values
9696
increase_user_value "$user" '$U_DATABASES'
9797

9898
# Logging
99-
log_history "added $type database $database"
99+
$BIN/v-log-action "$user" "Info" "Databases" "Added new database $database ($type)."
100100
log_event "$OK" "$ARGUMENTS"
101101

102102
exit

bin/v-add-database-host

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ else
133133
fi
134134

135135
# Logging
136+
$BIN/v-log-action "system" "Info" "Database" "Added external $type database server ($host) to the system."
136137
log_event "$OK" "$ARGUMENTS"
137138

138139
exit

bin/v-add-database-temp-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ echo '{
7878
#----------------------------------------------------------#
7979
# Hestia #
8080
#----------------------------------------------------------#
81-
log_history "Granted $dbuser access to $database"
8281

8382
# Logging
83+
$BIN/v-log-action "$user" "Info" "Databases" "Granted user $dbuser access to database $database."
8484
log_event "$OK" "$ARGUMENTS"
8585
exit

bin/v-add-dns-domain

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ if [ "$($BIN/v-list-dns-domain $user $domain_idn plain |cut -f 1) " != "$domain"
6161
else
6262
is_domain_new 'dns' "$domain"
6363
fi
64+
if [ -z "$(is_ip_format_valid $domain)" ]; then
65+
echo "Error: Invalid domain format. IP address detected as input."
66+
exit 1
67+
fi
6468

6569
is_package_full 'DNS_DOMAINS'
6670
template=$(get_user_value '$DNS_TEMPLATE')
@@ -221,7 +225,7 @@ $BIN/v-restart-dns $restart
221225
check_result $? "DNS restart failed"
222226

223227
# Logging
224-
log_history "added dns domain $domain"
228+
$BIN/v-log-action "$user" "Info" "DNS" "Added new DNS domain (Name: $domain)."
225229
log_event "$OK" "$ARGUMENTS"
226230

227231
exit

bin/v-add-dns-record

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ priority=$6
2727
id=$7
2828
restart=$8
2929
ttl=$9
30+
quiet=${10}
3031

3132
if [ -z "$priority" ]; then
3233
priority=10
@@ -152,7 +153,9 @@ $BIN/v-restart-dns $restart
152153
check_result $? $E_RESTART 'dns failed to restart'
153154

154155
# Logging
155-
log_history "added $rtype dns record $record for $domain"
156+
if [ "$quiet" != "yes" ]; then
157+
$BIN/v-log-action "$user" "Info" "DNS" "Added DNS record (Type: $rtype, Value: $record, Domain: $domain)."
158+
fi
156159
log_event "$OK" "$ARGUMENTS"
157160

158161
exit

bin/v-add-fastcgi-cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ if [ "$restart" = "yes" ]; then
127127
fi
128128

129129
# Logging
130-
log_history "Enabled FastCGI cache for $domain"
130+
$BIN/v-log-action "$user" "Info" "Web" "FastCGI cache enabled (Domain: $domain)."
131131
log_event "$OK" "$ARGUMENTS"
132132

133133
exit

bin/v-add-firewall-ban

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ chmod 660 $conf
9191
#----------------------------------------------------------#
9292

9393
# Logging
94+
$BIN/v-log-action "system" "Warning" "Firewall" "Banned IP address $ip."
9495
log_event "$OK" "$ARGUMENTS"
9596

9697
exit

0 commit comments

Comments
 (0)