Skip to content

Commit 18f8ad5

Browse files
committed
Check Hestia user exists before appending to history file
1 parent c297e33 commit 18f8ad5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bin/v-delete-web-php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fi
8484
#----------------------------------------------------------#
8585

8686
# Logging
87-
log_history "removed php $version"
87+
log_history "removed php $version" '' 'admin'
8888
log_event "$OK" "$ARGUMENTS"
8989

9090
exit

func/main.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ log_history() {
7878
cmd=$1
7979
undo=${2-no}
8080
log_user=${3-$user}
81+
82+
if ! $BIN/v-list-user "$log_user" >/dev/null; then
83+
return $E_NOTEXIST
84+
fi
85+
8186
log=$HESTIA/data/users/$log_user/history.log
8287
touch $log
8388
if [ '99' -lt "$(wc -l $log |cut -f 1 -d ' ')" ]; then

0 commit comments

Comments
 (0)