Explorar el Código

Check Hestia user exists before appending to history file

Robert Zollner hace 6 años
padre
commit
18f8ad53a8
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 1 1
      bin/v-delete-web-php
  2. 5 0
      func/main.sh

+ 1 - 1
bin/v-delete-web-php

@@ -84,7 +84,7 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_history "removed php $version"
+log_history "removed php $version" '' 'admin'
 log_event "$OK" "$ARGUMENTS"
 
 exit

+ 5 - 0
func/main.sh

@@ -78,6 +78,11 @@ log_history() {
     cmd=$1
     undo=${2-no}
     log_user=${3-$user}
+
+    if ! $BIN/v-list-user "$log_user" >/dev/null; then
+        return $E_NOTEXIST
+    fi
+
     log=$HESTIA/data/users/$log_user/history.log
     touch $log
     if [ '99' -lt "$(wc -l $log |cut -f 1 -d ' ')" ]; then