new improved template scheme

This commit is contained in:
Serghey Rodin 2013-05-10 11:04:40 +03:00
commit fd4e68bb8c
96 changed files with 1395 additions and 1425 deletions

View file

@ -1,6 +1,6 @@
#!/bin/bash
# info: add dns domain
# options: USER DOMAIN IP [TEMPLATE] [NS1] [NS2] [NS3] [NS4] [RESTART]
# options: USER DOMAIN IP [NS1] [NS2] [NS3] [NS4] [RESTART]
#
# The function adds DNS zone with records defined in the template. If the exp
# argument isn't stated, the expiration date value will be set to next year.
@ -20,12 +20,11 @@ domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
ip=$3
template=$4
ns1=$5
ns2=$6
ns3=$7
ns4=$8
restart=$9
ns1=$4
ns2=$5
ns3=$6
ns4=$7
restart=$8
# Includes
source $VESTA/conf/vesta.conf
@ -37,36 +36,32 @@ source $VESTA/func/domain.sh
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN IP [TEMPLATE] [NS1] [NS2] [NS3] [NS4]'
check_args '3' "$#" 'USER DOMAIN IP [NS1] [NS2] [NS3] [NS4]'
validate_format 'user' 'domain' 'ip'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_domain_new 'dns'
is_package_full 'DNS_DOMAINS'
if [ ! -z "$template" ]; then
validate_format 'template'
is_dns_template_valid
else
template=$(get_user_value '$TEMPLATE')
is_dns_template_valid
fi
template=$(get_user_value '$DNS_TEMPLATE')
is_dns_template_valid
if [ ! -z "$ns1" ]; then
ns1=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns1=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
validate_format 'ns1'
fi
if [ ! -z "$ns2" ]; then
ns2=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns2=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
validate_format 'ns2'
fi
if [ ! -z "$ns3" ]; then
ns3=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns3=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
validate_format 'ns3'
fi
if [ ! -z "$ns4" ]; then
ns4=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
ns4=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
validate_format 'ns4'
fi
@ -75,7 +70,7 @@ fi
# Action #
#----------------------------------------------------------#
# Defining variables
# Defining NS variables
if [ -z $ns2 ]; then
i=1
ns=$(get_user_value '$NS')
@ -88,7 +83,6 @@ soa="$ns1"
exp=$(date +%F -d "+ 1 year")
ttl=14400
# Adding zone to dns dir
cat $DNSTPL/$template.tpl |\
sed -e "s/%ip%/$ip/g" \

View file

@ -58,7 +58,7 @@ else
dom=$(echo "$dom_alias" | sed -e "s/^$sub.//" )
if [ ! -e "$USER_DATA/dns/$dom.conf" ]; then
$BIN/v-add-dns-domain \
$user $dom $IP '' '' '' '' '' $restart > /dev/null
$user $dom $IP '' '' '' '' $restart > /dev/null
if [ $? -eq 0 ]; then
$BIN/v-add-dns-domain-record \

View file

@ -51,9 +51,11 @@ fi
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
$BIN/v-add-web-domain $user $domain $ip
retun_code=$?
if [ "$PROXY_SYSTEM" = 'nginx' ] && [ "$retun_code" -eq 0 ]; then
$BIN/v-add-web-domain-nginx $user $domain
fi
fi
# Proxy support
if [ ! -z "$PROXY_SYSTEM" ] && [ "$retun_code" -eq 0 ]; then
$BIN/v-add-web-domain-proxy $user $domain
fi
# DNS domain

View file

@ -19,7 +19,7 @@ ip=${1// /}
mask=$2
interface="${3-eth0}"
user="${4-admin}"
ip_status="${5-shared}" # can be dedicated as well
ip_status="${5-shared}" # status can be dedicated
ip_name=$6
nat_ip=$7
@ -50,27 +50,64 @@ fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Get full interface name
get_ip_iface
sys_ip_check=$(/sbin/ifconfig | grep "addr:$ip ")
if [ -z "$sys_ip_check" ]; then
/sbin/ifconfig "$iface" "$ip" netmask "$mask"
# Defining config paths
conf='/etc/httpd/conf.d/vesta.conf'
nconf='/etc/nginx/conf.d/vesta_ip.conf'
iconf='/etc/sysconfig/network-scripts/ifcfg'
rconf='/etc/httpd/conf.d/mod_extract_forwarded.conf'
# Adding ip
/sbin/ifconfig "$iface" "$ip" netmask "$mask"
# Adding startup script
create_ip_startup
# Adding startup script
sys_ip="# Added by vesta"
sys_ip="$sys_ip\nDEVICE=$iface"
sys_ip="$sys_ip\nBOOTPROTO=static"
sys_ip="$sys_ip\nONBOOT=yes"
sys_ip="$sys_ip\nIPADDR=$ip"
sys_ip="$sys_ip\nNETMASK=$mask"
echo -e $sys_ip > /etc/sysconfig/network-scripts/ifcfg-$iface
fi
# Adding vesta ip
create_vesta_ip
echo "OWNER='$user'
STATUS='$ip_status'
NAME='$ip_name'
U_SYS_USERS=''
U_WEB_DOMAINS='0'
INTERFACE='$interface'
NETMASK='$mask'
NAT='$nat_ip'
TIME='$TIME'
DATE='$DATE'" > $VESTA/data/ips/$ip
chmod 660 $VESTA/data/ips/$ip
# Namehosting support
namehost_ip_support
# WEB support
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ "$WEB_SYSTEM" = 'httpd' ]; then
conf_ins='1'
conf_line=$(grep -n NameVirtual $web_conf | tail -n1 | cut -f1 -d:)
if [ ! -z "$conf_line" ]; then
conf_ins=$((conf_line + 1))
fi
if [ "$WEB_SSL" = 'mod_ssl' ]; then
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_SSL_PORT" $web_conf
sed -i "$conf_ins i Listen $ip:$WEB_SSL_PORT" $web_conf
fi
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_PORT" $web_conf
sed -i "$conf_ins i Listen $ip:$WEB_PORT" $web_conf
fi
# Proxy support
if [ ! -z "$PROXY_SYSTEM" ]; then
cat $WEBTPL/$PROXY_SYSTEM/proxy_ip.tpl |\
sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/$WEB_PORT/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" \
> /etc/$PROXY_SYSTEM/conf.d/$ip.conf
fw_conf="/etc/$WEB_SYSTEM/conf.d/mod_extract_forwarded.conf"
if [ -e "$fw_conf" ]; then
ips=$(grep 'MEFaccept ' $fw_conf | grep -v '#' | head -n1)
sed -i "s/$ips/$ips $ip/g" $fw_conf
fi
fi
#----------------------------------------------------------#
@ -93,9 +130,8 @@ else
fi
# Restart web server
if [ "$web_restart" = 'yes' ]; then
$BIN/v-restart-web "$EVENT"
fi
$BIN/v-restart-web
$BIN/v-restart-proxy
# Logging
log_history "added system ip address $ip" '' 'admin'

View file

@ -1,6 +1,6 @@
#!/bin/bash
# info: add web domain
# options: USER DOMAIN IP [TEMPLATE] [RESTART]
# options: USER DOMAIN IP [RESTART]
#
# The function adds virtual host to a server. In cases when a template is
# undefined in the script, the template "default" will be used. The alias of
@ -21,8 +21,7 @@ domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
ip=$3
template=$4
restart=$5
restart=$4
# Includes
source $VESTA/conf/vesta.conf
@ -35,7 +34,7 @@ source $VESTA/func/ip.sh
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN IP [TEMPLATE] [RESTART]'
check_args '3' "$#" 'USER DOMAIN IP [RESTART]'
validate_format 'user' 'domain' 'ip'
is_system_enabled "$WEB_SYSTEM"
is_object_valid 'user' 'USER' "$user"
@ -44,13 +43,9 @@ is_domain_new 'web'
is_ip_valid
is_ip_avalable
is_package_full 'WEB_DOMAINS'
if [ ! -z "$template" ]; then
validate_format 'template'
is_apache_template_valid
else
template=$(get_user_value '$TEMPLATE')
is_apache_template_valid
fi
template=$(get_user_value '$WEB_TEMPLATE')
is_web_template_valid
#----------------------------------------------------------#
@ -82,10 +77,10 @@ fi
group="$user"
email="$user@$domain"
docroot="$HOMEDIR/$user/web/$domain/public_html"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/apache/$template.tpl"
tpl_file="$WEBTPL/$WEB_SYSTEM/$template.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
# Adding domain to the httpd.conf
# Adding web config
add_web_config
# Building directory tree
@ -99,12 +94,13 @@ mkdir -p $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/logs
# Adding domain logs
touch /var/log/httpd/domains/$domain.bytes \
/var/log/httpd/domains/$domain.log \
/var/log/httpd/domains/$domain.error.log
touch /var/log/$WEB_SYSTEM/domains/$domain.bytes \
/var/log/$WEB_SYSTEM/domains/$domain.log \
/var/log/$WEB_SYSTEM/domains/$domain.error.log
# Adding symlink for logs
ln -f -s /var/log/httpd/domains/$domain.*log $HOMEDIR/$user/web/$domain/logs/
ln -f -s /var/log/$WEB_SYSTEM/domains/$domain.*log \
$HOMEDIR/$user/web/$domain/logs/
# Adding domain skeleton
if [ -e "$WEBTPL/skel/public_html/" ]; then
@ -127,11 +123,11 @@ done
# Changing file owner
chown -R $user:$user $HOMEDIR/$user/web/$domain
chown root:$user /var/log/httpd/domains/$domain.*
chown root:apache $conf
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.*
chown root:$user $conf
# Changing file permissions
chmod 660 $conf
chmod 640 $conf
chmod 551 $HOMEDIR/$user/web/$domain
chmod 751 $HOMEDIR/$user/web/$domain/private
chmod 751 $HOMEDIR/$user/web/$domain/cgi-bin
@ -143,18 +139,17 @@ chmod -f -R 665 $HOMEDIR/$user/web/$domain/public_html/*
chmod -f -R 665 $HOMEDIR/$user/web/$domain/document_errors/*
chmod 551 $HOMEDIR/$user/web/$domain/stats
chmod 551 $HOMEDIR/$user/web/$domain/logs
chmod 640 /var/log/httpd/domains/$domain.*
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
# Running template trigger
if [ -x $WEBTPL/apache/$template.sh ]; then
$WEBTPL/apache/$template.sh $user $domain $ip $HOMEDIR $docroot
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
$WEBTPL/$WEB_SYSTEM/$template.sh $user $domain $ip $HOMEDIR $docroot
fi
# Checking main vesta httpd config
main_conf='/etc/httpd/conf.d/vesta.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "Include $conf" >>$main_conf
# Checking web config
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep $conf $web_conf)" ]; then
echo "Include $conf" >> $web_conf
fi
@ -170,7 +165,7 @@ increase_user_value "$user" '$U_WEB_ALIASES'
# Defining domain variables
str="DOMAIN='$domain' IP='$IP' IP6='' ALIAS='$aliases' TPL='$template'"
str="$str SSL='no' SSL_HOME='same' FTP_USER='' FTP_MD5=''"
str="$str NGINX='' NGINX_EXT='' STATS='' STATS_USER=''"
str="$str PROXY='' PROXY_EXT='' STATS='' STATS_USER=''"
str="$str STATS_CRYPT='' U_DISK='0' U_BANDWIDTH='0' SUSPENDED='no'"
str="$str TIME='$TIME' DATE='$DATE'"
@ -180,7 +175,7 @@ chmod 660 $USER_DATA/web.conf
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
fi
# Logging

View file

@ -49,8 +49,8 @@ is_package_full 'WEB_ALIASES'
# Parsing domain values
get_domain_values 'web'
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
ip=$(get_real_ip $IP)
# Parsing domain aliases
@ -68,22 +68,22 @@ del_web_config
add_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
@ -102,7 +102,8 @@ increase_user_value "$user" '$U_WEB_ALIASES'
# Adding task to the vesta pipe
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
log_history "added $dom_alias as alias for $domain"

View file

@ -55,9 +55,19 @@ if [ ! -z "$FTP_USER" ]; then
/usr/sbin/userdel -f $FTP_USER
fi
# Define shell
shell='/sbin/nologin'
if [ -e "/usr/bin/rssh" ]; then
shell='/usr/bin/rssh'
fi
# Adding user
/usr/sbin/adduser -o -u $(id -u $user) -g $user -s /sbin/nologin -M \
-d "$HOMEDIR/$user/web/$domain" $ftp_user > /dev/null 2>&1
/usr/sbin/adduser -o -u $(id -u $user) \
-g $user \
-s $shell \
-M -d "$HOMEDIR/$user/web/$domain" \
$ftp_user > /dev/null 2>&1
echo "$ftp_password" | /usr/bin/passwd "$ftp_user" --stdin &>/dev/null
ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)"

View file

@ -1,9 +1,9 @@
#!/bin/bash
# info: add webdomain nginx support
# info: add webdomain proxy support
# options: USER DOMAIN [TEMPLATE] [EXTENTIONS] [RESTART]
#
# The function enables nginx support for a domain. It can significantly improve
# website speed.
# The function enables proxy support for a domain. This can significantly
# improve website speed.
#----------------------------------------------------------#
@ -38,14 +38,11 @@ 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_empty 'web' 'DOMAIN' "$domain" '$NGINX'
if [ ! -z "$template" ]; then
validate_format 'template'
is_nginx_template_valid
else
template=$(get_user_value '$TEMPLATE')
is_nginx_template_valid
is_object_value_empty 'web' 'DOMAIN' "$domain" '$PROXY'
if [ -z $template ]; then
template=$(get_user_value '$PROXY_TEMPLATE')
fi
is_proxy_template_valid
#----------------------------------------------------------#
@ -54,10 +51,10 @@ fi
# Defining domain parameters
get_domain_values 'web'
NGINX="$template"
NGINX_EXT="$extentions"
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
PROXY="$template"
PROXY_EXT="$extentions"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
ip=$(get_real_ip $IP)
# Preparing domain values for the template substitution
@ -65,49 +62,45 @@ upd_web_domain_values
add_web_config
# Set permission and ownership
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
# Checking main vesta httpd config
main_conf='/etc/nginx/conf.d/vesta_users.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "include $conf;" >>$main_conf
# Checking proxy config
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep "$conf" $proxy_conf)" ]; then
echo "include $conf;" >> $proxy_conf
fi
# Checking ssl
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
main_conf='/etc/nginx/conf.d/vesta_users.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "include $conf;" >>$main_conf
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep "$conf" $proxy_conf)" ]; then
echo "include $conf;" >> $proxy_conf
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Update config
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX' "$NGINX"
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX_EXT' "$extentions"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' "$PROXY"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-proxy "$EVENT"
fi
log_history "enabled nginx support for $domain"
log_history "enabled proxy support for $domain"
log_event "$OK" "$EVENT"
exit

View file

@ -41,7 +41,6 @@ is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
is_object_value_empty 'web' 'DOMAIN' "$domain" '$SSL'
#is_ip_owner
is_web_domain_cert_valid
@ -62,18 +61,18 @@ chmod 660 $USER_DATA/ssl/$domain.*
# Parsing domain values
get_domain_values 'web'
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
SSL_HOME="$ssl_home"
ip=$(get_real_ip $IP)
# Preparing domain values for the template substitution
upd_web_domain_values
# Adding domain to the shttpd.conf
# Adding domain to the web config
add_web_config
chown root:apache $conf
chown root:$user $conf
chmod 640 $conf
# Adding certificate to user dir
@ -85,32 +84,29 @@ if [ -e "$USER_DATA/ssl/$domain.ca" ]; then
fi
# Running template trigger
if [ -x $WEBTPL/apache/$template.sh ]; then
$WEBTPL/apache/$template.sh $user $domain $ip $HOMEDIR $sdocroot
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
$WEBTPL/$WEB_SYSTEM/$template.sh $user $domain $ip $HOMEDIR $sdocroot
fi
# Checking main vesta httpd config
main_conf='/etc/httpd/conf.d/vesta.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "Include $conf" >> $main_conf
# Checking web config
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep "$conf" $web_conf)" ]; then
echo "Include $conf" >> $web_conf
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
# Adding domain to the snginx.conf
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
# Checking proxy
if [ ! -z "$PROXY" ]; then
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
# Checking vesta nginx config
main_conf='/etc/nginx/conf.d/vesta_users.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "include $conf;" >>$main_conf
# Checking proxy config
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
if [ -z "$(grep "$conf" $proxy_conf )" ]; then
echo "include $conf;" >> $proxy_conf
fi
fi

View file

@ -166,36 +166,33 @@ then
conf="$USER_DATA/web.conf"
grep "DOMAIN='$domain'" $conf > vesta/web.conf
# Apache config
if [ "$WEB_SYSTEM" = 'apache' ]; then
# Parsing httpd.conf
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/httpd.conf
# WEB config
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/$WEB_SYSTEM.conf
# SSL check
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/shttpd.conf
fi
# SSL check
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/s$WEB_SYSTEM.conf
fi
# Nginx config
if [ ! -z "$NGINX" ] ; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Proxy config
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/nginx.conf
sed -n "$top_line,$bottom_line p" $conf > conf/$PROXY_SYSTEM.conf
# SSL check
if [ "$SSL" = 'yes' ] ; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/snginx.conf
# SSL proxy config
if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ] ; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
get_web_config_brds
sed -n "$top_line,$bottom_line p" $conf > conf/s$PROXY_SYSTEM.conf
fi
fi

View file

@ -62,7 +62,9 @@ change_user_package() {
echo "FNAME='$FNAME'
LNAME='$LNAME'
PACKAGE='$package'
TEMPLATE='$TEMPLATE'
WEB_TEMPLATE='$WEB_TEMPLATE'
PROXY_TEMPLATE='$PROXY_TEMPLATE'
DNS_TEMPLATE='$DNS_TEMPLATE'
WEB_DOMAINS='$WEB_DOMAINS'
WEB_ALIASES='$WEB_ALIASES'
DNS_DOMAINS='$DNS_DOMAINS'

View file

@ -1,6 +1,6 @@
#!/bin/bash
# info: change user default template
# options: USER TEMPLATE
# options: USER TYPE TEMPLATE
#
# The function changes default user web template.
@ -11,7 +11,8 @@
# Argument defenition
user=$1
template=$2
type=$(echo "$2" | tr '[:lower:]' '[:upper:]')
template=$3
# Includes
source $VESTA/conf/vesta.conf
@ -23,27 +24,33 @@ source $VESTA/func/domain.sh
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER TEMPLATE'
check_args '3' "$#" 'USER TYPE TEMPLATE'
validate_format 'user' 'template'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_apache_template_valid
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
case $type in
WEB) is_web_template_valid;
update_user_value "$user" '$WEB_TEMPLATE' "$template";;
PROXY) is_proxy_template_valid;
update_user_value "$user" '$PROXY_TEMPLATE' "$template";;
DNS) is_dns_template_valid;
update_user_value "$user" '$DNS_TEMPLATE' "$template";;
*) check_args '1' '0' 'USER TYPE TEMPLATE'
esac
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Changing user shell
update_user_value "$user" '$TEMPLATE' "$template"
# Logging
log_history "changed $user template to $template" '' 'admin'
log_history "changed $type template to $template"
log_event "$OK" "$EVENT"
exit

View file

@ -2,8 +2,7 @@
# info: change web domain ip address
# options: USER DOMAIN IP [RESTART]
#
# The call is used for changing the site ip address. The ip change will be
# performed for a virtual apache host and for a configuration nginx file both.
# The call is used for changing the site ip address.
#----------------------------------------------------------#
@ -46,30 +45,30 @@ is_ip_avalable
# Define variable for replace
get_domain_values 'web'
ip=$(get_real_ip $ip)
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
old=$(get_real_ip $IP)
new=$ip
replace_web_config
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
replace_web_config
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
replace_web_config
fi
# Checking nginx
if [ "$SSL" = 'yes' ] && [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
# Checking SSL proxy
if [ "$SSL" = 'yes' ] && [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
replace_web_config
fi
@ -87,7 +86,8 @@ update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -1,9 +1,8 @@
#!/bin/bash
# info: change web domain nginx template
# info: change web domain proxy template
# options: USER DOMAIN TEMPLATE [EXTENTIONS] [RESTART]
#
# The function changes template of nginx.conf configuration file. The content
# of webdomain directories remains untouched.
# The function changes proxy template
#----------------------------------------------------------#
@ -39,8 +38,8 @@ 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" '$NGINX'
is_nginx_template_valid
is_object_value_exist 'web' 'DOMAIN' "$domain" '$PROXY'
is_proxy_template_valid
#----------------------------------------------------------#
@ -49,36 +48,29 @@ is_nginx_template_valid
# Parsing domain values
get_domain_values 'web'
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
ip=$(get_real_ip $IP)
# Delete old vhost
del_web_config
# Checking ssl
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
del_web_config
fi
# Add new vhost
NGINX="$template"
NGINX_EXT="$extentions"
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
PROXY="$template"
PROXY_EXT="$extentions"
upd_web_domain_values
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
fi
@ -88,16 +80,16 @@ fi
#----------------------------------------------------------#
# Update config
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX' "$NGINX"
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX_EXT' "$extentions"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' "$PROXY"
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions"
# Restart web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-proxy
fi
# Logging
log_history "changed nginx template for $domain to $template"
log_history "changed proxy template for $domain to $template"
log_event "$OK" "$EVENT"
exit

View file

@ -70,7 +70,8 @@ fi
#----------------------------------------------------------#
# Restart web server
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
# Logging
log_history "changed ssl certificate for $domain"

View file

@ -39,8 +39,8 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
get_domain_values 'web'
old_ssl_home=$SSL_HOME
SSL_HOME=$ssl_home
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
# Parsing tpl_option
case $SSL_HOME in
@ -54,10 +54,10 @@ esac
# Changing sslhome directory
replace_web_config
# Checking nginx config
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
# Checking proxy config
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
replace_web_config
fi
@ -70,7 +70,8 @@ fi
update_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME' "$SSL_HOME"
# Restart web server
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
# Logging
log_history "changed ssl home for $domain to $ssl_home"

View file

@ -2,7 +2,7 @@
# info: change web domain template
# options: USER DOMAIN TEMPLATE [RESTART]
#
# The function changes template of httpd.conf configuration file. The content
# The function changes template of the web configuration file. The content
# of webdomain directories remains untouched.
@ -35,7 +35,7 @@ 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_apache_template_valid
is_web_template_valid
#----------------------------------------------------------#
@ -47,40 +47,40 @@ get_domain_values 'web'
ip=$(get_real_ip $IP)
# Deleting domain
tpl_file="$WEBTPL/apache/$TPL.tpl"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
old_tpl=$TPL
conf="$HOMEDIR/$user/conf/web/httpd.conf"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
del_web_config
# Deleting ssl vhost
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
fi
# Defining variables for new vhost config
upd_web_domain_values
tpl_file="$WEBTPL/apache/$template.tpl"
tpl_file="$WEBTPL/$WEB_SYSTEM/$template.tpl"
# Adding domain to the httpd.conf
# Adding domain to the web conf
add_web_config
# Running template trigger
if [ -x $WEBTPL/apache/$template.sh ]; then
$WEBTPL/apache/$template.sh $user $domain $ip $HOMEDIR $docroot
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
$WEBTPL/$WEB_SYSTEM/$template.sh $user $domain $ip $HOMEDIR $docroot
fi
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/apache/$template.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$template.stpl"
add_web_config
# Running template trigger
if [ -x $WEBTPL/apache/$template.sh ]; then
$WEBTPL/apache/$template.sh \
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
$WEBTPL/$WEB_SYSTEM/$template.sh \
"$user" "$domain" "$ip" "$HOMEDIR" "$sdocroot"
fi
fi
@ -95,7 +95,7 @@ update_object_value 'web' 'DOMAIN' "$domain" '$TPL' "$template"
# Restart web
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
fi
# Logging

View file

@ -35,34 +35,43 @@ is_ip_key_empty '$U_SYS_USERS'
# Action #
#----------------------------------------------------------#
# Defining config paths
conf='/etc/httpd/conf.d/vesta.conf'
nconf='/etc/nginx/conf.d/vesta_ip.conf'
iconf='/etc/sysconfig/network-scripts/ifcfg'
rconf='/etc/httpd/conf.d/mod_extract_forwarded.conf'
# Get ip owner
user="$(get_ip_value '$OWNER')"
ip_status="$(get_ip_value '$STATUS')"
# Deleting interface
interface=$(/sbin/ifconfig |grep -B1 "addr:$ip "|head -n 1 |cut -f 1 -d ' ')
if [ ! -z "$interface" ] && [ -z "$(echo $interface|cut -s -f2 -d :)" ]; then
echo "Error: Main IP on interface"
interface=$(/sbin/ifconfig | grep -B1 "dr:$ip " | head -n1 | cut -f1 -d \ )
if [ ! -z "$interface" ] && [ -z "$(echo $interface |cut -s -f2 -d :)" ]; then
echo "Error: can't delete main IP address"
log_event "$E_FORBIDEN" "$EVENT"
exit $E_FORBIDEN
fi
if [ ! -z "$interface" ]; then
/sbin/ifconfig "$interface" down
iconf='/etc/sysconfig/network-scripts/ifcfg'
rm -f $iconf-$interface
/sbin/ifconfig $interface down
rm -f /etc/sysconfig/network-scripts/ifcfg-$interface
fi
# Deleting vesta ip
rm -f $VESTA/data/ips/$ip
# Deleting namehosting support
namehost_ip_disable
# Disable virtual ip hosting support
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ ! -z "$WEB_SYSTEM" ]; then
sed -i "/NameVirtualHost $ip:/d" $web_conf
sed -i "/Listen $ip:/d" $web_conf
fi
# Deleting proxy config
if [ ! -z "$PROXY_SYSTEM" ]; then
rm -f /etc/$PROXY_SYSTEM/conf.d/$ip.conf
fw_conf="/etc/$WEB_SYSTEM/conf.d/mod_extract_forwarded.conf"
if [ -e "$fw_conf" ]; then
ips=$(grep 'MEFaccept 127.0.0.1' $fw_conf)
new_ips=$(echo "$ips" | sed -e "s/$ip//" )
sed -i "s/$ips/$new_ips/g" $fw_conf
fi
fi
#----------------------------------------------------------#
@ -89,12 +98,11 @@ fi
# Adding task to the vesta pipe
if [ "$web_restart" = 'yes' ]; then
$BIN/v-restart-web "$EVENT"
fi
$BIN/v-restart-web
$BIN/v-restart-proxy
# Logging
log_history "delted system ip address $ip" '' 'admin'
log_history "deleted system ip address $ip"
log_event "$OK" "$EVENT"
exit

View file

@ -44,8 +44,8 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
# Get template name
get_domain_values 'web'
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
ip=$(get_real_ip $IP)
# Deleting domain
@ -58,26 +58,26 @@ else
aliases=0
fi
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
# Deleting certificates
# Deleting SSL certificates
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.*
rm -f $USER_DATA/ssl/$domain.*
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
fi
fi
@ -98,9 +98,9 @@ fi
rm -rf $HOMEDIR/$user/web/$domain
# Deleting logs
rm -f /var/log/httpd/domains/$domain.log*
rm -f /var/log/httpd/domains/$domain.bytes
rm -f /var/log/httpd/domains/$domain.error*
rm -f /var/log/$WEB_SYSTEM/domains/$domain.log*
rm -f /var/log/$WEB_SYSTEM/domains/$domain.bytes
rm -f /var/log/$WEB_SYSTEM/domains/$domain.error*
#----------------------------------------------------------#
@ -110,34 +110,34 @@ rm -f /var/log/httpd/domains/$domain.error*
# Deleting domain
sed -i "/DOMAIN='$domain'/ d" $USER_DATA/web.conf
# Checking last ssl domain
conf='/etc/httpd/conf.d/vesta.conf'
# Checking last SSL domain
conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
ssl_dom=$(grep "SSL='yes'" $USER_DATA/web.conf | wc -l)
if [ "$ssl_dom" -eq '0' ]; then
sed -i "/.*\/$user\/.*shttpd.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/shttpd.conf
sed -i "/.*\/$user\/.*s$WEB_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf
fi
# Checking last domain
domains=$(wc -l $USER_DATA/web.conf|cut -f 1 -d ' ')
domains=$(wc -l $USER_DATA/web.conf | cut -f1 -d ' ')
if [ "$domains" -eq '0' ]; then
sed -i "/.*\/$user\/.*httpd.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/httpd.conf
sed -i "/.*\/$user\/.*$WEB_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf
fi
# Checking last ssl nginx domain
conf='/etc/nginx/conf.d/vesta_users.conf'
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
if [ -z "$last_snginx" ]; then
sed -i "/.*\/$user\/.*snginx.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/snginx.conf
# Checking last SSL proxy
conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
last_sproxy=$(grep "SSL='yes'" $USER_DATA/web.conf)
if [ -z "$last_sproxy" ]; then
sed -i "/.*\/$user\/.*s$PROXY_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf
fi
# Checking last nginx domain
last_nginx=$(grep -v "NGINX=''" $USER_DATA/web.conf)
if [ -z "$last_nginx" ]; then
sed -i "/.*\/$user\/.*nginx.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/nginx.conf
# Checking last proxy
last_proxy=$(grep -v "PROXY=''" $USER_DATA/web.conf)
if [ -z "$last_proxy" ]; then
sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf
fi
# Decrease counters
@ -150,7 +150,8 @@ fi
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -55,8 +55,8 @@ ALIAS=$(echo "$ALIAS" |\
sed -e "s/^$dom_alias$//g"|\
sed -e "/^$/d"|\
sed -e ':a;N;$!ba;s/\n/,/g')
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
# Preparing domain values for the template substitution
upd_web_domain_values
@ -66,22 +66,22 @@ del_web_config
add_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
@ -100,7 +100,8 @@ decrease_user_value "$user" '$U_WEB_ALIASES'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -1,8 +1,8 @@
#!/bin/bash
# info: deleting web domain nginx configuration
# info: deleting web domain proxy configuration
# options: USER DOMAIN
#
# The function of deleting the virtualhost nginx configuration.
# The function of deleting the virtualhost proxy configuration.
#----------------------------------------------------------#
@ -32,7 +32,7 @@ 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" '$NGINX'
is_object_value_exist 'web' 'DOMAIN' "$domain" '$PROXY'
#----------------------------------------------------------#
@ -41,14 +41,14 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$NGINX'
# Defining domain parameters
get_domain_values 'web'
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
fi
@ -58,30 +58,32 @@ fi
#----------------------------------------------------------#
# Update config
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX' ''
update_object_value 'web' 'DOMAIN' "$domain" '$NGINX_EXT' ''
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY' ''
update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' ''
# Checking last nginx domain
conf='/etc/nginx/conf.d/vesta_users.conf'
last_nginx=$(grep -v "NGINX=''" $USER_DATA/web.conf)
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
if [ -z "$last_snginx" ]; then
sed -i "/$user\/conf\/web\/snginx.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/snginx.conf
# Checking last SSL proxy
conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
last_sproxy=$(grep "SSL='yes'" $USER_DATA/web.conf)
if [ -z "$last_sproxy" ]; then
sed -i "/.*\/$user\/.*s$PROXY_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf
fi
if [ -z "$last_nginx" ]; then
sed -i "/$user\/conf\/web\/nginx.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/nginx.conf
# Checking last proxy
last_proxy=$(grep -v "PROXY=''" $USER_DATA/web.conf)
if [ -z "$last_proxy" ]; then
sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf
fi
# Restart web server
# Restart proxy server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-proxy
fi
# Logging
log_history "disabled nginx support for $domain"
log_history "disabled proxy support for $domain"
log_event "$OK" "$EVENT"
exit

View file

@ -1,5 +1,5 @@
#!/bin/bash
# info: delete web domain ssl support
# info: delete web domain SSL support
# options: USER DOMAIN
#
# The function disable https support and deletes SSL certificates.
@ -41,16 +41,16 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$SSL'
# Parsing domain values
get_domain_values 'web'
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
# Deleting domain
del_web_config
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
del_web_config
fi
@ -68,21 +68,22 @@ chown -R $user:$user $tmpdir
# Update config
update_object_value 'web' 'DOMAIN' "$domain" '$SSL' 'no'
# Checking last ssl domain
# Checking last SSL domain
ssl_dom=$(grep "SSL='yes'" $USER_DATA/web.conf)
conf='/etc/httpd/conf.d/vesta.conf'
conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
if [ -z "$ssl_dom" ]; then
sed -i "/.*\/$user\/.*shttpd.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/shttpd.conf
sed -i "/.*\/$user\/.*s$WEB_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf
fi
# Checking last nginx domain
conf='/etc/nginx/conf.d/vesta_users.conf'
last_nginx=$(grep -v "NGINX=''" $USER_DATA/web.conf)
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
if [ -z "$last_snginx" ]; then
sed -i "/.*\/$user\/.*snginx.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/snginx.conf
# Checking proxy
if [ ! -z "$PROXY_SYSTEM" ]; then
conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
if [ -z "$ssl_dom" ]; then
sed -i "/.*\/$user\/.*s$PROXY_SYSTEM.conf/d" $conf
rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf
fi
fi
# Decreasing domain value
@ -90,7 +91,8 @@ decrease_user_value "$user" '$U_WEB_SSL'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -44,7 +44,8 @@ done
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -72,15 +72,16 @@ is_object_valid 'user' 'USER' "$user"
conf=$USER_DATA/user.conf
# Defining fileds to select
fields='$USER $FNAME $LNAME $PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_ALIASES
$DNS_DOMAINS $DNS_RECORDS $MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES
$CRON_JOBS $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $CONTACT
$CRON_REPORTS $RKEY $SUSPENDED $SUSPENDED_USERS $SUSPENDED_WEB
$SUSPENDED_DNS $SUSPENDED_MAIL $SUSPENDED_DB $SUSPENDED_CRON $IP_AVAIL
$IP_OWNED $U_USERS $U_DISK $U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB
$U_BANDWIDTH $U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS
$U_DNS_RECORDS $U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES
$U_CRON_JOBS $U_BACKUPS $LANGUAGE $TIME $DATE'
fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE
$DNS_TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
$MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
$NS $SHELL $BACKUPS $CONTACT $CRON_REPORTS $RKEY $SUSPENDED
$SUSPENDED_USERS $SUSPENDED_WEB $SUSPENDED_DNS $SUSPENDED_MAIL
$SUSPENDED_DB $SUSPENDED_CRON $IP_AVAIL $IP_OWNED $U_USERS $U_DISK
$U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB $U_BANDWIDTH
$U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS $U_DNS_RECORDS
$U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES $U_CRON_JOBS
$U_BACKUPS $LANGUAGE $TIME $DATE'
# Listing user
case $format in

View file

@ -72,9 +72,10 @@ is_package_valid
#----------------------------------------------------------#
# Defining fileds to select
fields='$PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
$MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
$NS $SHELL $BACKUPS $TIME $DATE'
fields='$PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE $DNS_TEMPLATE $WEB_DOMAINS
$WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS $MAIL_DOMAINS $MAIL_ACCOUNTS
$DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $TIME
$DATE'
# Listing ip
case $format in

View file

@ -71,9 +71,10 @@ shell_list_pkgs() {
#----------------------------------------------------------#
# Defining fields
fields='$PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
$MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
$NS $SHELL $BACKUPS $TIME $DATE'
fields='$PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE $DNS_TEMPLATE $WEB_DOMAINS
$WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS $MAIL_DOMAINS $MAIL_ACCOUNTS
$DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $TIME
$DATE'
# Listing domains
case $format in

View file

@ -73,11 +73,11 @@ shell_list_users() {
#----------------------------------------------------------#
# Defining fileds to select
fields="\$USER \$FNAME \$LNAME \$PACKAGE \$TEMPLATE \$WEB_DOMAINS"
fields="$fields \$WEB_ALIASES \$DNS_DOMAINS \$DNS_RECORDS \$MAIL_DOMAINS"
fields="$fields \$MAIL_ACCOUNTS \$DATABASES \$CRON_JOBS \$DISK_QUOTA"
fields="$fields \$BANDWIDTH \$NS \$SHELL \$BACKUPS \$CONTACT"
fields="$fields \$CRON_REPORTS \$RKEY \$SUSPENDED \$SUSPENDED_USERS"
fields="\$USER \$FNAME \$LNAME \$PACKAGE \$WEB_TEMPLATE \$PROXY_TEMPLATE"
fields="$fields \$DNS_TEMPLATE \$WEB_DOMAINS \$WEB_ALIASES \$DNS_DOMAINS"
fields="$fields \$DNS_RECORDS \$MAIL_DOMAINS \$MAIL_ACCOUNTS \$DATABASES"
fields="$fields \$CRON_JOBS \$DISK_QUOTA \$BANDWIDTH \$NS \$SHELL \$BACKUPS"
fields="$fields \$CONTACT \$CRON_REPORTS \$RKEY \$SUSPENDED \$SUSPENDED_USERS"
fields="$fields \$SUSPENDED_WEB \$SUSPENDED_DNS \$SUSPENDED_MAIL"
fields="$fields \$SUSPENDED_DB \$SUSPENDED_CRON \$IP_AVAIL \$IP_OWNED"
fields="$fields \$U_USERS \$U_DISK \$U_DISK_DIRS \$U_DISK_WEB \$U_DISK_MAIL"

View file

@ -76,7 +76,7 @@ conf=$USER_DATA/web.conf
# Defining fileds to select
fields='$DOMAIN $IP $IP6 $U_DISK $U_BANDWIDTH $TPL $ALIAS $STATS $STATS_USER
$SSL $SSL_HOME $FTP_USER $NGINX $NGINX_EXT $SUSPENDED $TIME $DATE'
$SSL $SSL_HOME $FTP_USER $PROXY $PROXY_EXT $SUSPENDED $TIME $DATE'
# Listing domains
case $format in

View file

@ -36,7 +36,7 @@ conf=$USER_DATA/web.conf
# Defining fileds to select
fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS"
fields="$fields \$STATS \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER"
fields="$fields \$NGINX \$NGINX_EXT \$SUSPENDED \$TIME \$DATE"
fields="$fields \$PROXY \$PROXY_EXT \$SUSPENDED \$TIME \$DATE"
# Listing domains
case $format in

View file

@ -1,8 +1,8 @@
#!/bin/bash
# info: list web domains and nginx key
# info: list web domains and proxy key
# options: USER [FORMAT]
#
# The function for obtaining the list of domains with nginx parameter
# The function for obtaining the list of domains with proxy parameter
# displayed. This call was arranged for filling in the lack of information by
# applying v-list-web-domains call in the shell format.
@ -36,7 +36,7 @@ is_object_valid 'user' 'USER' "$user"
conf=$USER_DATA/web.conf
# Defining fileds to select
fields="\$DOMAIN \$NGINX \$NGINX_EXT"
fields="\$DOMAIN \$PROXY \$PROXY_EXT"
# Listing domains
case $format in

View file

@ -2,7 +2,7 @@
# info: list web templates
# options: USER [FORMAT]
#
# The function for obtaining the list of apache templates available to a user.
# The function for obtaining the list of web templates available to a user.
#----------------------------------------------------------#
@ -13,11 +13,12 @@
format=${1-shell}
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
# Json function
json_list_wtpl() {
templates=$(ls -t $WEBTPL/apache | cut -f 1 -d '.' |sort -u )
templates=$(ls -t $WEBTPL/$WEB_SYSTEM | cut -f 1 -d '.' |sort -u )
t_counter=$(echo "$templates" | wc -w)
i=1
echo '['
@ -34,7 +35,7 @@ json_list_wtpl() {
# Shell function
shell_list_wtpl() {
templates=$(ls -t $WEBTPL/apache | cut -f 1 -d '.' |sort -u )
templates=$(ls -t $WEBTPL/$WEB_SYSTEM | cut -f 1 -d '.' |sort -u )
if [ -z "$nohead" ]; then
echo "Templates"
echo "----------"

View file

@ -1,8 +1,8 @@
#!/bin/bash
# info: listing nginx templates
# info: listing proxy templates
# options: [FORMAT]
#
# The function for obtaining the list of nginx templates available to a user.
# The function for obtaining the list of proxy templates available to a user.
#----------------------------------------------------------#
@ -13,11 +13,11 @@
format=${1-shell}
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
# Json function
json_list_wtpl() {
templates=$(ls -t $WEBTPL/nginx | cut -f 1 -d '.' |sort -u )
t_counter=$(echo "$templates" | wc -w)
i=1
echo '['
@ -34,7 +34,6 @@ json_list_wtpl() {
# Shell function
shell_list_wtpl() {
templates=$(ls -t $WEBTPL/nginx | cut -f 1 -d '.' |sort -u )
if [ -z "$nohead" ]; then
echo "Templates"
echo "----------"
@ -49,6 +48,12 @@ shell_list_wtpl() {
# Action #
#----------------------------------------------------------#
# Proxy templates
templates=$(ls -t $WEBTPL/$PROXY_SYSTEM |\
cut -f1 -d . |\
grep -v proxy_ip |\
sort -u )
# Listing domains
case $format in
json) json_list_wtpl ;;

View file

@ -55,64 +55,60 @@ for domain in $(shell_list); do
done
# Config path
httpd_conf='/etc/httpd/conf.d/vesta.conf'
nginx_conf='/etc/nginx/conf.d/vesta_users.conf'
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
# Checking if there is at least 1 domain
if [ "$domain_counter" -lt 1 ]; then
# Deleting web configs
rm -f $HOMEDIR/$user/conf/web/*
sed -i "/.*\/$user\/.*httpd.conf/d" $httpd_conf
if [ -e "$nginx_conf" ]; then
sed -i "/.*\/$user\/.*nginx.conf/d" $nginx_conf
sed -i "/.*\/$user\/.*$WEB_SYSTEM.conf/d" $web_conf
if [ -e "$proxy_conf" ]; then
sed -i "/.*\/$user\/.*$WEB_SYSTEM.conf/d" $proxy_conf
fi
else
# Renaming tmp config
tmp_conf="$HOMEDIR/$user/conf/web/tmp_httpd.conf"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tmp_conf="$HOMEDIR/$user/conf/web/tmp_$WEB_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
mv $tmp_conf $conf
# Checking httpd.conf include
httpd_include=$(grep "$conf" $httpd_conf )
if [ -z "$httpd_include" ]; then
echo "Include $conf" >> $httpd_conf
# Checking include
web_include=$(grep "$conf" $web_conf )
if [ -z "$web_include" ]; then
echo "Include $conf" >> $web_conf
fi
# Checking ssl
# Checking SSL
if [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_shttpd.conf"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
mv $tmp_conf $conf
fi
# Checking ssl include
httpd_include=$(grep "$conf" $httpd_conf )
if [ -z "$httpd_include" ]; then
echo "Include $conf" >> $httpd_conf
ssl_include=$(grep "$conf" $web_conf )
if [ -z "$ssl_include" ]; then
echo "Include $conf" >> $web_conf
fi
# Checking nginx
if [ "$ngix_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_nginx.conf"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ "$proxy_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
mv $tmp_conf $conf
fi
nginx_include=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_include" ]; then
echo "include $conf;" >> $nginx_conf
proxy_include=$(grep "$conf" $proxy_conf )
if [ -z "$proxy_include" ]; then
echo "include $conf;" >> $proxy_conf
fi
# Checking ssl for nginx
if [ "$ngix_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_snginx.conf"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
# Checking SSL proxy
if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
mv $tmp_conf $conf
nginx_include=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_include" ]; then
echo "include $conf;" >> $nginx_conf
proxy_include=$(grep "$conf" $proxy_conf )
if [ -z "$proxy_include" ]; then
echo "include $conf;" >> $proxy_conf
fi
fi
fi
@ -130,7 +126,8 @@ update_user_value "$user" '$U_WEB_ALIASES' "$user_aliases"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -18,11 +18,15 @@ source $VESTA/func/main.sh
# Action #
#----------------------------------------------------------#
# Parsing config / or just source config
if [ "$CRON_SYSTEM" = 'crond' ]; then
/etc/init.d/crond 'reload' >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/crond 'restart' >/dev/null 2>&1
if [ ! -z "$CRON_SYSTEM" ]; then
/etc/init.d/$CRON_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/$CRON_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/$CRON_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi

View file

@ -18,10 +18,15 @@ source $VESTA/func/main.sh
# Action #
#----------------------------------------------------------#
if [ "$DNS_SYSTEM" = 'bind' ]; then
/etc/init.d/named reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/named restart >/dev/null 2>&1
if [ ! -z "$DNS_SYSTEM" ]; then
/etc/init.d/$DNS_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/$DNS_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/$DNS_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi

View file

@ -18,22 +18,15 @@ source $VESTA/func/main.sh
# Action #
#----------------------------------------------------------#
# Vsftpd
if [ "$FTP_SYSTEM" = 'vsftpd' ]; then
/etc/init.d/vsftpd reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/vsftpd restart >/dev/null 2>&1
if [ ! -z "$FTP_SYSTEM" ]; then
/etc/init.d/$FTP_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/$FTP_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
fi
# ProFTPD
if [ "$FTP_SYSTEM" = 'proftpd' ]; then
/etc/init.d/proftpd reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/proftpd restart >/dev/null 2>&1
else
/etc/init.d/$FTP_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi

View file

@ -18,10 +18,15 @@ source $VESTA/func/main.sh
# Action #
#----------------------------------------------------------#
if [ "$MAIL_SYSTEM" = 'exim' ]; then
/etc/init.d/exim reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/exim restart >/dev/null 2>&1
if [ ! -z "$MAIL_SYSTEM" ]; then
/etc/init.d/$MAIL_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/$MAIL_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/$MAIL_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi

41
bin/v-restart-proxy Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
# info: restart proxy server
# options: NONE
#
# The function reloads proxy server configuration.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ ! -z "$PROXY_SYSTEM" ]; then
/etc/init.d/$PROXY_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/$PROXY_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/$PROXY_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -1,5 +1,5 @@
#!/bin/bash
# info: restart web services
# info: restart web server
# options: NONE
#
# The function reloads web server configuration.
@ -18,37 +18,21 @@ source $VESTA/func/main.sh
# Action #
#----------------------------------------------------------#
if [ "$WEB_SYSTEM" = 'apache' ]; then
/etc/init.d/httpd status >/dev/null 2>&1
if [ ! -z "$WEB_SYSTEM" ]; then
/etc/init.d/$WEB_SYSTEM status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/httpd graceful >/dev/null 2>&1
/etc/init.d/$WEB_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/httpd start >/dev/null 2>&1
/etc/init.d/$WEB_SYSTEM start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
fi
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
/etc/init.d/nginx status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/nginx reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
else
/etc/init.d/nginx start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
fi
#----------------------------------------------------------#
# Vesta #

View file

@ -244,21 +244,11 @@ if [ "$web" != 'no' ]; then
echo "$IP" > $tmpdir/ip_mapping.$domain
fi
# Check apache template
check_tpl=$(is_apache_template_valid)
if [ ! -z "$check_tpl" ]; then
templates=$(ls -t $VESTA/data/templates/web/ |\
grep 'apache' |\
grep '\.tpl' |\
cut -f 2 -d '_' |\
cut -f 1 -d '.')
if [ ! -z "$(echo $templates |grep default)" ]; then
TPL=$(echo "$templates" |grep default |head -n1)
else
TPL=$("$templates" |head -n1)
fi
if [ -z "$TPL" ]; then
# Check web template
check_tpl=$(is_web_template_valid)
if [ ! -e "$WEBTPL/$WEB_SYSTEM/$TPL.tpl" ]; then
TPL="default"
if [ ! -e "$WEBTPL/$WEB_SYSTEM/$TPL.tpl" ]; then
echo "Error: no avaiable web template"
echo "No available web template" |\
$send_mail -s "$subj" $email
@ -267,24 +257,13 @@ if [ "$web" != 'no' ]; then
fi
fi
# Check nginx template
if [ ! -z "$NGINX" ]; then
check_tpl=$(is_nginx_template_valid)
if [ ! -z "$check_tpl" ]; then
templates=$(ls -t $VESTA/data/templates/web/ |\
grep 'nginx' |\
grep '\.tpl' |\
cut -f 2 -d '_' |\
cut -f 1 -d '.')
if [ ! -z "$(echo $templates |grep default)" ]; then
NGINX=$(echo "$templates" |grep default |head -n1)
else
NGINX=$("$templates" |head -n1)
fi
if [ -z "$NGINX" ]; then
echo "Error: no avaiable nginx template"
echo "No available nginx tpl" |\
# Check proxy template
if [ ! -z "$PROXY" ]; then
if [ ! -e "$WEBTPL/$PROXY_SYSTEM/$TPL.tpl" ]; then
PROXY="default"
if [ ! -e "$WEBTPL/$PROXY_SYSTEM/$TPL.tpl" ]; then
echo "Error: no avaiable proxy template"
echo "No available proxy tpl" |\
$send_mail -s "$subj" $email
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
@ -302,8 +281,8 @@ if [ "$web" != 'no' ]; then
str="DOMAIN='$domain' IP='$IP' IP6='$IP6' ALIAS='$ALIAS'"
str="$str TPL='$TPL' SSL='$SSL' SSL_HOME='$SSL_HOME'"
str="$str FTP_USER='$FTP_USER' FTP_MD5='$FTP_MD5' NGINX='$NGINX'"
str="$str NGINX_EXT='$NGINX_EXT' STATS='$STATS'"
str="$str FTP_USER='$FTP_USER' FTP_MD5='$FTP_MD5' PROXY='$PROXY'"
str="$str PROXY_EXT='$PROXY_EXT' STATS='$STATS'"
str="$str STATS_USER='$STATS_USER' STATS_CRYPT='$STATS_CRYPT'"
str="$str U_DISK='$U_DISK' U_BANDWIDTH='0' SUSPENDED='no'"
str="$str TIME='$(date +%T)' DATE='$(date +%F)'"
@ -312,51 +291,51 @@ if [ "$web" != 'no' ]; then
# Rebuild web config
rebuild_web_domain_conf
# Adding apache virtualhost
httpd_conf='/etc/httpd/conf.d/vesta.conf'
tmp_conf="$HOMEDIR/$user/conf/web/tmp_httpd.conf"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
# Adding vhost
web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
tmp_conf="$HOMEDIR/$user/conf/web/tmp_$WEB_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
cat $tmp_conf >> $conf
rm -f $tmp_conf
httpd_include=$(grep "$conf" $httpd_conf )
if [ -z "$httpd_include" ]; then
echo "Include $conf" >> $httpd_conf
web_include=$(grep "$conf" $web_conf)
if [ -z "$web_include" ]; then
echo "Include $conf" >> $web_conf
fi
# Adding ssl apache virtuualhost
# Adding SSL vhost
if [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_shttpd.conf"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
cat $tmp_conf >> $conf
rm -f $tmp_conf
fi
httpd_include=$(grep "$conf" $httpd_conf )
if [ -z "$httpd_include" ]; then
echo "Include $conf" >> $httpd_conf
ssl_include=$(grep "$conf" $web_conf)
if [ -z "$ssl_include" ]; then
echo "Include $conf" >> $web_conf
fi
# Adding nginx virtualhost
nginx_conf='/etc/nginx/conf.d/vesta_users.conf'
if [ "$ngix_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_nginx.conf"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Adding proxy vhost
proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
if [ "$proxy_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
cat $tmp_conf >> $conf
rm -f $tmp_conf
fi
nginx_include=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_include" ]; then
echo "include $conf;" >> $nginx_conf
proxy_include=$(grep "$conf" $proxy_conf)
if [ -z "$proxy_include" ]; then
echo "include $conf;" >> $proxy_conf
fi
# Adding ssl nginx virtualhost
if [ "$ngix_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_snginx.conf"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
# Adding SSL proxy vhost
if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
cat $tmp_conf >> $conf
rm -f $tmp_conf
nginx_include=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_include" ]; then
echo "include $conf;" >> $nginx_conf
proxy_include=$(grep "$conf" $proxy_conf)
if [ -z "$proxy_include" ]; then
echo "include $conf;" >> $proxy_conf
fi
fi
fi
@ -380,7 +359,8 @@ if [ "$web" != 'no' ]; then
done
# Restart WEB
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
echo
msg="$msg\n"
fi

View file

@ -42,8 +42,8 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
# Parsing domain values
get_domain_values 'web'
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
SUSPENDED='yes'
ip=$(get_real_ip $IP)
@ -54,27 +54,29 @@ upd_web_domain_values
del_web_config
add_web_config
# Check ssl
# Check SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
del_web_config
add_web_config
fi
fi
# Checking proxy SSL
if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$PROXY_SSL/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
@ -88,7 +90,8 @@ increase_user_value "$user" '$SUSPENDED_WEB'
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -40,8 +40,8 @@ is_object_suspended 'web' 'DOMAIN' "$domain"
# Parsing domain values
get_domain_values 'web'
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
SUSPENDED='no'
ip=$(get_real_ip $IP)
@ -52,27 +52,28 @@ upd_web_domain_values
del_web_config
add_web_config
# Check ssl
# Check SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/apache/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
del_web_config
add_web_config
fi
# Checking SSL proxy
if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
@ -86,7 +87,8 @@ decrease_user_value "$user" '$SUSPENDED_WEB'
# Restart web erver
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
$BIN/v-restart-web
$BIN/v-restart-proxy
fi
# Logging

View file

@ -16,10 +16,8 @@ user=${1-admin}
ip_status=${2-shared}
# Includes
source $VESTA/conf/vesta.conf # include for internal func
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/ip.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
@ -35,40 +33,15 @@ is_object_valid 'user' 'USER' "$user" "$user"
# Action #
#----------------------------------------------------------#
# Get ip list
ip_list=$(/sbin/ifconfig | grep 'inet addr:' | cut -f 2 -d : | \
cut -f 1 -d ' '| grep -v 127.0.0.1)
# Get vesta registered ip list
vesta_ip_list=$(ls $VESTA/data/ips/)
# Defining config paths
conf='/etc/httpd/conf.d/vesta.conf'
nconf='/etc/nginx/conf.d/vesta_ip.conf'
iconf='/etc/sysconfig/network-scripts/ifcfg'
rconf='/etc/httpd/conf.d/mod_extract_forwarded.conf'
# Comparing each ip
for ip in $ip_list; do
check_ip=$(echo $vesta_ip_list | grep -w "$ip")
# Checking ip registered
if [ -z "$check_ip" ]; then
# Parsing additional params
iface=$(/sbin/ifconfig |grep -B1 -w $ip |head -n 1 |cut -f 1 -d ' ')
if [ ! -e "$VESTA/data/ips/$ip" ]; then
iface=$(/sbin/ifconfig |grep -B1 -w $ip |head -n1 |cut -f1 -d ' ')
interface=$(echo "$iface" | cut -f 1 -d :)
mask=$(/sbin/ifconfig |grep -w $ip |awk -F "Mask:" '{print $2}')
# Adding vesta ip
create_vesta_ip
# Adding namehosting support
namehost_ip_support
# Creating startup script
if [ ! -e "$iconf-$iface" ]; then
create_vesta_ip
fi
$BIN/v-add-sys-ip $ip $mask $interface
fi
# TBD: revers comparation
@ -79,15 +52,4 @@ done
# Vesta #
#----------------------------------------------------------#
# Updating user conf
increase_user_value "$user" '$IP_OWNED'
# Restart web server
if [ "$web_restart" = 'yes' ]; then
$BIN/v-restart-web "$EVENT"
fi
# Logging
log_event "$OK" "$EVENT"
exit

View file

@ -102,12 +102,12 @@ for period in $periods; do
$BIN/v-update-sys-rrd-ssh $period
# Updating web stats
if [ "$WEB_SYSTEM" = 'apache' ]; then
$BIN/v-update-sys-rrd-httpd $period
if [ ! -z "$WEB_SYSTEM" ]; then
$BIN/v-update-sys-rrd-$WEB_SYSTEM $period
fi
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
$BIN/v-update-sys-rrd-nginx $period
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-update-sys-rrd-$PROXY_SYSTEM $period
fi
# Updating ftp stats

View file

@ -38,7 +38,7 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Defining log file
log_file="/var/log/httpd/domains/$domain.bytes"
log_file="/var/log/$WEB_SYSTEM/domains/$domain.bytes"
# Defining bytes
bytes=0

View file

@ -38,7 +38,7 @@ for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
update_object_value 'web' 'DOMAIN' "$domain" '$U_BANDWIDTH' '0'
fi
log_file="/var/log/httpd/domains/$domain.bytes"
log_file="/var/log/$WEB_SYSTEM/domains/$domain.bytes"
bytes=0
# Parsing log

View file

@ -1,46 +1,32 @@
# Web template check
is_apache_template_valid() {
t="$WEBTPL/apache/$template.tpl"
s="$WEBTPL/apache/$template.stpl"
is_web_template_valid() {
t="$WEBTPL/$WEB_SYSTEM/$template.tpl"
s="$WEBTPL/$WEB_SYSTEM/$template.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
template='default'
t="$WEBTPL/apache/$template.tpl"
s="$WEBTPL/apache/$template.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
echo "Error: template $template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
echo "Error: web template $template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
}
# Nginx template check
is_nginx_template_valid() {
t="$WEBTPL/nginx/$template.tpl"
s="$WEBTPL/nginx/$template.stpl"
# Proxy template check
is_proxy_template_valid() {
t="$WEBTPL/$PROXY_SYSTEM/$template.tpl"
s="$WEBTPL/$PROXY_SYSTEM/$template.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
template='default'
t="$WEBTPL/nginx/$template.tpl"
s="$WEBTPL/nginx/$template.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
echo "Error: nginx $template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
echo "Error: proxy template $template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
}
# DNS template check
is_dns_template_valid() {
tpl="$DNSTPL/$template.tpl"
if [ ! -e $tpl ]; then
template='default'
tpl="$DNSTPL/$template.tpl"
if [ ! -e $tpl ]; then
echo "Error: template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
t="$DNSTPL/$template.tpl"
if [ ! -e $t ]; then
echo "Error: dns template $template not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
}
@ -239,6 +225,7 @@ add_web_config() {
-e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" \
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
-e "s/%proxy_extentions%/${PROXY_EXT//,/|}/g" \
-e "s/%domain_idn%/$domain_idn/g" \
-e "s/%domain%/$domain/g" \
-e "s/%user%/$user/g" \
@ -255,10 +242,6 @@ add_web_config() {
-e "s/%ssl_pem%/${ssl_pem////\/}/g" \
-e "s/%ssl_ca_str%/${ssl_ca_str////\/}/g" \
-e "s/%ssl_ca%/${ssl_ca////\/}/g" \
-e "s/%nginx_extentions%/${NGINX_EXT//,/|}/g" \
-e "s/%elog%//g" \
-e "s/%cgi%//g" \
-e "s/%cgi_option%/+ExecCGI/g" \
>> $conf
}
@ -397,71 +380,6 @@ del_web_config() {
sed -i "$top_line,$bottom_line d" $conf
}
# Add ip virtual hosting support
namehost_ip_support() {
if [ "$WEB_SYSTEM" = 'apache' ]; then
conf_line=$(grep -n "NameVirtual" $conf|tail -n 1|cut -f 1 -d ':')
if [ ! -z "$conf_line" ]; then
conf_ins=$((conf_line + 1))
else
conf_ins='1'
fi
if [ "$WEB_SSL" = 'mod_ssl' ]; then
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_SSL_PORT" $conf
sed -i "$conf_ins i Listen $ip:$WEB_SSL_PORT" $conf
fi
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_PORT" $conf
sed -i "$conf_ins i Listen $ip:$WEB_PORT" $conf
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
cat $WEBTPL/nginx/ip.tpl | sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/$WEB_PORT/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" >>$nconf
ips=$(grep 'MEFaccept ' $rconf |grep -v '#'| head -n1)
sed -i "s/$ips/$ips $ip/g" $rconf
fi
web_restart='yes'
fi
}
# Disable virtual ip hosting support
namehost_ip_disable() {
if [ "$WEB_SYSTEM" = 'apache' ]; then
sed -i "/NameVirtualHost $ip:/d" $conf
sed -i "/Listen $ip:/d" $conf
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
tpl_ln=$(wc -l $WEBTPL/nginx/ip.tpl | cut -f 1 -d ' ')
ip_line=$(grep -n "%ip%" $WEBTPL/nginx/ip.tpl |head -n1 |\
cut -f 1 -d :)
conf_line=$(grep -n -w $ip $nconf|head -n1|cut -f 1 -d :)
if [ -z "$tpl_ln" ] || [ -z "$ip_line" ] || [ -z "$conf_line" ]
then
echo "Error: nginx config paring error"
log_event "$E_PARSING" "$EVENT"
exit $E_PARSING
fi
up_line=$((ip_line - 1))
first_line=$((conf_line - up_line))
last_line=$((conf_line - ip_line + tpl_ln))
if [ -z "$first_line" ] || [ -z "$last_line" ]; then
echo "Error: nginx config paring error"
log_event "$E_PARSING" "$EVENT"
exit $E_PARSING
fi
sed -i "$first_line,$last_line d" $nconf
ips=$(grep 'RPAFproxy_ips' $rconf)
new_ips=$(echo "$ips"|sed -e "s/$ip//")
sed -i "s/$ips/$new_ips/g" $rconf
fi
web_restart='yes'
fi
}
# Update web domain values
upd_web_domain_values() {
group="$user"

View file

@ -45,9 +45,7 @@ is_ip_owner() {
# Check if ip address is free
is_ip_free() {
list=$(/sbin/ifconfig |grep 'inet addr:' |cut -f 2 -d : |cut -f 1 -d ' ')
ip_check=$(echo "$list" |grep -w "$ip")
if [ -n "$ip_check" ] || [ -e "$VESTA/data/ips/$ip" ]; then
if [ -e "$VESTA/data/ips/$ip" ]; then
echo "Error: IP exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
@ -174,30 +172,6 @@ get_ip_value() {
echo "$value"
}
# Create ip vesta configuration
create_vesta_ip() {
ip_data="OWNER='$user'"
ip_data="$ip_data\nSTATUS='$ip_status'"
ip_data="$ip_data\nNAME='$ip_name'"
ip_data="$ip_data\nU_SYS_USERS=''"
ip_data="$ip_data\nU_WEB_DOMAINS='0'"
ip_data="$ip_data\nINTERFACE='$interface'"
ip_data="$ip_data\nNETMASK='$mask'"
ip_data="$ip_data\nNAT='$nat_ip'"
ip_data="$ip_data\nTIME='$TIME'"
ip_data="$ip_data\nDATE='$DATE'"
echo -e "$ip_data" >$VESTA/data/ips/$ip
chmod 660 $VESTA/data/ips/$ip
}
# Create ip address startup configuration
create_ip_startup() {
ip_data="# Added by vesta $SCRIPT\nDEVICE=$iface"
ip_data="$ip_data\nBOOTPROTO=static\nONBOOT=yes\nIPADDR=$ip"
ip_data="$ip_data\nNETMASK=$mask"
echo -e "$ip_data" > $iconf-$iface
}
# Get real ip address
get_real_ip() {
if [ -e "$VESTA/data/ips/$1" ]; then

View file

@ -209,7 +209,7 @@ is_object_valid() {
fi
fi
if [ -z "$sobject" ]; then
echo "Error: $3 not exist"
echo "Error: $2 $3 not exist"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
@ -684,7 +684,7 @@ validate_format_mhdmw() {
fi
}
# Nginx static extention or DNS record
# proxy extention or DNS record
validate_format_common() {
exclude="[!|#|$|^|&|(|)|+|=|{|}|:|<|>|?|/|\|\"|'|;|%|\`| ]"
if [[ "$1" =~ $exclude ]] || [ 200 -le ${#1} ]; then

View file

@ -156,14 +156,14 @@ rebuild_web_domain_conf() {
$HOMEDIR/$user/web/$domain/logs
# Create domain logs
touch /var/log/httpd/domains/$domain.bytes \
/var/log/httpd/domains/$domain.log \
/var/log/httpd/domains/$domain.error.log
touch /var/log/$WEB_SYSTEM/domains/$domain.bytes \
/var/log/$WEB_SYSTEM/domains/$domain.log \
/var/log/$WEB_SYSTEM/domains/$domain.error.log
# Create symlinks
cd $HOMEDIR/$user/web/$domain/logs/
ln -f -s /var/log/httpd/domains/$domain.log .
ln -f -s /var/log/httpd/domains/$domain.error.log .
ln -f -s /var/log/$WEB_SYSTEM/domains/$domain.log .
ln -f -s /var/log/$WEB_SYSTEM/domains/$domain.error.log .
cd - > /dev/null
# Propagate html skeleton
@ -180,7 +180,7 @@ rebuild_web_domain_conf() {
chmod 751 $HOMEDIR/$user/web/$domain/document_errors
chmod 551 $HOMEDIR/$user/web/$domain/stats
chmod 551 $HOMEDIR/$user/web/$domain/logs
chmod 640 /var/log/httpd/domains/$domain.*
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
# Set ownership
chown $user:$user $HOMEDIR/$user/web/$domain
@ -189,19 +189,18 @@ rebuild_web_domain_conf() {
chown $user:$user $HOMEDIR/$user/web/$domain/public_html
chown $user:$user $HOMEDIR/$user/web/$domain/public_shtml
chown -R $user:$user $HOMEDIR/$user/web/$domain/document_errors
chown root:$user /var/log/httpd/domains/$domain.*
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.*
# Adding tmp_httpd.conf
tpl_file="$WEBTPL/apache/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_httpd.conf"
# Adding tmp conf
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_$WEB_SYSTEM.conf"
add_web_config
chown root:apache $conf
chown root:$user $conf
chmod 640 $conf
# Running template trigger
if [ -x $WEBTPL/apache/$TPL.sh ]; then
$WEBTPL/apache/$TPL.sh $user $domain $ip $HOMEDIR $docroot
if [ -x $WEBTPL/$WEB_SYSTEM/$TPL.sh ]; then
$WEBTPL/$WEB_SYSTEM/$TPL.sh $user $domain $ip $HOMEDIR $docroot
fi
# Checking aliases
@ -253,13 +252,13 @@ rebuild_web_domain_conf() {
fi
fi
# Checking ssl
# Checking SSL
if [ "$SSL" = 'yes' ]; then
# Adding domain to the shttpd.conf
conf="$HOMEDIR/$user/conf/web/tmp_shttpd.conf"
tpl_file="$WEBTPL/apache/$TPL.stpl"
# Adding domain to the web conf
conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
add_web_config
chown root:apache $conf
chown root:$user $conf
chmod 640 $conf
cp -f $USER_DATA/ssl/$domain.crt \
@ -274,30 +273,30 @@ rebuild_web_domain_conf() {
fi
# Running template trigger
if [ -x $WEBTPL/apache/$TPL.sh ]; then
$WEBTPL/apache/$TPL.sh $user $domain $ip $HOMEDIR $sdocroot
if [ -x $WEBTPL/$WEB_SYSTEM/$TPL.sh ]; then
$WEBTPL/$WEB_SYSTEM/$TPL.sh $user $domain $ip $HOMEDIR $sdocroot
fi
user_ssl=$((user_ssl + 1))
ssl_change='yes'
fi
# Checking nginx
if [ ! -z "$NGINX" ]; then
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_nginx.conf"
# Checking proxy
if [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf"
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/tmp_snginx.conf"
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf"
add_web_config
chown root:nginx $conf
chown root:$user $conf
chmod 640 $conf
fi
ngix_change='yes'
proxy_change='yes'
fi
if [ "$SUSPENDED" = 'yes' ]; then
suspended_web=$((suspended_web + 1))

View file

@ -1,29 +1,71 @@
#!/bin/bash
# Define data path
TPL='/usr/local/vesta/data/templates/web'
# Rename web system service
sed -i "s/apache/httpd/g" /usr/local/vesta/conf/vesta.conf
# Check for new template structure
# Rename dns system service
sed -i "s/bind/named/g" /usr/local/vesta/conf/vesta.conf
# Rename nginx config
mv /etc/nginx/conf.d/vesta_users.conf /etc/nginx/conf.d/vesta.conf 2>/dev/null
rm -f /etc/nginx/conf.d/vesta_ip.conf 2>/dev/null
# Update user packages
PKG=/usr/local/vesta/data/packages
for package in $(ls $PKG); do
default=$(grep "^TEMPLATE='" $PKG/$package | cut -f2 -d \')
if [ ! -z "$default" ]; then
tpl="WEB_TEMPLATE='$default'"
tpl="$tpl\nPROXY_TEMPLATE='default'"
tpl="$tpl\nDNS_TEMPLATE='default'"
sed -i "s/^TEMPLATE=.*/$tpl/g" $PKG/$package
fi
done
# Update users
USR=/usr/local/vesta/data/users
for user in $(ls $USR); do
default=$(grep "^TEMPLATE='" $USR/$user/user.conf | cut -f2 -d \')
if [ ! -z "$default" ]; then
tpl="WEB_TEMPLATE='$default'"
tpl="$tpl\nPROXY_TEMPLATE='default'"
tpl="$tpl\nDNS_TEMPLATE='default'"
sed -i "s/^TEMPLATE=.*/$tpl/g" $USR/$user/user.conf
fi
done
# Rename NGINX to PROXY key
sed -i "s/NGINX/PROXY/g" /usr/local/vesta/data/users/*/web.conf
# Check template structure
TPL='/usr/local/vesta/data/templates/web'
if [ -e "$TPL/apache" ]; then
exit
mv $TPL/apache $TPL/httpd
fi
# Remove unused email template
rm -f $TPL/email_reset_password.tpl
# Apache
mkdir -p $TPL/apache
if [ ! -z "$(ls $TPL/| grep apache_)" ];then
mv $TPL/apache_* $TPL/apache/
for template in $(ls $TPL/apache/); do
new_name=$(echo $template |sed -e "s/apache_//")
mv -f $TPL/apache/$template $TPL/apache/$new_name
done
if [ -e $TPL/email_reset_password.tpl ]; then
rm -f $TPL/email_reset_password.tpl
fi
# Nginx
mkdir -p $TPL/nginx
# Update httpd templates
if [ ! -z "$(ls $TPL | grep apache_)" ]; then
mkdir -p $TPL/httpd
mv $TPL/apache_* $TPL/httpd/
for template in $(ls $TPL/httpd); do
new_name=$(echo $template | sed -e "s/apache_//")
mv -f $TPL/httpd/$template $TPL/httpd/$new_name
done
fi
if [ -e "$TPL/httpd" ]; then
sed -i -e "s/%elog%//g" \
-e "s/%cgi%//g" \
-e "s/%cgi_option%/+ExecCGI/g" $TPL/httpd/*
fi
# Update nginx templates
if [ ! -z "$(ls $TPL/| grep nginx_)" ];then
mkdir -p $TPL/nginx
mv $TPL/nginx_* $TPL/nginx/
for template in $(ls $TPL/nginx/); do
new_name=$(echo $template |sed -e "s/nginx_//")
@ -31,21 +73,38 @@ if [ ! -z "$(ls $TPL/| grep nginx_)" ];then
done
fi
if [ -e "$TPL/ngingx.ip.tpl" ]; then
mv $TPL/ngingx.ip.tpl $TPL/nginx/ip.tpl
mv $TPL/ngingx.ip.tpl $TPL/nginx/proxy_ip.tpl
fi
if [ -e "$TPL/nginx/ip.tpl" ]; then
mv $TPL/nginx/ip.tpl $TPL/nginx/proxy_ip.tpl
fi
if [ -e "$TPL/nginx" ]; then
sed -i -e "s/%elog%//g" \
-e "s/nginx_extentions/proxy_extentions/g" $TPL/nginx/*
fi
# Awstats
mkdir -p $TPL/awstats
# Move Awstats templates
if [ -e "$TPL/awstats.tpl" ]; then
mkdir -p $TPL/awstats
mv $TPL/awstats.tpl $TPL/awstats
mv $TPL/awstats_index.tpl $TPL/awstats/index.tpl
mv $TPL/awstats_nav.tpl $TPL/awstats/nav.tpl
fi
# Webalizer
mkdir -p $TPL/webalizer
# Move Webalizer templates
if [ -e "$TPL/webalizer.tpl" ]; then
mkdir -p $TPL/webalizer
mv $TPL/webalizer.tpl $TPL/webalizer
fi
# Update proxy ip configuration
for ip in $(ls /usr/local/vesta/data/ips); do
cat $TPL/nginx/proxy_ip.tpl |\
sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/8080/g" \
-e "s/%proxy_port%/80/g" \
> /etc/nginx/conf.d/$ip.conf
done
exit

View file

@ -21,11 +21,6 @@ if (!empty($_POST['ok'])) {
$v_domain = preg_replace("/^www./i", "", $_POST['v_domain']);
$v_domain = escapeshellarg($v_domain);
$v_ip = escapeshellarg($_POST['v_ip']);
if ($_SESSION['user'] == 'admin') {
$v_template = escapeshellarg($_POST['v_template']);
} else {
$v_template = "''";
}
if (!empty($_POST['v_ns1'])) $v_ns1 = escapeshellarg($_POST['v_ns1']);
if (!empty($_POST['v_ns2'])) $v_ns2 = escapeshellarg($_POST['v_ns2']);
@ -44,7 +39,7 @@ if (!empty($_POST['ok'])) {
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
} else {
// Add DNS
exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_template." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$ns4, $output, $return_var);
exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$ns4, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
@ -128,15 +123,7 @@ if (!empty($_POST['ok_rec'])) {
}
}
if ((empty($_GET['domain'])) && (empty($_POST['domain']))) {
exec (VESTA_CMD."v-get-user-value ".$user." 'TEMPLATE'", $output, $return_var);
$template = $output[0] ;
unset($output);
exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var);
$templates = json_decode(implode('', $output), true);
unset($output);
if ((empty($v_ns1)) && (empty($v_ns2))) {
exec (VESTA_CMD."v-list-user-ns ".$user." json", $output, $return_var);
$nameservers = json_decode(implode('', $output), true);

View file

@ -21,7 +21,9 @@ if ($_SESSION['user'] == 'admin') {
if (!empty($_POST['ok'])) {
// Check input
if (empty($_POST['v_package'])) $errors[] = __('package');
if (empty($_POST['v_template'])) $errors[] = __('template');
if (empty($_POST['v_web_template'])) $errors[] = __('web template');
if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template');
if (empty($_POST['v_dns_template'])) $errors[] = __('dns template');
if (empty($_POST['v_shell'])) $errrors[] = __('shell');
if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains');
if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases');
@ -40,7 +42,9 @@ if ($_SESSION['user'] == 'admin') {
// Protect input
$v_package = escapeshellarg($_POST['v_package']);
$v_template = escapeshellarg($_POST['v_template']);
$v_web_template = escapeshellarg($_POST['v_web_template']);
$v_proxy_template = escapeshellarg($_POST['v_proxy_template']);
$v_dns_template = escapeshellarg($_POST['v_dns_template']);
$v_shell = escapeshellarg($_POST['v_shell']);
$v_web_domains = escapeshellarg($_POST['v_web_domains']);
$v_web_aliases = escapeshellarg($_POST['v_web_aliases']);
@ -80,7 +84,9 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
// Create package
$pkg = "TEMPLATE=".$v_template."\n";
$pkg = "WEB_TEMPLATE=".$v_web_template."\n";
$pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n";
$pkg .= "DNS_TEMPLATE=".$v_dns_template."\n";
$pkg .= "WEB_DOMAINS=".$v_web_domains."\n";
$pkg .= "WEB_ALIASES=".$v_web_aliases."\n";
$pkg .= "DNS_DOMAINS=".$v_dns_domains."\n";
@ -129,7 +135,17 @@ if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-web-templates json", $output, $return_var);
check_error($return_var);
$templates = json_decode(implode('', $output), true);
$web_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var);
check_error($return_var);
$proxy_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var);
check_error($return_var);
$dns_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var);
@ -138,7 +154,9 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
// Set default values
if (empty($v_template)) $v_template = 'default';
if (empty($v_web_template)) $v_web_template = 'default';
if (empty($v_proxy_template)) $v_proxy_template = 'default';
if (empty($v_dns_template)) $v_dns_template = 'default';
if (empty($v_shell)) $v_shell = 'nologin';
if (empty($v_web_domains)) $v_web_domains = "'0'";
if (empty($v_web_aliases)) $v_web_aliases = "'0'";

View file

@ -25,26 +25,21 @@ $v_ftp_email = $panel[$user]['CONTACT'];
if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes';
if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes';
if ((!empty($_POST['v_ssl_ca'])) || ($_POST['v_stats'] != 'none')) $v_adv = 'yes';
if (empty($_POST['v_nginx'])) $v_adv = 'yes';
if (empty($_POST['v_proxy'])) $v_adv = 'yes';
if (!empty($_POST['v_ftp'])) $v_adv = 'yes';
$v_nginx_ext = 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, ';
$v_nginx_ext .= 'doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, ';
$v_nginx_ext .= 'mpeg, flv, html, htm';
if ($_POST['v_nginx_ext'] != $v_nginx_ext) $v_adv = 'yes';
$v_proxy_ext = 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, ';
$v_proxy_ext .= 'doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, ';
$v_proxy_ext .= 'mpeg, flv, html, htm';
if ($_POST['v_proxy_ext'] != $v_proxy_ext) $v_adv = 'yes';
// Protect input
$v_domain = preg_replace("/^www./i", "", $_POST['v_domain']);
$v_domain = escapeshellarg($v_domain);
$v_ip = escapeshellarg($_POST['v_ip']);
if ($_SESSION['user'] == 'admin') {
$v_template = escapeshellarg($_POST['v_template']);
} else {
$v_template = "''";
}
if (empty($_POST['v_dns'])) $v_dns = 'off';
if (empty($_POST['v_mail'])) $v_mail = 'off';
if (empty($_POST['v_nginx'])) $v_nginx = 'off';
if (empty($_POST['v_proxy'])) $v_proxy = 'off';
$v_aliases = $_POST['v_aliases'];
$v_elog = $_POST['v_elog'];
$v_ssl = $_POST['v_ssl'];
@ -55,11 +50,11 @@ $v_ftp_email = $panel[$user]['CONTACT'];
$v_stats = escapeshellarg($_POST['v_stats']);
$v_stats_user = $data[$v_domain]['STATS_USER'];
$v_stats_password = $data[$v_domain]['STATS_PASSWORD'];
$v_nginx_ext = preg_replace("/\n/", " ", $_POST['v_nginx_ext']);
$v_nginx_ext = preg_replace("/,/", " ", $v_nginx_ext);
$v_nginx_ext = preg_replace('/\s+/', ' ',$v_nginx_ext);
$v_nginx_ext = trim($v_nginx_ext);
$v_nginx_ext = str_replace(' ', ", ", $v_nginx_ext);
$v_proxy_ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']);
$v_proxy_ext = preg_replace("/,/", " ", $v_proxy_ext);
$v_proxy_ext = preg_replace('/\s+/', ' ',$v_proxy_ext);
$v_proxy_ext = trim($v_proxy_ext);
$v_proxy_ext = str_replace(' ', ", ", $v_proxy_ext);
$v_ftp = $_POST['v_ftp'];
$v_ftp_user = $_POST['v_ftp_user'];
$v_ftp_password = $_POST['v_ftp_password'];
@ -100,7 +95,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
if (empty($_SESSION['error_msg'])) {
// Add WEB
exec (VESTA_CMD."v-add-web-domain ".$user." ".$v_domain." ".$v_ip." ".$v_template." 'no'", $output, $return_var);
exec (VESTA_CMD."v-add-web-domain ".$user." ".$v_domain." ".$v_ip." 'no'", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
@ -176,11 +171,11 @@ $v_ftp_email = $panel[$user]['CONTACT'];
}
// Add Nginx
if (($_POST['v_nginx'] == 'on') && (empty($_SESSION['error_msg']))) {
$ext = str_replace(' ', '', $v_nginx_ext);
// Add proxy
if (($_POST['v_proxy'] == 'on') && (empty($_SESSION['error_msg']))) {
$ext = str_replace(' ', '', $v_proxy_ext);
$ext = escapeshellarg($ext);
exec (VESTA_CMD."v-add-web-domain-nginx ".$user." ".$v_domain." 'default' ".$ext." 'no'", $output, $return_var);
exec (VESTA_CMD."v-add-web-domain-proxy ".$user." ".$v_domain." ".$ext." 'no'", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
@ -272,7 +267,6 @@ $v_ftp_email = $panel[$user]['CONTACT'];
$from = __('MAIL_FROM',$hostname);
$mailtext .= __('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
send_email($to, $subject, $mailtext, $from);
//unset($v_ftp_email);
}
}
unset($v_ftp);
@ -298,6 +292,18 @@ $v_ftp_email = $panel[$user]['CONTACT'];
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
}
if (empty($_SESSION['error_msg'])) {
exec (VESTA_CMD."v-restart-proxy", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
}
if (empty($_SESSION['error_msg'])) {
unset($output);
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
unset($v_domain);
@ -314,14 +320,6 @@ $v_ftp_email = $panel[$user]['CONTACT'];
$ips = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-get-user-value ".$user." 'TEMPLATE'", $output, $return_var);
$template = $output[0] ;
unset($output);
exec (VESTA_CMD."v-list-web-templates json", $output, $return_var);
$templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-stats json", $output, $return_var);
$stats = json_decode(implode('', $output), true);
unset($output);

View file

@ -33,7 +33,9 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
$v_package = $_GET['package'];
$v_template = $data[$v_package]['TEMPLATE'];
$v_web_template = $data[$v_package]['WEB_TEMPLATE'];
$v_proxy_template = $data[$v_package]['PROXY_TEMPLATE'];
$v_dns_template = $data[$v_package]['DNS_TEMPLATE'];
$v_web_domains = $data[$v_package]['WEB_DOMAINS'];
$v_web_aliases = $data[$v_package]['WEB_ALIASES'];
$v_dns_domains = $data[$v_package]['DNS_DOMAINS'];
@ -59,7 +61,17 @@ if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-web-templates json", $output, $return_var);
check_error($return_var);
$templates = json_decode(implode('', $output), true);
$web_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var);
check_error($return_var);
$proxy_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var);
check_error($return_var);
$dns_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var);
@ -71,7 +83,9 @@ if ($_SESSION['user'] == 'admin') {
if (!empty($_POST['save'])) {
// Check input
if (empty($_POST['v_package'])) $errors[] = __('package');
if (empty($_POST['v_template'])) $errors[] = __('template');
if (empty($_POST['v_web_template'])) $errors[] = __('web template');
if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template');
if (empty($_POST['v_dns_template'])) $errors[] = __('dns template');
if (empty($_POST['v_shell'])) $errrors[] = __('shell');
if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains');
if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases');
@ -89,7 +103,9 @@ if ($_SESSION['user'] == 'admin') {
// Protect input
$v_package = escapeshellarg($_POST['v_package']);
$v_template = escapeshellarg($_POST['v_template']);
$v_web_template = escapeshellarg($_POST['v_web_template']);
$v_proxy_template = escapeshellarg($_POST['v_proxy_template']);
$v_dns_template = escapeshellarg($_POST['v_dns_template']);
$v_shell = escapeshellarg($_POST['v_shell']);
$v_web_domains = escapeshellarg($_POST['v_web_domains']);
$v_web_aliases = escapeshellarg($_POST['v_web_aliases']);
@ -129,7 +145,9 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
// Create package
$pkg = "TEMPLATE=".$v_template."\n";
$pkg = "WEB_TEMPLATE=".$v_web_template."\n";
$pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n";
$pkg .= "DNS_TEMPLATE=".$v_dns_template."\n";
$pkg .= "WEB_DOMAINS=".$v_web_domains."\n";
$pkg .= "WEB_ALIASES=".$v_web_aliases."\n";
$pkg .= "DNS_DOMAINS=".$v_dns_domains."\n";

View file

@ -32,7 +32,6 @@ if ($_SESSION['user'] == 'admin') {
$v_username = $_GET['user'];
$v_password = "••••••••";
$v_email = $data[$v_username]['CONTACT'];
$v_template = $data[$v_username]['TEMPLATE'];
$v_package = $data[$v_username]['PACKAGE'];
$v_language = $data[$v_username]['LANGUAGE'];
$v_fname = $data[$v_username]['FNAME'];
@ -61,10 +60,6 @@ if ($_SESSION['user'] == 'admin') {
$languages = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-templates json", $output, $return_var);
$templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var);
$shells = json_decode(implode('', $output), true);
unset($output);
@ -113,18 +108,6 @@ if ($_SESSION['user'] == 'admin') {
unset($output);
}
// Change template
if (($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) {
$v_template = escapeshellarg($_POST['v_template']);
exec (VESTA_CMD."v-change-user-template ".$v_username." ".$v_template, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
}
// Change shell
if (($v_shell != $_POST['v_shell']) && (empty($_SESSION['error_msg']))) {
$v_shell = escapeshellarg($_POST['v_shell']);

View file

@ -54,8 +54,9 @@ if ($return_var != 0) {
$v_ssl_ca = $ssl_str[$v_domain]['CA'];
}
$v_ssl_home = $data[$v_domain]['SSL_HOME'];
$v_nginx = $data[$v_domain]['NGINX'];
$v_nginx_ext = str_replace(',', ', ', $data[$v_domain]['NGINX_EXT']);
$v_proxy = $data[$v_domain]['PROXY'];
$v_proxy_template = $data[$v_domain]['PROXY'];
$v_proxy_ext = str_replace(',', ', ', $data[$v_domain]['PROXY_EXT']);
$v_stats = $data[$v_domain]['STATS'];
$v_stats_user = $data[$v_domain]['STATS_USER'];
if (!empty($v_stats_user)) $v_stats_password = "••••••••";
@ -78,6 +79,10 @@ if ($return_var != 0) {
$templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var);
$proxy_templates = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-web-stats json", $output, $return_var);
$stats = json_decode(implode('', $output), true);
unset($output);
@ -200,56 +205,56 @@ if (!empty($_POST['save'])) {
}
}
// Nginx
if ((!empty($v_nginx)) && (empty($_POST['v_nginx'])) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-delete-web-domain-nginx ".$v_username." ".$v_domain." 'no'", $output, $return_var);
// Proxy
if ((!empty($v_proxy)) && (empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-delete-web-domain-proxy ".$v_username." ".$v_domain." 'no'", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
unset($v_nginx);
$restart_web = 'yes';
unset($v_proxy);
$restart_proxy = 'yes';
}
if ((!empty($v_nginx)) && (!empty($_POST['v_nginx'])) && (empty($_SESSION['error_msg']))) {
$ext = preg_replace("/\n/", " ", $_POST['v_nginx_ext']);
if ((!empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) {
$ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']);
$ext = preg_replace("/,/", " ", $ext);
$ext = preg_replace('/\s+/', ' ',$ext);
$ext = trim($ext);
$ext = str_replace(' ', ", ", $ext);
if ( $v_nginx_ext != $ext ) {
if (( $v_proxy_template != $_POST['v_proxy_template']) || ($v_proxy_ext != $ext)) {
$ext = str_replace(', ', ",", $ext);
exec (VESTA_CMD."v-change-web-domain-nginx-tpl ".$v_username." ".$v_domain." 'default' ".escapeshellarg($ext)." 'no'", $output, $return_var);
exec (VESTA_CMD."v-change-web-domain-proxy-tpl ".$v_username." ".$v_domain." ".escapeshellarg($_POST['v_proxy_template'])." ".escapeshellarg($ext)." 'no'", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_nginx_ext = str_replace(',', ', ', $ext);
$v_proxy_template = $_POST['v_proxy_template'];
$v_proxy_ext = str_replace(',', ', ', $ext);
unset($output);
$restart_web = 'yes';
$restart_proxy = 'yes';
}
}
if ((empty($v_nginx)) && (!empty($_POST['v_nginx'])) && (empty($_SESSION['error_msg']))) {
$nginx_ext = "'jpg,jpeg,gif,png,ico,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,tar,wav,bmp,rtf,js,mp3,avi,mpeg,html,htm'";
if (!empty($_POST['v_nginx_ext'])) {
$ext = preg_replace("/\n/", " ", $_POST['v_nginx_ext']);
if ((empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) {
$v_proxy_template = $_POST['v_proxy_template'];
if (!empty($_POST['v_proxy_ext'])) {
$ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']);
$ext = preg_replace("/,/", " ", $ext);
$ext = preg_replace('/\s+/', ' ',$ext);
$ext = trim($ext);
$ext = str_replace(' ', ",", $ext);
$v_nginx_ext = str_replace(',', ', ', $ext);
$v_proxy_ext = str_replace(',', ', ', $ext);
}
exec (VESTA_CMD."v-add-web-domain-nginx ".$v_username." ".$v_domain." 'default' ".escapeshellarg($ext)." 'no'", $output, $return_var);
exec (VESTA_CMD."v-add-web-domain-proxy ".$v_username." ".$v_domain." ".escapeshellarg($v_proxy_template)." ".escapeshellarg($ext)." 'no'", $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = __('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
$v_nginx = 'default';
$restart_web = 'yes';
$restart_proxy = 'yes';
}
// SSL

View file

@ -134,6 +134,9 @@ $LANG['en'] = array(
'Databases' => 'Databases',
'User Directories' => 'User Directories',
'Template' => 'Template',
'Web Template' => 'Apache Template',
'Proxy Template' => 'Nginx Template',
'DNS Template' => 'DNS Template',
'Web Domains' => 'Web Domains',
'SSL Domains' => 'SSL Domains',
'Web Aliases' => 'Web Aliases',
@ -151,8 +154,8 @@ $LANG['en'] = array(
'template' => 'template',
'SSL Support' => 'SSL Support',
'SSL Home Directory' => 'SSL Home',
'Nginx Support' => 'Nginx Support',
'Nginx Extentions' => 'Nginx Extentions',
'Proxy Support' => 'Nginx Support',
'Proxy Extentions' => 'Nginx Extentions',
'Web Statistics' => 'Web Statistics',
'Additional FTP Account' => 'Additional FTP',
'SOA' => 'SOA',
@ -231,8 +234,6 @@ $LANG['en'] = array(
'Mail Support' => 'Mail Support',
'Advanced options' => 'Advanced options',
'Aliases' => 'Aliases',
'Apache template' => 'Apache template',
'Nginx template' => 'Nginx template',
'SSL Certificate' => 'SSL Certificate',
'SSL Key' => 'SSL Key',
'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate',

View file

@ -133,6 +133,9 @@ $LANG['es'] = array(
'Databases' => 'Base de Datos',
'User Directories' => 'Directorios de Usuario',
'Template' => 'Plantilla',
'Web Template' => 'Plantilla Apache',
'Proxy Template' => 'Plantilla Nginx',
'DNS Template' => 'Plantilla DNS',
'Web Domains' => 'Dominios Web',
'SSL Domains' => 'Dominios SSL',
'Web Aliases' => 'Alias Web',
@ -150,8 +153,8 @@ $LANG['es'] = array(
'template' => 'plantilla',
'SSL Support' => 'Soporte SSL',
'SSL Home Directory' => 'SSL Home',
'Nginx Support' => 'Soporte Nginx',
'Nginx Extentions' => 'Extensiones Nginx',
'Proxy Support' => 'Soporte Nginx',
'Proxy Extentions' => 'Extensiones Nginx',
'Web Statistics' => 'Estadísticas Web',
'Additional FTP Account' => 'Cuenta Adicional FTP',
'SOA' => 'SOA',
@ -230,8 +233,6 @@ $LANG['es'] = array(
'Mail Support' => 'Soporte para Correo',
'Advanced options' => 'Opciones Avanzadas',
'Aliases' => 'Aliases',
'Apache template' => 'Plantilla Apache',
'Nginx template' => 'Plantilla Nginx',
'SSL Certificate' => 'Certificado SSL',
'SSL Key' => 'Llave SSL',
'SSL Certificate Authority / Intermediate' => 'Certificado SSL Autoridad / Intermedio',

View file

@ -135,6 +135,9 @@ $LANG['ro'] = array(
'Databases' => 'Baze de date',
'User Directories' => 'Directoare utilizator',
'Template' => 'Șablon',
'Web Template' => 'Șablonul Apache',
'Proxy Template' => 'Șablonul Nginx',
'DNS Template' => 'Șablonul DNS',
'Web Domains' => 'Web domenii',
'SSL Domains' => 'SSL domenii',
'Web Aliases' => 'Web aliasuri',
@ -152,8 +155,8 @@ $LANG['ro'] = array(
'template' => 'șablon',
'SSL Support' => 'Support SSL',
'SSL Home Directory' => 'Mapa SSL',
'Nginx Support' => 'Support Nginx',
'Nginx Extentions' => 'Extensii Nginx',
'Proxy Support' => 'Support Nginx',
'Proxy Extentions' => 'Extensii Nginx',
'Web Statistics' => 'Statistici web',
'Additional FTP Account' => 'Cont suplimentar FTP',
'SOA' => 'SOA',
@ -232,8 +235,6 @@ $LANG['ro'] = array(
'Mail Support' => 'Support E-mail',
'Advanced options' => 'Opțiuni avansate',
'Aliases' => 'Aliasuri',
'Apache template' => 'Șablonul Apache',
'Nginx template' => 'Șablonul Nginx',
'SSL Certificate' => 'Certificat SSL',
'SSL Key' => 'Cheia SSL',
'SSL Certificate Authority / Intermediate' => 'SSL Intermediar / Certificate Authority',

View file

@ -135,6 +135,9 @@ $LANG['ru'] = array(
'Databases' => 'Базы данных',
'User Directories' => 'Папки пользователя',
'Template' => 'Шаблон',
'Web Template' => 'Шаблон Apache',
'Proxy Template' => 'Шаблон Nginx',
'DNS Template' => 'DNS Template',
'Web Domains' => 'Веб домены',
'SSL Domains' => 'SSL домены',
'Web Aliases' => 'Веб алиасы',
@ -152,8 +155,8 @@ $LANG['ru'] = array(
'template' => 'шаблон',
'SSL Support' => 'Поддержка SSL',
'SSL Home Directory' => 'Директория SSL',
'Nginx Support' => 'Поддержка Nginx',
'Nginx Extentions' => 'Обработка Nginx',
'Proxy Support' => 'Поддержка Nginx',
'Proxy Extentions' => 'Обработка Nginx',
'Web Statistics' => 'Статистика сайта',
'Additional FTP Account' => 'Дополнительный ftp',
'SOA' => 'SOA',
@ -232,8 +235,6 @@ $LANG['ru'] = array(
'Mail Support' => 'Поддержка почты',
'Advanced options' => 'Дополнительные опции',
'Aliases' => 'Алиасы',
'Apache template' => 'Шаблон Apache',
'Nginx template' => 'Шаблон для Nginx',
'SSL Certificate' => 'SSL сертификат',
'SSL Key' => 'Ключ SSL сертификата',
'SSL Certificate Authority / Intermediate' => 'Центр сертификации SSL / Intermediate',

View file

@ -135,6 +135,9 @@ $LANG['ua'] = array(
'Databases' => 'Бази даних',
'User Directories' => 'Теки Користувача',
'Template' => 'Шаблон',
'Web Template' => 'Шаблон Apache',
'Proxy Template' => 'Шаблон Nginx',
'DNS Template' => 'Шаблон DNS',
'Web Domains' => 'Веб домени',
'SSL Domains' => 'SSL домени',
'Web Aliases' => 'Веб аліаси',
@ -152,8 +155,8 @@ $LANG['ua'] = array(
'template' => 'шаблон',
'SSL Support' => 'Підтримка SSL',
'SSL Home Directory' => 'Тека SSL',
'Nginx Support' => 'Підтримка Nginx',
'Nginx Extentions' => 'Опрацювання Nginx',
'Proxy Support' => 'Підтримка Nginx',
'Proxy Extentions' => 'Опрацювання Nginx',
'Web Statistics' => 'Статистика сайту',
'Additional FTP Account' => 'Додатковий ftp',
'SOA' => 'SOA',
@ -232,8 +235,6 @@ $LANG['ua'] = array(
'Mail Support' => 'Підтримка пошти',
'Advanced options' => 'Додаткові опції',
'Aliases' => 'Аліаси',
'Apache template' => 'Шаблон Apache',
'Nginx template' => 'Шаблон Nginx',
'SSL Certificate' => 'SSL сертификат',
'SSL Key' => 'Ключ SSL сертифікату',
'SSL Certificate Authority / Intermediate' => 'Центр сертифікації SSL / Intermediate',

View file

@ -150,17 +150,17 @@ function humanize_usage($usage) {
if ( $usage > 1000 ) {
$usage = $usage / 1000 ;
$usage = number_format($usage, 2);
$usage = $usage." ".__('pb');
$usage = $usage."".__('pb');
} else {
$usage = number_format($usage, 2);
$usage = $usage." ".__('tb');
$usage = $usage."".__('tb');
}
} else {
$usage = number_format($usage, 2);
$usage = $usage." ".__('gb');
$usage = $usage."".__('gb');
}
} else {
$usage = $usage." ".__('mb');
$usage = $usage."".__('mb');
}
return $usage;
}

View file

@ -67,7 +67,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Database');?>
</td>
</tr>
@ -97,7 +97,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Type');?>
</td>
</tr>
@ -115,7 +115,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Charset');?>
</td>
</tr>

View file

@ -81,29 +81,6 @@
<tr>
<td class="vst-text" style="padding: 10px 0 0 0px;">
<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_template">
<?php
foreach ($templates as $key => $value) {
echo "\n\t\t\t\t\t\\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_template)) && ( $value == $_POST['v_template'])){
echo ' selected' ;
}
if ((empty($v_template)) && ( $value == $template)){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Expiration Date');?> <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(<?php print __('YYYY-MM-DD');?>)</span>

View file

@ -54,19 +54,65 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Default Template');?>
<?php print __('Web Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_template">
<select class="vst-list" name="v_web_template">
<?php
foreach ($templates as $key => $value) {
foreach ($web_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_template)) && ( $value == $v_template)){
if ((!empty($v_web_template)) && ( $value == $v_web_template)){
echo 'selected' ;
}
if ((!empty($v_template)) && ( $value == $_POST['v_template'])){
if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
echo 'selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Proxy Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_proxy_template">
<?php
foreach ($proxy_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
echo 'selected' ;
}
if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
echo 'selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('DNS Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_dns_template">
<?php
foreach ($dns_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
echo 'selected' ;
}
if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
echo 'selected' ;
}
echo ">".$value."</option>\n";

View file

@ -143,7 +143,7 @@
</table>
<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Aliases');?>
</td>
</tr>
@ -154,48 +154,25 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Apache template');?>
<?php print __('Proxy Support');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_template">
<?php
foreach ($templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_template)) && ( $value == $_POST['v_template'])){
echo ' selected' ;
}
if ((empty($v_template)) && ( $value == $template)){
echo ' selected' ;
}
echo "> ".$value." </option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Nginx Support');?>
<input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if ($v_proxy !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');">
</td>
</tr>
<tr>
<td>
<input type="checkbox" size="20" class="vst-checkbox" name="v_nginx" <?php if ($v_nginx !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('nginxtable');">
</td>
</tr>
<tr>
<td>
<table style="display:<?php if ($v_nginx == 'off') { echo 'none';} else {echo 'block';}?>;" id="nginxtable" >
<table style="display:<?php if ($v_proxy == 'off') { echo 'none';} else {echo 'block';}?>;" id="proxytable" >
<tr>
<td class="vst-text" style="padding: 9px 0 0 0;">
<?php print __('Nginx Extentions');?>
<?php print __('Proxy Extentions');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput" name="v_nginx_ext"><?php if (!empty($v_nginx_ext)) { echo $v_nginx_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
<textarea size="20" class="vst-textinput" name="v_proxy_ext"><?php if (!empty($v_proxy_ext)) { echo $v_proxy_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
</td>
</tr>
</table>

View file

@ -34,8 +34,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>

View file

@ -54,8 +54,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>
@ -99,7 +99,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Type');?>
</td>
</tr>
@ -109,7 +109,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Host');?>
</td>
</tr>
@ -119,7 +119,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Charset');?>
</td>
</tr>

View file

@ -33,8 +33,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>

View file

@ -33,8 +33,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>

View file

@ -45,8 +45,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>

View file

@ -33,8 +33,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status); ?></b></td></tr>

View file

@ -54,8 +54,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>

View file

@ -33,8 +33,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>
@ -55,24 +55,71 @@
<tr>
<td>
<input type="text" size="20" class="vst-input" name="v_package" <?php if (!empty($v_package)) echo "value=".$v_package; ?> disabled >
<input type="hidden" name="v_package" <?php if (!empty($v_package)) echo "value=".$v_package; ?>>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Default Template');?>
<?php print __('Web Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_template">
<select class="vst-list" name="v_web_template">
<?php
foreach ($templates as $key => $value) {
foreach ($web_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_template)) && ( $value == $v_template)){
echo 'selected' ;
if ((!empty($v_web_template)) && ( $value == $v_web_template)){
echo ' selected' ;
}
if ((!empty($v_template)) && ( $value == $_POST['v_template'])){
echo 'selected' ;
if ((!empty($v_web_template)) && ( $value == $_POST['v_web_template'])){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Proxy Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_proxy_template">
<?php
foreach ($proxy_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template)){
echo ' selected' ;
}
if ((!empty($v_proxy_template)) && ( $value == $_POST['v_proxy_template'])){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('DNS Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_dns_template">
<?php
foreach ($dns_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_dns_template)) && ( $value == $v_dns_template)){
echo ' selected' ;
}
if ((!empty($v_dns_template)) && ( $value == $_POST['v_dns_template'])){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
@ -92,10 +139,10 @@
foreach ($shells as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
if ((!empty($v_shell)) && ( $value == $v_shell)){
echo 'selected' ;
echo ' selected' ;
}
if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
echo 'selected' ;
echo ' selected' ;
}
echo ">".$value."</option>\n";
}

View file

@ -45,8 +45,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status); ?></b></td></tr>
@ -155,27 +155,6 @@
<input type="text" size="20" class="vst-input" name="v_lname" <?php if (!empty($v_lname)) echo "value=".$v_lname; ?>>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;" >
<?php print __('Default Template');?>
</td>
</tr>
<tr>
<td>
<select class="vst-list" name="v_template">
<?php
foreach ($templates as $key => $value) {
echo "\n\t\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
$svalue = "'".$value."'";
if (( $value == $v_template ) || ($svalue == $v_template )){
echo 'selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;" >
<?php print __('SSH Access');?>

View file

@ -65,8 +65,8 @@
<table class="data-col1">
<tr>
<td style="padding: 24px 0 2px 18px;">
<a class="data-date" ?><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date" ?><?php echo $v_time?></a>
<a class="data-date"><?php echo strftime("%d %b %Y", strtotime($v_date))?></a><br>
<a class="data-date"><?php echo $v_time?></a>
</td>
</tr>
<tr><td style="padding: 0 0 0 18px;" class="data-<?php echo $v_status ?>"><b><?php echo __($v_status) ?></b></td></tr>
@ -113,7 +113,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Aliases');?>
</td>
</tr>
@ -124,7 +124,7 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Template');?>
<?php print __('Web Template');?>
</td>
</tr>
<tr>
@ -145,25 +145,49 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Nginx Support');?>
<?php print __('Proxy Support');?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" size="20" class="vst-checkbox" name="v_nginx" <?php if (!empty($v_nginx)) echo "checked=yes" ?> onclick="javascript:elementHideShow('nginxtable');">
<input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if (!empty($v_proxy)) echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');">
</td>
</tr>
<tr>
<td>
<table style="display:<?php if (empty($v_nginx)) { echo 'none';} else {echo 'block';}?> ;" id="nginxtable">
<table style="display:<?php if (empty($v_proxy)) { echo 'none';} else {echo 'block';}?> ;" id="proxytable">
<tr>
<td class="vst-text" style="padding: 9px 0 0 0;">
<?php print __('Nginx Extensions');?>
<td class="vst-text" style="padding: 9px 0 0 2px;">
<?php print __('Proxy Template');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput" name="v_nginx_ext"><?php if (!empty($v_nginx_ext)) { echo $v_nginx_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
<select class="vst-list" name="v_proxy_template">
<?php
foreach ($proxy_templates as $key => $value) {
echo "\t\t\t\t<option value=\"".$value."\"";
$svalue = "'".$value."'";
if ((!empty($v_proxy_template)) && ( $value == $v_proxy_template ) || ($svalue == $v_proxy_template)){
echo ' selected' ;
}
if ((empty($v_proxy_template)) && ($value == 'default')){
echo ' selected' ;
}
echo ">".$value."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 0;">
<?php print __('Proxy Extensions');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput" name="v_proxy_ext"><?php if (!empty($v_proxy_ext)) { echo $v_proxy_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
</td>
</tr>
</table>

View file

@ -64,12 +64,12 @@
$cron = __('no');
$udir = __('no');
if (!empty($data[$key]['WEB'])) $web = __('yes').' ¨';
if (!empty($data[$key]['DNS'])) $dns = __('yes').' ¨';
if (!empty($data[$key]['MAIL'])) $mail = __('yes').' ¨';
if (!empty($data[$key]['DB'])) $db = __('yes').' ¨';
if (!empty($data[$key]['CRON'])) $cron = __('yes').' ¨';
if (!empty($data[$key]['UDIR'])) $udir = __('yes').' ¨';
if (!empty($data[$key]['WEB'])) $web = __('yes');
if (!empty($data[$key]['DNS'])) $dns = __('yes');
if (!empty($data[$key]['MAIL'])) $mail = __('yes');
if (!empty($data[$key]['DB'])) $db = __('yes');
if (!empty($data[$key]['CRON'])) $cron = __('yes');
if (!empty($data[$key]['UDIR'])) $udir = __('yes');
?>
@ -114,18 +114,10 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 0 0">
<?php echo __($data[$key]['TYPE']) ?>
</td>
</tr>
<tr>
<td class="chart1">
<?php print __('Run Time');?>: <?php echo humanize_time($data[$key]['RUNTIME']) ?>
</td>
</tr>
<tr>
<td class="chart1">
<?php print __('Backup Size');?>: <?php echo humanize_usage($data[$key]['SIZE']) ?>
<td class="chart1" style="padding: 10px 0 0px 2px"><?php print __('Backup Size');?>: <?php echo humanize_usage($data[$key]['SIZE']) ?>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['SIZE'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
@ -133,32 +125,20 @@
<td style="vertical-align:top;" width="250">
<table>
<tr>
<td class="counter-name" width="48">
<?php print __('WEB');?>:
<td class="counter-name">
<?php print __('Type');?>:
</td>
<td>
<td class="counter-value">
<?php echo $data[$key]['TYPE'] ?>
</td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Consistent');?>:
</td>
<td class="counter-value">
<a class="counter-value" title="<?php echo str_replace(',', ', ', $data[$key]['WEB']) ?>">
<?php echo $web ?>
</a>
</td>
</tr>
<tr>
<td class="counter-name" width="48">
<?php print __('DNS');?>:
</td>
<td>
<a class="counter-value" title="<?php echo str_replace(',', ', ', $data[$key]['DNS']) ?>">
<?php echo $dns ?>
</a>
</td>
</tr>
<tr>
<td class="counter-name" width="48">
<?php print __('MAIL');?>:
</td>
<td>
<a class="counter-value" title="<?php echo str_replace(',', ', ', $data[$key]['MAIL']) ?>">
<?php echo $mail ?>
<?php print __($web) ?>
</a>
</td>
</tr>
@ -167,36 +147,13 @@
<td rowspan=4 style="vertical-align:top;" width="300">
<table>
<tr>
<td class="counter-name" width="90">
<?php print __('DB');?>:
<td class="counter-name">
<?php print __('Run Time');?>:
</td>
<td>
<a class="counter-value" title="<?php echo str_replace(',', ', ', $data[$key]['DB']) ?>">
<?php echo $db ?>
</a>
<td class="counter-value">
<?php echo humanize_time($data[$key]['RUNTIME']) ?>
</td>
</tr>
<tr>
<td class="counter-name" width="90">
<?php print __('CRON');?>:
</td>
<td>
<a class="counter-value" title="<?php echo $data[$key]['CRON'] ?>">
<?php echo $cron ?>
</a>
</td>
</tr>
<tr>
<td class="counter-name" width="90">
<?php print __('USER DIRS');?>:
</td>
<td>
<a class="counter-value" title="<?php echo str_replace(',', ', ', $data[$key]['UDIR']) ?>">
<?php echo $udir ?>
</a>
</td>
</tr>
</table>
</td>
</tr>

View file

@ -100,20 +100,15 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 4px 2px">
[<?php echo $data[$key]['TYPE'] ?>] <?php print __('database');?>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0px 0 0px 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<td class="chart1" style="padding: 10px 0 0px 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name">
@ -143,6 +138,14 @@
<?php echo $data[$key]['CHARSET'] ?>
</td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Type');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['TYPE'] ?>
</td>
</tr>
</table>
</td>
</tr>

View file

@ -103,34 +103,30 @@
<td class="counter-name" style="padding: 2px 0 0 2px;">
<?php echo $data[$key]['IP'] ?>
</td>
<tr>
<td class="counter-name" style="padding: 0 0 20px 2px">
[<?php echo $data[$key]['TPL'] ?>] <?php print __('template');?>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="270">
<table>
<tr>
<td class="counter-name"><?php print __('Template') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['TPL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SOA') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('TTL') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['TTL'] ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="300">
<table>
<tr>
<td class="counter-name"><?php print __('Expire');?>:</td>
<td class="counter-value"><?php echo strftime("%d %b %Y", strtotime($data[$key]['EXP'])) ?></td>
<td class="counter-name"><?php print __('TTL') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['TTL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Records');?>:</td>
<td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
<td class="counter-name"><?php print __('Expire');?>:</td>
<td class="counter-value"><?php echo strftime("%d %b %Y", strtotime($data[$key]['EXP'])) ?></td>
</tr>
</table>
</td>

View file

@ -109,21 +109,16 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 2px 0">
<?php print __('Catchall email');?> > <?php echo $data[$key]['CATCHALL'] ?>
</td>
</tr>
<tr>
<td class="chart1">
<td class="chart1" style="padding: 10px 0 2px 0">
<?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name">
@ -155,10 +150,10 @@
</tr>
<tr>
<td class="counter-name">
<?php print __('Accounts');?>:
<?php print __('Catchall email');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['ACCOUNTS'] ?>
<?php echo $data[$key]['CATCHALL'] ?>
</td>
</tr>
</table>

View file

@ -97,10 +97,10 @@
<td class="counter-name" style="padding: 4px 0 0 0;">
</td>
<tr>
<td class="chart1" style="padding: 0 0 2px 0">
<td class="chart1" style="padding: 2px 0 2px 0">
<?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>

View file

@ -69,34 +69,30 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 4px 0px 0px 0;" >
<?php print __('Template');?>:
</td>
<td class="counter-value" style="padding: 4px 0 0 6px;">
<?php echo $data[$key]['TEMPLATE'] ?>
</td>
<td class="counter-name"><?php print __('Web Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['WEB_TEMPLATE'] ?> </td>
</tr>
<tr>
<td class="counter-name" style="padding: 0px 0px 6px 0;">
<?php print __('SSH Access');?>:
</td>
<td class="counter-value" width="58px">
<?php echo $data[$key]['SHELL'] ?>
</td>
<td class="counter-name"><?php print __('Proxy Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['PROXY_TEMPLATE'] ?> </td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<td class="counter-name"><?php print __('DNS Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['DNS_TEMPLATE'] ?> </td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 8px 0 0 2px;">
<?php print __('Bandwidth');?>: <?php echo humanize_usage($data[$key]['BANDWIDTH']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:0%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:0%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['DISK_QUOTA']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:0%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:0%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
@ -105,88 +101,51 @@
<td style="vertical-align:top;" width="300">
<table width="300">
<tr>
<td class="counter-name" width="37%">
<?php print __('Web Domains');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['WEB_DOMAINS'] ?>
</td>
<td class="counter-name" width="37%"><?php print __('Web Domains');?>:</td>
<td class="counter-value"><?php echo $data[$key]['WEB_DOMAINS'] ?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Web Aliases');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['WEB_ALIASES'] ?> <?php print __('per domain');?>
</td>
<td class="counter-name"><?php print __('Web Aliases');?>:</td>
<td class="counter-value"><?php echo $data[$key]['WEB_ALIASES'] ?> <?php print __('per domain');?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('DNS domains');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['DNS_DOMAINS'] ?>
</td>
<td class="counter-name"><?php print __('DNS domains');?>:</td>
<td class="counter-value"><?php echo $data[$key]['DNS_DOMAINS'] ?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('DNS records');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['DNS_RECORDS'] ?> <?php print __('per domain');?>
</td>
<td class="counter-name"><?php print __('DNS records');?>:</td>
<td class="counter-value"><?php echo $data[$key]['DNS_RECORDS'] ?> <?php print __('per domain');?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Name Servers');?>:
</td>
<td class="counter-value">
<?php echo str_replace(',', ', ',$data[$key]['NS']) ?>
</td>
<td class="counter-name"><?php print __('Name Servers');?>:</td>
<td class="counter-value"><?php echo str_replace(',', ', ',$data[$key]['NS']) ?> </td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="280">
<table class="data-col4" width="280">
<tr>
<td class="counter-name" width="48%">
<?php print __('Mail Domains');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['MAIL_DOMAINS'] ?>
</td>
<td class="counter-name" width="48%"><?php print __('Mail Domains');?>:</td>
<td class="counter-value"><?php echo $data[$key]['MAIL_DOMAINS'] ?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Mail Accounts');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['MAIL_ACCOUNTS'] ?> <?php print __('per domain');?>
</td>
<td class="counter-name"><?php print __('Mail Accounts');?>:</td>
<td class="counter-value"><?php echo $data[$key]['MAIL_ACCOUNTS'] ?> <?php print __('per domain');?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Databases');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['DATABASES'] ?>
</td>
<td class="counter-name"><?php print __('Databases');?>:</td>
<td class="counter-value"><?php echo $data[$key]['DATABASES'] ?> </td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Cron Jobs');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['CRON_JOBS'] ?>
</td>
<td class="counter-name"><?php print __('Cron Jobs');?>:</td>
<td class="counter-value"><?php echo $data[$key]['CRON_JOBS'] ?> </td>
</tr>
<td class="counter-name"><?php print __('SSH Access');?>:</td>
<td class="counter-value"><?php echo $data[$key]['SHELL'] ?></td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Backups');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['BACKUPS'] ?>
</td>
<td class="counter-name"><?php print __('Backups');?>:</td>
<td class="counter-value"><?php echo $data[$key]['BACKUPS'] ?></td>
</tr>
</table>
</td>

View file

@ -1,10 +1,15 @@
<table class="submenu">
<tr>
<td style="padding: 2px 0 0 6px">
<div class="submenu-button-block">
<div class="submenu-search-block">
<form action="/search/" method="get">
<input type="text" name="q" class="submenu-search-field">
<input type="submit" value="<?php print __('Search');?>" class="submenu-button" style="width: 96px;">
</form>
</div>
<div class="submenu-select-block" style="padding-left:8px;">
<form action="/list/stats/" method="get" id="objects">
<a class="vst<?php if (empty($_GET['user'])) echo "-selected"; ?>" href='/list/stats/'><?php print __('Overall Statistics');?></a>
<div class="submenu-select-block">
<a class="vst<?php if (empty($_GET['user'])) echo "-selected"; ?>" style="padding: 0 12px 0 0;" href='/list/stats/'><?php print __('Overall Statistics');?></a>
<select class="submenu-select-dropdown" name="user">
<option value=""><?php print __('show per user');?></option>
<?php
@ -17,18 +22,9 @@
}
?>
</select>
<input type="submit" name="ok" value="" class="submenu-button" style="width: 36px;">
</div>
<input type="submit" name="list" value="" class="button" style="width: 37px;font-size: 12px; height: 24px;">
</form>
</div>
<div class="submenu-search-block">
<form action="/search/" method="get">
<input type="text" name="q" class="submenu-search-field">
<input type="submit" value="<?php print __('Search');?>" class="submenu-button" style="width: 96px;">
</form>
</div>
</td>
</tr>
</table>
@ -62,23 +58,18 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td colspan=2 class="counter-name" style="padding: 2px 0px 6px 2px;">
[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<td class="chart1" colspan=2 style="padding: 4px 0 0 2px;">
<?php print __('Bandwidth');?>: <?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>% (<?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<?php print __('Disk');?>: <?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>% (<?php echo humanize_usage($data[$key]['U_DISK']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
@ -87,12 +78,18 @@
<table class="chart2">
<tr>
<td>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?>
</td>
<td style="padding: 0px 10px 0px 8px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?><br>
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?><br>
<td style="padding: 0px 0px 0px 4px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?>
</td>
</tr>
<tr>
<td>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?>
</td>
<td style="padding: 0px 0px 0px 4px">
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?>
</td>
</tr>
</table>

View file

@ -138,35 +138,42 @@
<td colspan=3 class="username" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b><a class="fullname"><?php echo $data[$key]['FNAME']?> <?php echo $data[$key]['LNAME']?></a></td>
</tr>
<tr>
<td style="vertical-align:top;" width="240">
<td style="vertical-align:top;" width="260">
<table>
<tr><td colspan=2 class="counter-name" style="padding: 2px 0 0 2px;"><?php echo $data[$key]['CONTACT']?></td></tr>
<tr><td colspan=2 class="counter-name" style="padding: 0 0 18px 2px;">[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?></td></tr>
<tr><td colspan=2 class="counter-name" style="padding: 0 0 8px 2px;">[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?></td></tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 3px;"><?php print __('Bandwidth');?>: <?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>% (<?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 3px;"><?php print __('Disk');?>: <?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>% (<?php echo humanize_usage($data[$key]['U_DISK']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td colspan=2>
<td colspan=2 style="padding: 2px 0 0 0;">
<table class="chart2">
<tr>
<td>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?>
</td>
<td style="padding: 0px 10px 0px 8px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?><br>
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?><br>
<td style="padding: 0px 0px 0px 4px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?>
</td>
</tr>
<tr>
<td>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?>
</td>
<td style="padding: 0px 0px 0px 4px">
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?>
</td>
</tr>
</table>
@ -174,12 +181,8 @@
</tr>
</table>
</td>
<td style="vertical-align:top;" width="320">
<table width="300">
<tr>
<td class="counter-name" width="36%"><?php print __('Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['TEMPLATE'] ?></td>
</tr>
<td style="vertical-align:top;" width="300">
<table width="290">
<tr>
<td class="counter-name"><?php print __('Web Domains');?>:</td>
<td class="counter-value"><?php echo $data[$key]['U_WEB_DOMAINS'] ?> / <?php echo $data[$key]['WEB_DOMAINS'] ?></td>

View file

@ -59,19 +59,19 @@
if (!empty($data[$key]['FTP_USER'])) {
$ftp_user=$data[$key]['FTP_USER'];
}
$nginx_support='no';
if (!empty($data[$key]['NGINX'])) {
$nginx_support='yes';
$proxy_support='no';
if (!empty($data[$key]['PROXY'])) {
$proxy_support='yes';
}
if (strlen($data[$key]['NGINX_EXT']) > 16 ) {
$nginx_ext_title = str_replace(',', ', ', $data[$key]['NGINX_EXT']);
$nginx_ext = substr($data[$key]['NGINX_EXT'], 0, 16);
$nginx_ext = trim($nginx_ext, ",");
$nginx_ext = str_replace(',', ', ', $nginx_ext);
$nginx_ext = $nginx_ext.", ...";
if (strlen($data[$key]['PROXY_EXT']) > 16 ) {
$proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
$proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 16);
$proxy_ext = trim($proxy_ext, ",");
$proxy_ext = str_replace(',', ', ', $proxy_ext);
$proxy_ext = $proxy_ext.", ...";
} else {
$nginx_ext_title = '';
$nginx_ext = str_replace(',', ', ', $data[$key]['NGINX_EXT']);
$proxy_ext_title = '';
$proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
}
?>
<tr class="data-row">
@ -135,53 +135,60 @@
<?php echo $data[$key]['IP'] ?>
</td>
<tr>
<td class="counter-name" style="padding: 0 0 8px 2px">
[<?php echo $data[$key]['TPL'] ?>] <?php print __('template');?>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0 0 0 2px">
<td class="chart1" style="padding: 2px 0 0 2px">
<?php print __('Bandwidth');?>: <?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$panel[$user]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$panel[$user]['BANDWIDTH']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0 0 0 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="300">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name" width="110"><?php print __('SSL Support');?>:</td>
<td class="counter-value"><?php print __($data[$key]['SSL']) ?></td>
<td class="counter-name"><?php print __('Web Template');?>:</td>
<td class="counter-value"><?php print __($data[$key]['TPL']) ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SSL Support');?>:</td>
<td class="counter-value"><?php print $data[$key]['SSL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SSL Home Directory');?>:</td>
<td class="counter-value"><?php echo $ssl_home ?></td>
<td class="counter-value"><?php print $ssl_home ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Nginx Support');?>:</td>
<td class="counter-value"><?php print __($nginx_support) ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Nginx Extentions');?>:</td>
<td class="counter-value" <?php if (!empty($nginx_ext_title)) echo "title='".$nginx_ext_title."'" ?>><?php echo $nginx_ext ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="240">
<table>
<tr>
<td class="counter-name"><?php print __('Web Statistics');?>: </td>
<td class="counter-value"> <?php print __($web_stats) ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="300">
<table>
<tr>
<td class="counter-name"><?php print __('Proxy Support');?>:</td>
<td class="counter-value"><?php print __($proxy_support);?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Proxy Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['PROXY'];?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Proxy Extentions');?>:</td>
<td class="counter-value" <?php if (!empty($proxy_ext_title)) echo "title='".$proxy_ext_title."'" ?>><?php echo $proxy_ext ?></td>
</tr>
<tr>
<td class="counter-name"> <?php print __('Additional FTP Account');?>:</td>
<td class="counter-value"> <?php print __($ftp_user) ?></td>

View file

@ -86,6 +86,11 @@
color: #174f82;
}
.top-selected-link:active {
color: #fff;
background-color: #f79b44;
}
.top-user {
padding: 0 2px 0 0;
text-decoration: none;
@ -131,7 +136,7 @@
}
.nav-lnk:active {
color: #ccc;
color: #f79b44;
}
.nav-block {
@ -165,6 +170,10 @@
border-bottom: 4px solid #f79b44;
}
.nav-selected-block:active {
color: #f79b44;
}
.nav-header {
padding: 14px 0 0 6px;
margin: 0;
@ -556,10 +565,12 @@
}
.counter-name {
white-space: nowrap;
vertical-align:top;
line-height: 1.2em;
line-height: 1.3em;
font-size: 10pt;
color: #505050;
padding: 0 4px 0 0;
}
.cron-counter-name {
@ -902,8 +913,8 @@
top: 2px;
}
</style>
<link rel="stylesheet" type="text/css" href="/css/ie.css" />
<![endif]-->
<link type="text/css" href="/css/jquery-custom-dialogs.css" rel="stylesheet" />
<script type="text/javascript" src="/js/events.js"></script>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>

View file

@ -143,7 +143,7 @@
</table>
<table class="data-col2" width="600px" style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Aliases');?>
</td>
</tr>
@ -154,25 +154,25 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Nginx Support');?>
<?php print __('Proxy Support');?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" size="20" class="vst-checkbox" name="v_nginx" <?php if ($v_nginx !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('nginxtable');">
<input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if ($v_proxy !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');">
</td>
</tr>
<tr>
<td>
<table style="display:<?php if ($v_nginx == 'off') { echo 'none';} else {echo 'block';}?>;" id="nginxtable" >
<table style="display:<?php if ($v_proxy == 'off') { echo 'none';} else {echo 'block';}?>;" id="proxytable" >
<tr>
<td class="vst-text" style="padding: 9px 0 0 0;">
<?php print __('Nginx Extentions');?>
<?php print __('Proxy Extentions');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput" name="v_nginx_ext"><?php if (!empty($v_nginx_ext)) { echo $v_nginx_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
<textarea size="20" class="vst-textinput" name="v_proxy_ext"><?php if (!empty($v_proxy_ext)) { echo $v_proxy_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
</td>
</tr>
</table>

View file

@ -113,7 +113,7 @@
</td>
</tr>
<tr>
<td class="vst-text" style="padding: 10 0 0 2px;">
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Aliases');?>
</td>
</tr>
@ -124,25 +124,25 @@
</tr>
<tr>
<td class="vst-text" style="padding: 10px 0 0 2px;">
<?php print __('Nginx Support');?>
<?php print __('Proxy Support');?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" size="20" class="vst-checkbox" name="v_nginx" <?php if (!empty($v_nginx)) echo "checked=yes" ?> onclick="javascript:elementHideShow('nginxtable');">
<input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if (!empty($v_proxy)) echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');">
</td>
</tr>
<tr>
<td>
<table style="display:<?php if (empty($v_nginx)) { echo 'none';} else {echo 'block';}?> ;" id="nginxtable">
<table style="display:<?php if (empty($v_proxy)) { echo 'none';} else {echo 'block';}?> ;" id="proxytable">
<tr>
<td class="vst-text" style="padding: 9px 0 0 0;">
<?php print __('Nginx Extensions');?>
<?php print __('Proxy Extensions');?>
</td>
</tr>
<tr>
<td>
<textarea size="20" class="vst-textinput" name="v_nginx_ext"><?php if (!empty($v_nginx_ext)) { echo $v_nginx_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
<textarea size="20" class="vst-textinput" name="v_proxy_ext"><?php if (!empty($v_proxy_ext)) { echo $v_proxy_ext;} else { echo 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, mpeg, flv, html, htm'; } ?></textarea>
</td>
</tr>
</table>

View file

@ -86,20 +86,15 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 4px 2px">
[<?php echo $data[$key]['TYPE'] ?>] <?php print __('database');?>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0px 0 0px 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<td class="chart1" style="padding: 10px 0 0px 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name">
@ -129,6 +124,14 @@
<?php echo $data[$key]['CHARSET'] ?>
</td>
</tr>
<tr>
<td class="counter-name">
<?php print __('Type');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['TYPE'] ?>
</td>
</tr>
</table>
</td>
</tr>

View file

@ -89,34 +89,30 @@
<td class="counter-name" style="padding: 2px 0 0 2px;">
<?php echo $data[$key]['IP'] ?>
</td>
<tr>
<td class="counter-name" style="padding: 0 0 20px 2px">
[<?php echo $data[$key]['TPL'] ?>] <?php print __('template');?>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="270">
<table>
<tr>
<td class="counter-name"><?php print __('Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['TPL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SOA') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('TTL') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['TTL'] ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="300">
<table>
<tr>
<td class="counter-name"><?php print __('Expire');?>:</td>
<td class="counter-value"><?php echo strftime("%d %b %Y", strtotime($data[$key]['EXP'])) ?></td>
<td class="counter-name"><?php print __('TTL') ?>:</td>
<td class="counter-value"><?php echo $data[$key]['TTL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Records');?>:</td>
<td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
<td class="counter-name"><?php print __('Expire');?>:</td>
<td class="counter-value"><?php echo strftime("%d %b %Y", strtotime($data[$key]['EXP'])) ?></td>
</tr>
</table>
</td>

View file

@ -96,21 +96,16 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 2px 0">
<?php print __('Catchall email');?> > <?php echo $data[$key]['CATCHALL'] ?>
</td>
</tr>
<tr>
<td class="chart1">
<td class="chart1" style="padding: 10px 0 2px 0">
<?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="250">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name">
@ -142,10 +137,10 @@
</tr>
<tr>
<td class="counter-name">
<?php print __('Accounts');?>:
<?php print __('Catchall email');?>:
</td>
<td class="counter-value">
<?php echo $data[$key]['ACCOUNTS'] ?>
<?php echo $data[$key]['CATCHALL'] ?>
</td>
</tr>
</table>

View file

@ -85,10 +85,10 @@
<?php echo $data[$key]['IP'] ?>
</td>
<tr>
<td class="chart1" style="padding: 0 0 2px 0">
<td class="chart1" style="padding: 2px 0 2px 0">
<?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>

View file

@ -25,16 +25,11 @@
<tr class="data-row">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
<table class="data-col1" width="150">
<tr><td style="padding: 24 0 4 0;"><a class="data-date"><?php echo strftime("%d %b %Y", strtotime($key))?></a></td></tr>
<tr><td style="padding: 24 0 4 0;"><a class="data-date" ><?php echo strftime("%d %b %Y", strtotime($key))?></a></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px">
<tr>
<td></td>
</tr>
</table>
<div style="height:20px; width:20px;"></div>
<table class="data-col2" width="830px">
<tr>
<td colspan=3 class="username" style="padding: 10 0 0 4px;">
@ -45,23 +40,18 @@
<td style="vertical-align:top;" >
<table>
<tr>
<td colspan=2 class="counter-name" style="padding: 2px 0px 6px 2px;">
[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<td class="chart1" colspan=2 style="padding: 4px 0 0 2px;">
<?php print __('Bandwidth');?>: <?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>% (<?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 2px;">
<?php print __('Disk');?>: <?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>% (<?php echo humanize_usage($data[$key]['U_DISK']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
@ -70,12 +60,18 @@
<table class="chart2">
<tr>
<td>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?>
</td>
<td style="padding: 0px 10px 0px 8px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?><br>
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?><br>
<td style="padding: 0px 0px 0px 4px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?>
</td>
</tr>
<tr>
<td>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?>
</td>
<td style="padding: 0px 0px 0px 4px">
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?>
</td>
</tr>
</table>

View file

@ -60,35 +60,42 @@
<td colspan=3 class="username" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b><a class="fullname"><?php echo $data[$key]['FNAME']?> <?php echo $data[$key]['LNAME']?></a></td>
</tr>
<tr>
<td style="vertical-align:top;" width="240">
<td style="vertical-align:top;" width="260">
<table>
<tr><td colspan=2 class="counter-name" style="padding: 2px 0 0 2px;"><?php echo $data[$key]['CONTACT']?></td></tr>
<tr><td colspan=2 class="counter-name" style="padding: 0 0 18px 2px;">[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?></td></tr>
<tr><td colspan=2 class="counter-name" style="padding: 0 0 8px 2px;">[<?php echo $data[$key]['PACKAGE']?>] <?php print __('package');?></td></tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 3px;"><?php print __('Bandwidth');?>: <?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>% (<?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$data[$key]['BANDWIDTH']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" colspan=2 style="padding: 0 0 0 3px;"><?php print __('Disk');?>: <?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>% (<?php echo humanize_usage($data[$key]['U_DISK']) ?>)
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:7px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$data[$key]['DISK_QUOTA']) ?>%; height:7px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td colspan=2>
<td colspan=2 style="padding: 2px 0 0 0;">
<table class="chart2">
<tr>
<td>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
<?php print __('Web');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?>
</td>
<td style="padding: 0px 10px 0px 8px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?><br>
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?><br>
<td style="padding: 0px 0px 0px 4px">
<?php print __('Databases');?>: <?php echo humanize_usage($data[$key]['U_DISK_DB'])?>
</td>
</tr>
<tr>
<td>
<?php print __('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?>
</td>
<td style="padding: 0px 0px 0px 4px">
<?php print __('User Directories');?>: <?php echo humanize_usage($data[$key]['U_DISK_DIRS'])?>
</td>
</tr>
</table>
@ -96,12 +103,8 @@
</tr>
</table>
</td>
<td style="vertical-align:top;" width="320">
<table width="300">
<tr>
<td class="counter-name" width="36%"><?php print __('Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['TEMPLATE'] ?></td>
</tr>
<td style="vertical-align:top;" width="300">
<table width="290">
<tr>
<td class="counter-name"><?php print __('Web Domains');?>:</td>
<td class="counter-value"><?php echo $data[$key]['U_WEB_DOMAINS'] ?> / <?php echo $data[$key]['WEB_DOMAINS'] ?></td>

View file

@ -34,9 +34,11 @@
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'unsuspend' ;
$spnd_confirmation = 'UNSUSPEND_DOMAIN_CONFIRMATION' ;
} else {
$status = 'active';
$spnd_action = 'suspend' ;
$spnd_confirmation = 'SUSPEND_DOMAIN_CONFIRMATION' ;
}
if (!empty($data[$key]['SSL_HOME'])) {
if ($data[$key]['SSL_HOME'] == 'same') {
@ -55,22 +57,21 @@
if (!empty($data[$key]['FTP_USER'])) {
$ftp_user=$data[$key]['FTP_USER'];
}
$nginx_support='no';
if (!empty($data[$key]['NGINX'])) {
$nginx_support='yes';
$proxy_support='no';
if (!empty($data[$key]['PROXY'])) {
$proxy_support='yes';
}
if (strlen($data[$key]['NGINX_EXT']) > 16 ) {
$nginx_ext_title = str_replace(',', ', ', $data[$key]['NGINX_EXT']);
$nginx_ext = substr($data[$key]['NGINX_EXT'], 0, 16);
$nginx_ext = trim($nginx_ext, ",");
$nginx_ext = str_replace(',', ', ', $nginx_ext);
$nginx_ext = $nginx_ext.", ...";
if (strlen($data[$key]['PROXY_EXT']) > 16 ) {
$proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
$proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 16);
$proxy_ext = trim($proxy_ext, ",");
$proxy_ext = str_replace(',', ', ', $proxy_ext);
$proxy_ext = $proxy_ext.", ...";
} else {
$nginx_ext_title = '';
$nginx_ext = str_replace(',', ', ', $data[$key]['NGINX_EXT']);
$proxy_ext_title = '';
$proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
}
?>
<tr class="data-row">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
@ -122,53 +123,60 @@
<?php echo $data[$key]['IP'] ?>
</td>
<tr>
<td class="counter-name" style="padding: 0 0 8px 2px">
[<?php echo $data[$key]['TPL'] ?>] <?php print __('template');?>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0 0 0 2px">
<td class="chart1" style="padding: 2px 0 0 2px">
<?php print __('Bandwidth');?>: <?php echo humanize_usage($data[$key]['U_BANDWIDTH']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$panel[$user]['BANDWIDTH']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_BANDWIDTH'],$panel[$user]['BANDWIDTH']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
<tr>
<td class="chart1" style="padding: 0 0 0 2px"><?php print __('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
<div style="width:160px; height:5px; font-size:0;background-color:#c7d5b3;">
<div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:5px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
</div>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="300">
<td style="vertical-align:top;" width="260">
<table>
<tr>
<td class="counter-name" width="110"><?php print __('SSL Support');?>:</td>
<td class="counter-value"><?php print __($data[$key]['SSL']) ?></td>
<td class="counter-name"><?php print __('Web Template');?>:</td>
<td class="counter-value"><?php print __($data[$key]['TPL']) ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SSL Support');?>:</td>
<td class="counter-value"><?php print $data[$key]['SSL'] ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('SSL Home Directory');?>:</td>
<td class="counter-value"><?php echo $ssl_home ?></td>
<td class="counter-value"><?php print $ssl_home ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Nginx Support');?>:</td>
<td class="counter-value"><?php print __($nginx_support) ?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Nginx Extentions');?>:</td>
<td class="counter-value" <?php if (!empty($nginx_ext_title)) echo "title='".$nginx_ext_title."'" ?>><?php echo $nginx_ext ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="240">
<table>
<tr>
<td class="counter-name"><?php print __('Web Statistics');?>: </td>
<td class="counter-value"> <?php print __($web_stats) ?></td>
</tr>
</table>
</td>
<td rowspan=4 style="vertical-align:top;" width="300">
<table>
<tr>
<td class="counter-name"><?php print __('Proxy Support');?>:</td>
<td class="counter-value"><?php print __($proxy_support);?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Proxy Template');?>:</td>
<td class="counter-value"><?php echo $data[$key]['PROXY'];?></td>
</tr>
<tr>
<td class="counter-name"><?php print __('Proxy Extentions');?>:</td>
<td class="counter-value" <?php if (!empty($proxy_ext_title)) echo "title='".$proxy_ext_title."'" ?>><?php echo $proxy_ext ?></td>
</tr>
<tr>
<td class="counter-name"> <?php print __('Additional FTP Account');?>:</td>
<td class="counter-value"> <?php print __($ftp_user) ?></td>