v-change-user-template 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # info: change user default template
  3. # options: user template
  4. #
  5. # The function changes default user web template.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. user=$1
  11. template=$2
  12. # Includes
  13. source $VESTA/conf/vesta.conf
  14. source $VESTA/func/main.sh
  15. source $VESTA/func/domain.sh
  16. #----------------------------------------------------------#
  17. # Verifications #
  18. #----------------------------------------------------------#
  19. check_args '2' "$#" 'user template'
  20. validate_format 'user' 'template'
  21. is_object_valid 'user' 'USER' "$user"
  22. is_object_unsuspended 'user' 'USER' "$user"
  23. is_apache_template_valid
  24. #----------------------------------------------------------#
  25. # Action #
  26. #----------------------------------------------------------#
  27. #----------------------------------------------------------#
  28. # Vesta #
  29. #----------------------------------------------------------#
  30. # Changing user shell
  31. update_user_value "$user" '$TEMPLATE' "$template"
  32. # Logging
  33. log_history "changed $user template to $template" '' 'admin'
  34. log_event "$OK" "$EVENT"
  35. exit