| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- # info: disable webdomain stats authentication support
- # options: user domain
- #
- # The function removes authentication of statistics system. If the script is
- # called without naming a certain user, all users will be removed. After
- # deleting all of them statistics will be accessible for view without an
- # authentication.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- user=$1
- domain=$(idn -t --quiet -u "$2" )
- # Includes
- source $VESTA/conf/vesta.conf
- source $VESTA/func/shared.sh
- source $VESTA/func/domain.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '2' "$#" 'user domain'
- validate_format 'user' 'domain'
- is_system_enabled "$WEB_SYSTEM"
- is_object_valid 'user' 'USER' "$user"
- is_object_unsuspended 'user' 'USER' "$user"
- is_object_valid 'web' 'DOMAIN' "$domain"
- is_object_unsuspended 'web' 'DOMAIN' "$domain"
- is_object_value_exist 'web' 'DOMAIN' "$domain" '$STATS_USER'
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Definining statistic dir
- rm -f $HOMEDIR/$user/web/$domain/stats/.htpasswd
- rm -f $HOMEDIR/$user/web/$domain/stats/.htaccess
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Update config
- update_object_value 'web' 'DOMAIN' "$domain" '$STATS_USER' ''
- # Logging
- log_history "$EVENT"
- log_event "$OK" "$EVENT"
- exit
|