v_delete_user_reports 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # info: delete user reports
  3. # options: user
  4. #
  5. # The script for disabling reports on cron tasks and administrative
  6. # notifications.
  7. #----------------------------------------------------------#
  8. # Variable&Function #
  9. #----------------------------------------------------------#
  10. # Argument defenition
  11. user=$1
  12. # Importing variables
  13. source $VESTA/conf/vars.conf
  14. source $V_CONF/vesta.conf
  15. source $V_FUNC/shared.func
  16. source $V_FUNC/cron.func
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. # Checking arg number
  21. check_args '1' "$#" 'user'
  22. # Checking argument format
  23. format_validation 'user'
  24. # Checking user
  25. is_user_valid
  26. # Checking user is active
  27. is_user_suspended
  28. #----------------------------------------------------------#
  29. # Action #
  30. #----------------------------------------------------------#
  31. # Changing user report value
  32. update_user_value "$user" '$REPORTS' 'no'
  33. # Sync system cron with user
  34. sync_cron_jobs
  35. #----------------------------------------------------------#
  36. # Vesta #
  37. #----------------------------------------------------------#
  38. # Adding task to the vesta pipe
  39. restart_schedule 'cron'
  40. # Logging
  41. log_history "$V_EVENT" "v_add_user_reports $user"
  42. log_event 'system' "$V_EVENT"
  43. exit