mirror of
https://github.com/myvesta/vesta.git
synced 2025-01-12 05:52:53 -08:00
62 lines
1.9 KiB
Bash
Executable File
62 lines
1.9 KiB
Bash
Executable File
#!/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 definition
|
|
user=$1
|
|
domain=$(idn -t --quiet -u "$2" )
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
source $VESTA/func/domain.sh
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '2' "$#" 'USER DOMAIN'
|
|
is_format_valid 'user' 'domain'
|
|
is_system_enabled "$WEB_SYSTEM" '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 #
|
|
#----------------------------------------------------------#
|
|
|
|
# Defining 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' ''
|
|
update_object_value 'web' 'DOMAIN' "$domain" '$STATS_CRYPT' ''
|
|
|
|
|
|
# Logging
|
|
log_history "disabled web stats password protection for $domain"
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|