Merge changes from upstream

This commit is contained in:
ZonD Eighty 2013-01-16 14:12:53 +04:00
commit c094d8582d
54 changed files with 4981 additions and 5671 deletions

View file

@ -1,85 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
# info: add dns domain or dns record based on web domain alias restart
# options: USER DOMAIN
#
# The function adds dns domain or dns record based on web domain alias.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(echo $2 | sed -e 's/\.*$//g' -e 's/^\.*//g')
domain_idn=$(idn -t --quiet -a "$domain")
dom_alias=$(idn -t --quiet -u "$3" )
dom_alias=$(echo $dom_alias | sed -e 's/\.*$//g' -e 's/^\.*//g')
dom_alias=$(echo $dom_alias | tr '[:upper:]' '[:lower:]')
dom_alias_idn=$(idn -t --quiet -a "$dom_alias" )
restart="$4"
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN ALIAS'
validate_format 'user' 'domain'
is_system_enabled "$WEB_SYSTEM"
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Parsing domain values
get_domain_values 'web'
# Check if it a simple domain
if [ $(echo -e "${dom_alias//\./\n}" | wc -l) -le 2 ]; then
if [ ! -e "$USER_DATA/dns/$dom_alias.conf" ]; then
$BIN/v-add-dns-domain $user $dom_alias $IP '' '' '' '' '' $restart
fi
else
# Check subdomain
sub=$(echo "$dom_alias" | cut -f1 -d . -s)
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
$BIN/v-add-dns-domain-record $user $dom "$sub" A $IP '' '' $restart
else
if [ "$sub" == '*' ]; then
rec=$(grep -w "RECORD='\*'" $USER_DATA/dns/$dom.conf)
else
rec=$(grep -w "RECORD='$sub'" $USER_DATA/dns/$dom.conf)
fi
if [ -z "$rec" ]; then
$BIN/v-add-dns-domain-record $user $dom "$sub" A $IP '' '' $restart
fi
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# No Logging
exit
=======
#!/bin/bash
# info: add dns domain or dns record based on web domain alias restart
# options: USER DOMAIN
@ -167,4 +85,3 @@ fi
# No Logging
exit
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

View file

@ -1,76 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
# info: add ftp account for web domain.
# options: USER DOMAIN FTP_USER FTP_PASSWORD
#
# The function creates addutional ftp account for web domain.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
ftp_user=${1}_${3}
ftp_password=$4
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
# Hiding password
A4='******'
EVENT="DATE='$DATE' TIME='$TIME' CMD='$SCRIPT' A1='$A1' A2='$A2' A3='$A3'"
EVENT="$EVENT A4='$A4' A5='$A5' A6='$A6' A7='$A7' A8='$A8' A9='$A9'"
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD'
validate_format 'user' 'domain' 'ftp_user' 'ftp_password'
is_system_enabled "$WEB_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Get domain values
get_domain_values 'web'
if [ ! -z "$FTP_USER" ]; then
/usr/sbin/userdel $FTP_USER
fi
# Adding user
/usr/sbin/adduser $ftp_user -g $user -s /sbin/nologin -M \
-d "$HOMEDIR/$user/web/$domain" > /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)"
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Update config
update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user"
update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5"
# Logging
log_history "added ftp account $ftp_user for $domain"
log_event "$OK" "$EVENT"
exit
=======
#!/bin/bash
# info: add ftp account for web domain.
# options: USER DOMAIN FTP_USER FTP_PASSWORD
@ -148,4 +75,3 @@ log_history "added ftp account $ftp_user for $domain"
log_event "$OK" "$EVENT"
exit
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

188
bin/v-list-sys-services Executable file
View file

@ -0,0 +1,188 @@
#!/bin/bash
# info: list system config
# options: [FORMAT]
#
# The function for obtaining the list of system parameters.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
format=${1-shell}
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
get_srv_state() {
srv=$1
proc_name=${2-$1}
# Check service status
/etc/init.d/$srv status > /dev/null 2>&1
if [ $? -eq 0 ]; then
state='running'
# Calculate cpu and memory usage
cpu=0
mem=0
for pid in $(/sbin/pidof $proc_name); do
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ')
cpu=$((cpu + pid_cpu))
mem=$((mem + pid_mem))
done
mem=$((mem / 1024))
# Get pid date
if [ ! -z $pid ] && [ -e "/proc/$pid/cmdline" ]; then
mtime=$(stat -c "%Y" /proc/$pid/cmdline)
rtime=$((ctime - mtime))
rtime=$((rtime / 60))
fi
else
# Service is stopped
state='stopped'
mem=0
cpu=0
rtime="0"
fi
}
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Save current proccess list
tmp_file=$(mktemp)
if [ "$format" = 'json' ]; then
ps aux | awk '{print $2" "$3}' | tr -d '.' > $tmp_file
else
ps aux | awk '{print $2" "$3}' | cut -f 1 -d '.' > $tmp_file
fi
# Get current time
ctime=$(date +%s)
# Proxy
service=$PROXY_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service
str="NAME='$service' SYSTEM='reverse proxy' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'"
fi
# Web
service=$WEB_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
if [ "$service" == 'apache' ]; then
service='httpd'
fi
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='web server' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'"
fi
# DNS
service=$DNS_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
if [ "$service" == 'bind' ]; then
service='named'
fi
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='dns server' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'"
fi
# MAIL
service=$MAIL_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='mail server' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'"
fi
# IMAP
service=$IMAP_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='pop/imap server' STATE='$state'"
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
# ANTIVIRUS
service=$ANTIVIRUS_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
if [ "$ANTIVIRUS_SYSTEM" = 'clamav' ]; then
service='clamd'
fi
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='email antivirus' STATE='$state'"
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
# ANTISPAM
service=$ANTISPAM_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service spamd
str="$str\nNAME='$service' SYSTEM='email antispam' STATE='$state'"
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
# DB
service=$DB_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
for db in ${DB_SYSTEM//,/ }; do
service="$db"
if [ "$service" == 'mysql' ] && [ ! -e "/etc/init.d/$service" ]; then
service='mysqld'
fi
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='database server' STATE='$state'"
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
done
fi
# FTP
service=$FTP_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='ftp server' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'"
fi
# CRON
service=$CRON_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
get_srv_state $service
str="$str\nNAME='$service' SYSTEM='job scheduler' STATE='$state'"
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
# Defining config
echo -e "$str" > $tmp_file
conf=$tmp_file
# Defining fileds to select
fields="\$NAME \$SYSTEM \$STATE \$CPU \$MEM \$RTIME"
# Listing services
case $format in
json) json_list ;;
plain) nohead=1; shell_list ;;
shell) fields='$NAME $STATE $CPU $MEM $RTIME'
shell_list | column -t ;;
*) check_args '1' '0' 'USER [FORMAT]'
esac
rm -f $tmp_file
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -32,6 +32,9 @@ is_object_valid 'user' 'USER' "$user"
# Defining config
conf=$USER_DATA/stats.log
if [ ! -e "$conf" ]; then
touch $conf
fi
# Defining fileds to select
fields="\$DATE \$TIME \$PACKAGE \$IP_OWNED \$DISK_QUOTA \$U_DISK \$U_DISK_DIRS"

View file

@ -29,6 +29,9 @@ check_args '0' "$#" '[FORMAT]'
# Defining config
conf=$VESTA/data/users/admin/overall_stats.log
if [ ! -e "$conf" ]; then
touch $conf
fi
# Defining fileds to select
fields="\$DATE \$TIME \$PACKAGE \$IP_OWNED \$DISK_QUOTA \$U_DISK \$U_DISK_DIRS"

View file

@ -143,7 +143,7 @@ fi
if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
touch $USER_DATA/db.conf
chmod 660 $USER_DATA/db.conf
echo "v_update_datbases_disk $user" >> $VESTA/data/queue/disk.pipe
echo "v-update-datbases-disk $user" >> $VESTA/data/queue/disk.pipe
fi
if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then

View file

@ -1,317 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
# info: rebuild dns domains
# options: USER [RESTART]
#
# The function rebuilds BIND configuration files for all dns domains.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
restart=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
source $VESTA/func/ip.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'USER [RESTART]'
validate_format 'user'
is_system_enabled "$WEB_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
user_domains=0
user_ssl=0
user_aliases=0
suspended_web=0
# Clean up old config
rm -f $HOMEDIR/$user/conf/tmp_*.conf
# Defining config
conf=$USER_DATA/web.conf
fields='$DOMAIN'
nohead=1
# Starting loop
for domain in $(shell_list) ; do
# Rebuilding directories
mkdir -p $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/public_html \
$HOMEDIR/$user/web/$domain/public_shtml \
$HOMEDIR/$user/web/$domain/document_errors \
$HOMEDIR/$user/web/$domain/cgi-bin \
$HOMEDIR/$user/web/$domain/private \
$HOMEDIR/$user/web/$domain/stats \
$HOMEDIR/$user/web/$domain/logs
if [ ! -e "$HOMEDIR/$user/web/$domain/logs/$domain.log" ]; then
ln -s /var/log/httpd/domains/$domain.error.log \
$HOMEDIR/$user/web/$domain/logs/$domain.log
fi
if [ ! -e "$HOMEDIR/$user/web/$domain/logs/$domain.error.log" ]; then
ln -s /var/log/httpd/domains/$domain.error.log \
$HOMEDIR/$user/web/$domain/logs/$domain.error.log
fi
if [ -e "$WEBTPL/skel/document_errors/" ]; then
cp -r $WEBTPL/skel/document_errors/ $HOMEDIR/$user/web/$domain/
fi
touch /var/log/httpd/domains/$domain.bytes \
/var/log/httpd/domains/$domain.log \
/var/log/httpd/domains/$domain.error.log
chmod 551 $HOMEDIR/$user/web/$domain
chmod 771 $HOMEDIR/$user/web/$domain/private
chmod 771 $HOMEDIR/$user/web/$domain/cgi-bin
chmod 771 $HOMEDIR/$user/web/$domain/public_html
chmod 771 $HOMEDIR/$user/web/$domain/public_shtml
chmod 771 $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.*
chown $user:$user $HOMEDIR/$user/web/$domain
chown $user:$user $HOMEDIR/$user/web/$domain/private
chown $user:$user $HOMEDIR/$user/web/$domain/cgi-bin
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:apache $conf
# Parsing domain values
domain_idn=$(idn -t --quiet -a "$domain")
get_domain_values 'web'
# Preparing domain values for the template substitution
upd_web_domain_values
# Adding domain to the tmp_httpd.conf
tpl_file="$WEBTPL/apache_$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_httpd.conf"
add_web_config
chown root:apache $conf
chmod 640 $conf
# Running template trigger
if [ -x $WEBTPL/apache_$TPL.sh ]; then
$WEBTPL/apache_$TPL.sh $user $domain $ip $HOMEDIR $docroot
fi
# Checking aliases
if [ ! -z "$ALIAS" ]; then
aliases=$(echo "$ALIAS"|tr ',' '\n'| wc -l)
user_aliases=$((user_aliases + aliases))
fi
# Checking stats
if [ ! -z "$STATS" ]; then
cat $WEBTPL/$STATS.tpl |\
sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/$WEB_PORT/g" \
-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/%domain_idn%/$domain_idn/g" \
-e "s/%domain%/$domain/g" \
-e "s/%user%/$user/g" \
-e "s/%home%/${HOMEDIR////\/}/g" \
-e "s/%alias%/${aliases//,/ }/g" \
-e "s/%alias_idn%/${aliases_idn//,/ }/g" \
> $HOMEDIR/$user/conf/web/$STATS.$domain.conf
if [ "$STATS" == 'awstats' ]; then
if [ ! -e "/etc/awstats/$STATS.$domain.conf" ]; then
ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf /etc/awstats/
fi
fi
webstats="$BIN/v-update-web-domain-stat $user $domain"
check_webstats=$(grep "$webstats" $VESTA/data/queue/webstats.pipe)
if [ -z "$check_webstats" ]; then
echo "$webstats" >> $VESTA/data/queue/webstats.pipe
fi
if [ ! -z "$STATS_USER" ]; then
# Definining statistic dir
stats_dir="$HOMEDIR/$user/web/$domain/stats"
# Adding htaccess file
echo "AuthUserFile $stats_dir/.htpasswd" > $stats_dir/.htaccess
echo "AuthName \"Web Statistics\"" >> $stats_dir/.htaccess
echo "AuthType Basic" >> $stats_dir/.htaccess
echo "Require valid-user" >> $stats_dir/.htaccess
# Generating htaccess user and password
echo "$STATS_USER:$STATS_CRYPT" > $stats_dir/.htpasswd
fi
fi
# 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"
add_web_config
chown root:apache $conf
chmod 640 $conf
cp -f $USER_DATA/ssl/$domain.crt \
$HOMEDIR/$user/conf/web/ssl.$domain.crt
cp -f $USER_DATA/ssl/$domain.key \
$HOMEDIR/$user/conf/web/ssl.$domain.key
cp -f $USER_DATA/ssl/$domain.pem \
$HOMEDIR/$user/conf/web/ssl.$domain.pem
if [ -e "$USER_DATA/ssl/$domain.ca" ]; then
cp -f $USER_DATA/ssl/$domain.ca \
$HOMEDIR/$user/conf/web/ssl.$domain.ca
fi
# Running template trigger
if [ -x $WEBTPL/apache_$TPL.sh ]; then
$WEBTPL/apache_$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"
add_web_config
chown root:nginx $conf
chmod 640 $conf
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/nginx_$NGINX.stpl"
conf="$HOMEDIR/$user/conf/web/tmp_snginx.conf"
add_web_config
chown root:nginx $conf
chmod 640 $conf
fi
ngix_change='yes'
fi
if [ "$SUSPENDED" = 'yes' ]; then
suspended_web=$((suspended_web + 1))
fi
user_domains=$((user_domains + 1))
# Checking ftp
if [ ! -z "$FTP_USER" ]; then
if [ -z "$(grep ^$FTP_USER: /etc/passwd)" ]; then
/usr/sbin/adduser $FTP_USER -g $user -s /sbin/nologin -M \
-d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1
shadow='/etc/shadow'
shdw=$(grep "^$FTP_USER:" $shadow)
shdw3=$(echo "$shdw" | cut -f3 -d :)
shdw4=$(echo "$shdw" | cut -f4 -d :)
shdw5=$(echo "$shdw" | cut -f5 -d :)
shdw6=$(echo "$shdw" | cut -f6 -d :)
shdw7=$(echo "$shdw" | cut -f7 -d :)
shdw8=$(echo "$shdw" | cut -f8 -d :)
shdw9=$(echo "$shdw" | cut -f9 -d :)
chmod u+w $shadow
sed -i "/^$FTP_USER:*/d" $shadow
shdw_str="$FTP_USER:$FTP_MD5:$shdw3:$shdw4:$shdw5:$shdw6"
shdw_str="$shdw_str:$shdw7:$shdw8:$shdw9"
echo "$shdw_str" >> $shadow
chmod u-w $shadow
fi
fi
done
# Renaming tmp config
tmp_conf="$HOMEDIR/$user/conf/web/tmp_httpd.conf"
conf="$HOMEDIR/$user/conf/web/httpd.conf"
if [ -e "$tmp_conf" ]; then
mv $tmp_conf $conf
fi
# Checking include in main httpd.conf
main_conf='/etc/httpd/conf.d/vesta.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ ! -z "$domain" ] && [ -z "$main_conf_check" ]; then
echo "Include $conf" >>$main_conf
fi
# Checking ssl
if [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_shttpd.conf"
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
mv $tmp_conf $conf
# Checking include in main httpd.conf
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "Include $conf" >>$main_conf
fi
fi
# Checking nginx
if [ "$ngix_change" = 'yes' ]; then
nginx_conf='/etc/nginx/conf.d/vesta_users.conf'
tmp_conf="$HOMEDIR/$user/conf/web/tmp_nginx.conf"
conf="$HOMEDIR/$user/conf/web/nginx.conf"
mv $tmp_conf $conf
nginx_conf_check=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_conf_check" ]; then
echo "include $conf;" >>$nginx_conf
fi
# Checking ssl for nginx
if [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_snginx.conf"
conf="$HOMEDIR/$user/conf/web/snginx.conf"
mv $tmp_conf $conf
nginx_conf_check=$(grep "$conf" $nginx_conf )
if [ -z "$nginx_conf_check" ]; then
echo "include $conf;" >>$nginx_conf
fi
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Updating counters
update_user_value "$user" '$SUSPENDED_WEB' "$suspended_web"
update_user_value "$user" '$U_WEB_DOMAINS' "$user_domains"
update_user_value "$user" '$U_WEB_SSL' "$user_ssl"
update_user_value "$user" '$U_WEB_ALIASES' "$user_aliases"
# Restart web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web "$EVENT"
fi
# Logging
log_event "$OK" "$EVENT"
exit
=======
#!/bin/bash
# info: rebuild dns domains
# options: USER [RESTART]
@ -624,4 +310,3 @@ fi
log_event "$OK" "$EVENT"
exit
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

View file

@ -12,7 +12,6 @@
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
EVENT=${1-$EVENT}
#----------------------------------------------------------#
@ -21,11 +20,10 @@ EVENT=${1-$EVENT}
# Parsing config / or just source config
if [ "$CRON_SYSTEM" = 'crond' ]; then
/etc/init.d/crond 'reload' &>/dev/null
/etc/init.d/crond 'reload' >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/crond 'restart' &>/dev/null
/etc/init.d/crond 'restart' >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
fi

View file

@ -12,18 +12,17 @@
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
EVENT=${1-$EVENT}
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ "$DNS_SYSTEM" = 'bind' ]; then
/etc/init.d/named reload &>/dev/null
/etc/init.d/named reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/named restart &>/dev/null
/etc/init.d/named restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
fi

View file

@ -12,18 +12,17 @@
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
EVENT=${1-$EVENT}
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ "$MAIL_SYSTEM" = 'exim' ]; then
/etc/init.d/exim reload &>/dev/null
/etc/init.d/exim reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/exim restart &>/dev/null
/etc/init.d/exim restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
fi

42
bin/v-restart-service Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# info: restart service
# options: service
#
# The function restarts system service.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
service=$1
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'SERVICE'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ -x "/etc/init.d/$service" ]; then
/etc/init.d/$service restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -1,8 +1,8 @@
#!/bin/bash
# info: restart dns service
# info: restart web services
# options: NONE
#
# The function tells BIND service to reload dns zone files.
# The function reloads web server configuration.
#----------------------------------------------------------#
@ -12,41 +12,37 @@
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
EVENT=${1-$EVENT}
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ "$WEB_SYSTEM" = 'apache' ]; then
/etc/init.d/httpd status &>/dev/null
/etc/init.d/httpd status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/httpd graceful &>/dev/null
/etc/init.d/httpd graceful >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
else
/etc/init.d/httpd start &>/dev/null
/etc/init.d/httpd start >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
fi
fi
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
/etc/init.d/nginx status &>/dev/null
/etc/init.d/nginx status >/dev/null 2>&1
if [ $? -eq 0 ]; then
/etc/init.d/nginx reload &>/dev/null
/etc/init.d/nginx reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
else
/etc/init.d/nginx start &>/dev/null
/etc/init.d/nginx start >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_event "$E_RESTART" "$EVENT"
exit $E_RESTART
fi
fi

42
bin/v-start-service Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# info: start service
# options: service
#
# The function starts system service.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
service=$1
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'SERVICE'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ -x "/etc/init.d/$service" ]; then
/etc/init.d/$service start >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

42
bin/v-stop-service Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# info: stop service
# options: service
#
# The function stops system service.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
service=$1
# Includes
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'SERVICE'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
if [ -x "/etc/init.d/$service" ]; then
/etc/init.d/$service stop >/dev/null 2>&1
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit

View file

@ -1,174 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
# info: update user statistics
# options: USER
#
# Function logs user parameters into statistics database.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
# Importing system enviroment as we run this script
# mostly by cron wich not read it by itself
source /etc/profile
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '0' "$#" 'USER'
if [ ! -z "$user" ]; then
validate_format 'user'
is_object_valid 'user' 'USER' "$user"
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Creating user_list
if [ -z "$user" ]; then
user_list=$(ls $VESTA/data/users)
else
user_list="$user"
fi
# Reset overal statistics
TOTAL_IP_OWNED=0
TOTAL_U_DISK=0
TOTAL_U_DISK_DIRS=0
TOTAL_U_DISK_WEB=0
TOTAL_U_DISK_MAIL=0
TOTAL_U_DISK_DB=0
TOTAL_U_BANDWIDTH=0
TOTAL_U_WEB_DOMAINS=0
TOTAL_U_WEB_SSL=0
TOTAL_U_WEB_ALIASES=0
TOTAL_U_DNS_DOMAINS=0
TOTAL_U_DNS_RECORDS=0
TOTAL_U_MAIL_DOMAINS=0
TOTAL_U_MAIL_DKIM=0
TOTAL_U_MAIL_ACCOUNTS=0
TOTAL_U_DATABASES=0
TOTAL_U_CRON_JOBS=0
TOTAL_U_BACKUPS=0
# Updating user stats
for user in $user_list; do
USER_DATA=$VESTA/data/users/$user
source $USER_DATA/user.conf
next_month=$(date +'%m/01' -d '+ 1 month')
DATE=$(date -d "$next_month -1day" +%F)
# Compiling report string
s="DATE='$DATE' TIME='$TIME' PACKAGE='$PACKAGE' IP_OWNED='$IP_OWNED'"
s="$s DISK_QUOTA='$DISK_QUOTA' U_DISK='$U_DISK' U_DISK_DIRS='$U_DISK_DIRS'"
s="$s U_DISK_WEB='$U_DISK_WEB' U_DISK_MAIL='$U_DISK_MAIL'"
s="$s U_DISK_DB='$U_DISK_DB' BANDWIDTH='$BANDWIDTH'"
s="$s U_BANDWIDTH='$U_BANDWIDTH' U_WEB_DOMAINS='$U_WEB_DOMAINS'"
s="$s U_WEB_SSL='$U_WEB_SSL' U_WEB_ALIASES='$U_WEB_ALIASES'"
s="$s U_DNS_DOMAINS='$U_DNS_DOMAINS' U_DNS_RECORDS='$U_DNS_RECORDS'"
s="$s U_MAIL_DOMAINS='$U_MAIL_DOMAINS' U_MAIL_DKIM='$U_MAIL_DKIM'"
s="$s U_MAIL_ACCOUNTS='$U_MAIL_ACCOUNTS' U_DATABASES='$U_DATABASES'"
s="$s U_CRON_JOBS='$U_CRON_JOBS' U_BACKUPS='$U_BACKUPS'"
# Updating user stats log
stats="$USER_DATA/stats.log"
if [ -e "$stats" ]; then
# Checking dublicates
check_month=$(grep -n "DATE='$DATE'" $stats|cut -f 1 -d :)
if [ -z "$check_month" ]; then
# Updating as there no dublicates
echo "$s" >> $stats
chmod 660 $stats
else
# Replacing string with new data
sed -i "$check_month s/.*/$s/" $stats
fi
else
# Creating stats log
echo "$s" >$stats
chmod 660 $stats
fi
# Increase overall counters
TOTAL_IP_OWNED=$((TOTAL_IP_OWNED + IP_OWNED))
TOTAL_U_DISK=$((TOTAL_U_DISK + U_DISK))
TOTAL_U_DISK_DIRS=$((TOTAL_U_DISK_DIRS + U_DISK_DIRS))
TOTAL_U_DISK_WEB=$((TOTAL_U_DISK_WEB + U_DISK_WEB))
TOTAL_U_DISK_MAIL=$((TOTAL_U_DISK_MAIL + U_DISK_MAIL))
TOTAL_U_DISK_DB=$((TOTAL_U_DISK_DB + U_DISK_DB))
TOTAL_U_BANDWIDTH=$((TOTAL_U_BANDWIDTH + U_BANDWIDTH))
TOTAL_U_WEB_DOMAINS=$((TOTAL_U_WEB_DOMAINS + U_WEB_DOMAINS))
TOTAL_U_WEB_SSL=$((TOTAL_U_WEB_SSL + U_WEB_SSL))
TOTAL_U_WEB_ALIASES=$((TOTAL_U_WEB_ALIASES + U_WEB_ALIASES))
TOTAL_U_DNS_DOMAINS=$((TOTAL_U_DNS_DOMAINS + U_DNS_DOMAINS))
TOTAL_U_DNS_RECORDS=$((TOTAL_U_DNS_RECORDS + U_DNS_RECORDS))
TOTAL_U_MAIL_DOMAINS=$((TOTAL_U_MAIL_DOMAINS + U_MAIL_DOMAINS))
TOTAL_U_MAIL_DKIM=$((TOTAL_U_MAIL_DKIM + U_MAIL_DKIM))
TOTAL_U_MAIL_ACCOUNTS=$((TOTAL_U_MAIL_ACCOUNTS + U_MAIL_ACCOUNTS))
TOTAL_U_DATABASES=$((TOTAL_U_DATABASES + U_DATABASES))
TOTAL_U_CRON_JOBS=$((TOTAL_U_CRON_JOBS + U_CRON_JOBS))
TOTAL_U_BACKUPS=$((TOTAL_U_BACKUPS + U_BACKUPS))
done
# Updating overall stats
stats="$VESTA/data/users/admin/overall_stats.log"
s="DATE='$DATE' TIME='$TIME' PACKAGE='default' IP_OWNED='$TOTAL_IP_OWNED'"
s="$s DISK_QUOTA='0' U_DISK='$TOTAL_U_DISK' U_DISK_DIRS='$TOTAL_U_DISK_DIRS'"
s="$s U_DISK_WEB='$TOTAL_U_DISK_WEB' U_DISK_MAIL='$TOTAL_U_DISK_MAIL'"
s="$s U_DISK_DB='$TOTAL_U_DISK_DB' BANDWIDTH='0'"
s="$s U_BANDWIDTH='$TOTAL_U_BANDWIDTH' U_WEB_DOMAINS='$TOTAL_U_WEB_DOMAINS'"
s="$s U_WEB_SSL='$TOTAL_U_WEB_SSL' U_WEB_ALIASES='$TOTAL_U_WEB_ALIASES'"
s="$s U_DNS_DOMAINS='$TOTAL_U_DNS_DOMAINS'"
s="$s U_DNS_RECORDS='$TOTAL_U_DNS_RECORDS'"
s="$s U_MAIL_DOMAINS='$TOTAL_U_MAIL_DOMAINS' U_MAIL_DKIM='$TOTAL_U_MAIL_DKIM'"
s="$s U_MAIL_ACCOUNTS='$TOTAL_U_MAIL_ACCOUNTS'"
s="$s U_DATABASES='$TOTAL_U_DATABASES'"
s="$s U_CRON_JOBS='$TOTAL_U_CRON_JOBS' U_BACKUPS='$TOTAL_U_BACKUPS'"
if [ -e "$stats" ]; then
# Checking dublicates
check_month=$(grep -n "DATE='$DATE'" $stats|cut -f 1 -d :)
if [ -z "$check_month" ]; then
# Updating as there no dublicates
echo "$s" >> $stats
chmod 660 $stats
else
# Replacing string with new data
sed -i "$check_month s/.*/$s/" $stats
fi
else
# Creating stats log
echo "$s" >$stats
chmod 660 $stats
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit
=======
#!/bin/bash
# info: update user statistics
# options: USER
@ -338,4 +167,3 @@ fi
log_event "$OK" "$EVENT"
exit
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

View file

@ -49,9 +49,9 @@ is_domain_new() {
type="$1"
dom=${2-$domain}
web=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/web.conf)
dns=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf)
mail=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf)
web=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/web.conf)
dns=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf)
mail=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf)
# Check web domain
if [ ! -z "$web" ] && [ "$type" == 'web' ]; then
@ -101,10 +101,10 @@ is_domain_new() {
# Check web aliases
web_alias=$(grep -w $dom $VESTA/data/users/*/web.conf)
if [ ! -z "$web_alias" ]; then
c1=$(grep "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c2=$(grep "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c3=$(grep ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c4=$(grep ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c1=$(grep -H "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c2=$(grep -H "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c3=$(grep -H ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
c4=$(grep -H ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
if [ ! -z "$c1" ] && [ "$type" == "web" ]; then
echo "Error: domain $dom exist"
log_event "$E_EXISTS" "$EVENT"

View file

@ -64,7 +64,7 @@ log_history() {
touch $log
if [ '99' -lt "$(wc -l $log |cut -f 1 -d ' ')" ]; then
tail -n 99 $log > $log.moved
tail -n 49 $log > $log.moved
mv -f $log.moved $log
chmod 660 $log
fi

View file

@ -1,59 +1,3 @@
<<<<<<< HEAD
<?php
/**
* Vesta Control Panel Password Driver
*
* @version 1.0
* @author Serghey Rodin <skid@vestacp.com>
*/
class rcube_vesta_password
{
function save($curpass, $passwd)
{
$rcmail = rcmail::get_instance();
$vesta_host = $rcmail->config->get('password_vesta_host');
if (empty($vesta_host))
{
$vesta_host = 'localhost';
}
$vesta_port = $rcmail->config->get('password_vesta_port');
if (empty($vesta_port))
{
$vesta_port = '8083';
}
$request = 'email='.$_SESSION['username'].'&';
$request .= 'password='.$curpass.'&';
$request .= 'new='.$passwd.'&';
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL,
'content' => $request,
),
));
$result = file_get_contents(
$file = "https://".$vesta_host.":".$vesta_port."/reset/mail/?",
$use_include_path = false,
$context);
if ($result == 'ok'){
return PASSWORD_SUCCESS;
}
else {
return PASSWORD_ERROR;
}
}
}
=======
<?php
/**
@ -114,4 +58,3 @@ class rcube_vesta_password
}
}
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

View file

@ -12,12 +12,13 @@
CustomLog /var/log/httpd/domains/%domain%.log combined
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
<Directory %sdocroot%>
AllowOverride AuthConfig FileInfo Indexes Limit
SSLRequireSSL
Options +Includes -Indexes %cgi_option%
php_admin_flag engine off
AllowOverride All
Options +Includes -Indexes +ExecCGI
Action phpcgi-script /cgi-bin/php
AddHandler phpcgi-script .php
<Files *.php>
SetHandler phpcgi-script
</Files>
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All

View file

@ -12,11 +12,12 @@
CustomLog /var/log/httpd/domains/%domain%.log combined
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
<Directory %docroot%>
AllowOverride AuthConfig FileInfo Indexes Limit
Options +Includes -Indexes %cgi_option%
php_admin_flag engine off
AllowOverride All
Options +Includes -Indexes +ExecCGI
Action phpcgi-script /cgi-bin/php
AddHandler phpcgi-script .php
<Files *.php>
SetHandler phpcgi-script
</Files>
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All

View file

@ -12,11 +12,12 @@
CustomLog /var/log/httpd/domains/%domain%.log combined
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
<Directory %sdocroot%>
AllowOverride AuthConfig FileInfo Indexes Limit
SSLRequireSSL
Options +Includes -Indexes %cgi_option%
php_admin_flag engine off
AddHandler fcgid-script .php
AllowOverride All
Options +Includes -Indexes +ExecCGI
<Files *.php>
SetHandler fcgid-script
</Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -12,10 +12,11 @@
CustomLog /var/log/httpd/domains/%domain%.log combined
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
<Directory %docroot%>
AllowOverride AuthConfig FileInfo Indexes Limit
Options +Includes -Indexes %cgi_option%
php_admin_flag engine off
AddHandler fcgid-script .php
AllowOverride All
Options +Includes -Indexes +ExecCGI
<Files *.php>
SetHandler fcgid-script
</Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
</Directory>
<Directory %home%/%user%/web/%domain%/stats>

View file

@ -1,643 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
# Vesta installer
# Define Variables
RHOST='r.vestacp.com'
CHOST='c.vestacp.com'
REPO='cmmnt'
VERSION='0.9.7'
YUM_REPO='/etc/yum.repos.d/vesta.repo'
arch=$(uname -i)
tools="screen mc libpng libjpeg curl curl libmcrypt libmcrypt mhash mhash
freetype openssl flex libxml2 ImageMagick sqlite sqlite pcre pcre sudo bc
mailx lsof ntp tar whois telnet rsync"
rpms="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid ftp
webalizer awstats mysql mysql-server php php-bcmath php-cli php-common
php-gd php-imap php-mbstring php-mcrypt php-mysql php-pdo php-soap php-tidy
php-xml php-xmlrpc phpMyAdmin exim dovecot clamd spamassassin roundcubemail
bind bind-utils bind-libs vsftpd rrdtool GeoIP vesta vesta-nginx vesta-php"
# Am I root?
if [ "x$(id -u)" != 'x0' ]; then
echo 'Error: this script can only be executed by root'
exit 1
fi
# Check supported version
if [ ! -e '/etc/redhat-release' ]; then
echo 'Error: sorry, we currently support RHEL and CentOS only'
exit 1
fi
os=$(cut -f 1 -d ' ' /etc/redhat-release)
if [ $os != 'CentOS' ] && [ $os != 'Red' ]; then
echo 'Error: sorry, we currently support RHEL and CentOS only'
fi
release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
help() {
echo "usage: $0 [OPTIONS]
-e, --email Define email address
-h, --help Print this help and exit
-f, --force Force installation"
exit 1
}
# Translating argument to --gnu-long-options
for arg; do
delim=""
case "$arg" in
--help) args="${args}-h " ;;
--force) args="${args}-f " ;;
--email) args="${args}-e " ;;
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
eval set -- "$args"
# Getopt
while getopts "hfe:" Option; do
case $Option in
h) help ;; # Help
e) email=$OPTARG ;; # Contact email
f) force=yes ;; # Force install
*) help ;; # Default
esac
done
# Are you sure ?
if [ -z $email ]; then
echo
echo
echo
echo
echo
echo ' ***********************************************************'
echo
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| '
echo ' _| _| _| _| _| _| _| '
echo ' _| _| _|_|_| _|_| _| _|_|_|_| '
echo ' _| _| _| _| _| _| _| '
echo ' _| _|_|_|_| _|_|_| _| _| _| '
echo
echo
echo
echo
echo
echo
echo
echo
echo ' ***********************************************************'
echo
echo
read -n 1 -p 'Do you want to install Vesta Control Panel? [y/n]): ' answer
if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then
echo 'Goodbye'
exit 1
fi
echo
# Check email
read -p 'Please enter valid email address: ' email
fi
# Validate email
local_part=$(echo $email | cut -s -f1 -d\@)
remote_host=$(echo $email | cut -s -f2 -d\@)
mx_failed=1
if [ ! -z "$remote_host" ] && [ ! -z "$local_part" ]; then
/usr/bin/host -t mx "$remote_host" &> /dev/null
mx_failed="$?"
fi
if [ "$mx_failed" -eq 1 ]; then
echo "Error: email $email is not valid"
exit 1
fi
echo
echo
echo
echo
echo 'Installation will take about 15 minutes ...'
echo
sleep 2
# Check wget
if [ ! -e '/usr/bin/wget' ]; then
yum -y install wget
if [ $? -ne 0 ]; then
echo "Error: can't install wget"
exit 1
fi
fi
# Check repo availability
wget "$RHOST/$REPO/vesta.conf" -O /dev/null
if [ $? -ne 0 ]; then
echo "Error: no access to $REPO repository"
exit 1
fi
# Check installed packages
tmpfile=$(mktemp -p /tmp)
rpm -qa > $tmpfile
for rpm in $rpms; do
if [ ! -z "$(grep ^$rpm. $tmpfile)" ]; then
conflicts="$rpm $conflicts"
fi
done
rm -f $tmpfile
if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
echo
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
echo
echo 'Following rpm packages aleady installed:'
echo "$conflicts"
echo
echo 'It is highly recommended to remove them before proceeding.'
echo
echo 'If you want to force installation run this script with -f option:'
echo "Example: bash $0 --force"
echo
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
echo
exit 1
fi
# Password generator
gen_pass() {
MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
LENGTH=10
while [ ${n:=1} -le $LENGTH ]; do
PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
let n+=1
done
echo "$PASS"
}
# Update system
yum -y update
if [ $? -ne 0 ]; then
echo 'Error: yum update failed'
exit 1
fi
# Install additional packages
yum -y install $tools
if [ $? -ne 0 ]; then
echo 'Error: yum install failed'
exit 1
fi
# Install EPEL repo
if [ ! -e '/etc/yum.repos.d/epel.repo' ]; then
if [ "$release" -eq '5' ]; then
epel="5/$arch/epel-release-5-4.noarch.rpm"
fi
if [ "$release" -eq '6' ]; then
epel="6/$arch/epel-release-6-8.noarch.rpm"
fi
rpm -ivh http://dl.fedoraproject.org/pub/epel/$epel
if [ $? -ne 0 ]; then
echo "Error: can't install EPEL repository"
exit 1
fi
fi
# Install remi repo
if [ ! -e '/etc/yum.repos.d/remi.repo' ]; then
if [ "$release" -eq '5' ]; then
remi="remi-release-5.rpm"
fi
if [ "$release" -eq '6' ]; then
remi="remi-release-6.rpm"
fi
rpm -ivh http://rpms.famillecollet.com/enterprise/$remi
if [ $? -ne 0 ]; then
echo "Error: can't install remi repository"
exit 1
fi
fi
# Install vesta repo
echo "[vesta]
name=Vesta - $REPO
baseurl=http://$RHOST/$REPO/$release/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" > $YUM_REPO
wget $CHOST/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
# Checking if old MySQL stuff exists
if [ -e '/var/lib/mysql' ]; then
mv -f /var/lib/mysql /var/lib/mysql_old
fi
if [ -e '/etc/my.cnf' ]; then
mv -f /etc/my.cnf /etc/my.cnf_old
fi
if [ -e '/root/.my.cnf' ]; then
mv -f /root/.my.cnf
fi
# Vesta packages
yum -y --enablerepo=remi install $rpms
if [ $? -ne 0 ]; then
echo 'Error: yum install failed'
exit 1
fi
# Configuring run levels
chkconfig iptables off
if [ -e /etc/init.d/sendmail ]; then
chkconfig sendmail off
fi
if [ -e /etc/init.d/postfix ]; then
chkconfig postfix off
fi
chkconfig vesta on
chkconfig httpd on
chkconfig nginx on
chkconfig mysqld on
chkconfig vsftpd on
chkconfig named on
chkconfig exim on
chkconfig clamd on
chkconfig spamassassin on
chkconfig dovecot on
# Make dirs more visible
echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
# Vesta does not support SELINUX for now
if [ -e '/etc/sysconfig/selinux' ]; then
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
fi
if [ -e '/etc/selinux/config' ]; then
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
fi
# Vesta use own webalizer routine
rm -f /etc/cron.daily/00webalizer
# NTP Synchronization
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate
chmod 775 /etc/cron.daily/ntpdate
ntpdate -s pool.ntp.org
# Vesta Environment
echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh
chmod 755 /etc/profile.d/vesta.sh
source /etc/profile.d/vesta.sh
echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile
echo 'export PATH' >> /root/.bash_profile
source /root/.bash_profile
mkdir -p $VESTA/conf
mkdir -p $VESTA/log
mkdir -p $VESTA/data
mkdir -p $VESTA/ssl
chmod 770 $VESTA/conf
# Make backup directory
vst_backups="/root/vst_install_backups/$(date +%s)"
mkdir -p $vst_backups
mkdir -p $vst_backups/nginx
mkdir -p $vst_backups/httpd
mkdir -p $vst_backups/mysql
mkdir -p $vst_backups/exim
mkdir -p $vst_backups/dovecot
mkdir -p $vst_backups/clamd
mkdir -p $vst_backups/vsftpd
mkdir -p $vst_backups/named
wget $RHOST/$REPO/vesta.conf -O $VESTA/conf/vesta.conf
if [ -e '/etc/sudoers' ]; then
mv /etc/sudoers $vst_backups/
fi
wget $CHOST/$VERSION/sudoers.conf -O /etc/sudoers
chmod 0440 /etc/sudoers
wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta
sed -i "s/umask 022/umask 002/g" /etc/profile
# Create backup directory
adduser backup
ln -s /home/backup /backup
chmod a+x /backup
# Configuring data templates
cd /usr/local/vesta/data
mkdir ips
mkdir queue
mkdir users
touch queue/backup.pipe
touch queue/disk.pipe
touch queue/webstats.pipe
touch queue/restart.pipe
touch queue/traffic.pipe
chmod 750 users
chmod 750 ips
chmod -R 750 queue
wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz
tar -xzf packages.tar.gz
rm -f packages.tar.gz
cd /usr/local/vesta/data
wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz
tar -xzf templates.tar.gz
rm -f templates.tar.gz
chmod -R 755 /usr/local/vesta/data/templates
cp templates/web/skel/public_html/index.html /var/www/html/
sed -i 's/%domain%/It worked!/g' /var/www/html/index.html
# Configuring ssl keys
cd /usr/local/vesta/ssl
wget $CHOST/$VERSION/certificate.crt -O certificate.crt
wget $CHOST/$VERSION/certificate.key -O certificate.key
# Adding admin user
vpass=$(gen_pass)
$VESTA/bin/v-add-user admin $vpass $email default System Administrator
if [ $? -ne 0 ]; then
echo "Error: can't create admin user"
exit 1
fi
# Set shell
$VESTA/bin/v-change-user-shell admin bash
# Apache
if [ -e '/etc/httpd/conf/httpd.conf' ]; then
mv /etc/httpd/conf/httpd.conf $vst_backups/httpd/
fi
if [ -e '/etc/httpd/conf.d/ssl.conf' ]; then
mv /etc/httpd/conf.d/ssl.conf $vst_backups/httpd/
fi
if [ -e '/etc/httpd/conf.d/proxy_ajp.conf' ]; then
mv /etc/httpd/conf.d/proxy_ajp.conf $vst_backups/httpd/
fi
wget $CHOST/$VERSION/httpd.conf -O /etc/httpd/conf/httpd.conf
wget $CHOST/$VERSION/httpd-status.conf -O /etc/httpd/conf.d/status.conf
wget $CHOST/$VERSION/httpd-ssl.conf -O /etc/httpd/conf.d/ssl.conf
wget $CHOST/$VERSION/httpd.log -O /etc/logrotate.d/httpd
echo "MEFaccept 127.0.0.1" >> /etc/httpd/conf.d/mod_extract_forwarded.conf
echo > /etc/httpd/conf.d/proxy_ajp.conf
echo > /etc/httpd/conf.d/vesta.conf
touch /var/log/httpd/access_log
touch /var/log/httpd/error_log
touch /var/log/httpd/suexec.log
mkdir -p /var/log/httpd/domains
chmod a+x /var/log/httpd
chmod 640 /var/log/httpd/access_log
chmod 640 /var/log/httpd/error_log
chmod 640 /var/log/httpd/suexec.log
chmod 751 /var/log/httpd/domains
# Nginx
if [ -e '/etc/nginx/nginx.conf' ]; then
mv /etc/nginx/nginx.conf $vst_backups/nginx/
fi
if [ -f '/etc/nginx/conf.d/default.conf' ]; then
mv /etc/nginx/conf.d/default.conf $vst_backups/nginx/
fi
if [ -e '/etc/nginx/conf.d/example_ssl.conf' ]; then
mv /etc/nginx/conf.d/example_ssl.conf $vst_backups/nginx/
fi
wget $CHOST/$VERSION/nginx.conf -O /etc/nginx/nginx.conf
wget $CHOST/$VERSION/nginx-status.conf -O /etc/nginx/conf.d/status.conf
touch /etc/nginx/conf.d/vesta_ip.conf
touch /etc/nginx/conf.d/vesta_users.conf
# VsFTP
if [ -e '/etc/vsftpd/vsftpd.conf' ]; then
mv /etc/vsftpd/vsftpd.conf $vst_backups/vsftpd/
fi
wget $CHOST/$VERSION/vsftpd.conf -O /etc/vsftpd/vsftpd.conf
# MySQL
if [ -e '/etc/my.cnf' ]; then
mv /etc/my.cnf $vst_backups/mysql/
fi
if [ -e '/root/.my.cnf' ]; then
mv /root/.my.cnf $vst_backups/mysql/
fi
mpass=$(gen_pass)
server_memory="$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])"
if [ "$server_memory" -gt '1000000' ]; then
wget $CHOST/$VERSION/mysql.cnf -O /etc/my.cnf
else
wget $CHOST/$VERSION/mysql-512.cnf -O /etc/my.cnf
fi
service mysqld start
mysqladmin -u root password $mpass
echo -e "[client]\npassword='$mpass'\n" >/root/.my.cnf
$VESTA/bin/v-add-database-server mysql localhost 3306 root $mpass
$VESTA/bin/v-add-database admin default default $(gen_pass) mysql
# Bind
if [ -e '/etc/named.conf' ]; then
mv /etc/named.conf $vst_backups/named/
fi
wget $CHOST/$VERSION/named.conf -O /etc/named.conf
chown root:named /etc/named.conf
chmod 640 /etc/named.conf
# Exim
if [ -e '/etc/exim/exim.conf' ]; then
mv /etc/exim/exim.conf $vst_backups/exim/
fi
if [ -e '/etc/clamd.conf' ]; then
mv /etc/clamd.conf $vst_backups/clamd/
fi
wget $CHOST/$VERSION/exim.conf -O /etc/exim/exim.conf
wget $CHOST/$VERSION/dnsbl.conf -O /etc/exim/dnsbl.conf
wget $CHOST/$VERSION/spam-blocks.conf -O /etc/exim/spam-blocks.conf
wget $CHOST/$VERSION/clamd.conf -O /etc/clamd.conf
mkdir /etc/exim/domains
chmod 640 /etc/exim/exim.conf
gpasswd -a clam exim
gpasswd -a exim mail
gpasswd -a clam mail
gpasswd -a dovecot mail
/usr/bin/freshclam
# Dovecot config
if [ "$release" -eq '5' ]; then
if -e [ '/etc/dovecot.conf' ]; then
mv /etc/dovecot.conf $vst_backups/dovecot/
fi
wget $CHOST/$VERSION/dovecot.conf -O /etc/dovecot.conf
else
if [ -e '/etc/dovecot' ]; then
mv /etc/dovecot/* $vst_backups/dovecot/
fi
wget $CHOST/$VERSION/dovecot.tar.gz -O /etc/dovecot.tar.gz
cd /etc/
tar -xzf dovecot.tar.gz
rm -f dovecot.tar.gz
fi
# PMA
wget $CHOST/$VERSION/httpd-pma.conf -O /etc/httpd/conf.d/phpMyAdmin.conf
wget $CHOST/$VERSION/pma.conf -O /etc/phpMyAdmin/config.inc.php
sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php
# Roundcube setup
wget $CHOST/$VERSION/httpd-webmail.conf -O /etc/httpd/conf.d/roundcubemail.conf
wget $CHOST/$VERSION/roundcube-main.conf -O /etc/roundcubemail/main.inc.php
wget $CHOST/$VERSION/roundcube-db.conf -O /etc/roundcubemail/db.inc.php
r="$(gen_pass)"
mysql -e "CREATE DATABASE roundcube"
mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'"
sed -i "s/%password%/$r/g" /etc/roundcubemail/db.inc.php
mysql roundcube < /usr/share/doc/roundcubemail-*/SQL/mysql.initial.sql
# Configuring ip
$VESTA/bin/v-update-sys-ip
# Get main ip
main_ip=$(ifconfig |grep 'inet addr:' |grep -v 127.0.0.1 |head -n1 |\
cut -f2 -d: | cut -f1 -d ' ')
# Add default web domain on main ip
$VESTA/bin/v-add-web-domain admin default.domain $main_ip
# Add default dns domain on main ip
$VESTA/bin/v-add-dns-domain admin default.domain $main_ip
# Add default mail domain
$VESTA/bin/v-add-mail-domain admin default.domain
# Configuring crond
command='sudo /usr/local/vesta/bin/v-update-sys-queue disk'
$VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic'
$VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats'
$VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-sys-queue backup'
$VESTA/bin/v-add-cron-job 'admin' '*/30' '*' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-backup-users'
$VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-user-stats'
$VESTA/bin/v-add-cron-job 'admin' '20' '00' '01' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-sys-rrd'
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
# Creating symlink
ln -s /usr/local/vesta/log /var/log/vesta
# Stop unused services
services='iptables sendmail postfix'
for srv in $services; do
service $srv status > /dev/null
if [ $? -eq 0 ]; then
service $srv stop
fi
done
# Start system service
services='vesta httpd nginx vsftpd exim dovecot clamd spamassassin named crond'
for srv in $services; do
service $srv status > /dev/null
if [ $? -gt 0 ]; then
service $srv start
else
service $srv restart
fi
done
# Change sendmail client
rm -f /etc/alternatives/mta
ln -s /usr/sbin/sendmail.exim /etc/alternatives/mta
# Build inititall rrd images
$VESTA/bin/v-update-sys-rrd
# Send notification to vestacp.com
wget vestacp.com/notify/?$REPO -O /dev/null
# Get server ip
vst_ip=$(wget vestacp.com/what-is-my-ip/ -O - 2>/dev/null)
if [ ! -z "$vst_ip" ] && [ "$vst_ip" != "$main_ip" ]; then
# Assign passive ip address
echo "pasv_address=$vst_ip" >> /etc/vsftpd/vsftpd.conf
fi
if [ -z "$vst_ip" ]; then
vst_ip=$main_ip
fi
# Send email
echo -e "Congratulations, you have just successfully installed \
the Vesta Control Panel
You can login in Vesta with following credentials:
username: admin
password: $vpass
https://$vst_ip:8083
We hope that you enjoy your installation of Vesta. Please \
feel free to contact us anytime if you have any questions.
Thank you.
--
Sincerely yours
vestacp.com team
" > $tmpfile
cat $tmpfile | mail -s "Vesta Control Panel" $email
rm -f $tmpfile
# Congrats
echo
echo
echo ' ***********************************************************'
echo
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| '
echo ' _| _| _| _| _| _| _| '
echo ' _| _| _|_|_| _|_| _| _|_|_|_| '
echo ' _| _| _| _| _| _| _| '
echo ' _| _|_|_|_| _|_|_| _| _| _| '
echo
echo ' Congratulations, you have just successfully installed'
echo ' the Vesta Control Panel!'
echo
echo ' Now you can login in Vesta with following credentials:'
echo ' username: admin'
echo " password: $vpass"
echo " https://$vst_ip:8083/"
echo
echo
echo ' Thank you for using our product.'
echo
echo ' ***********************************************************'
echo
echo
# Tricky way to get new PATH variable
cd
bash
# EOF
=======
#!/bin/bash
# Vesta installer
@ -1052,6 +412,9 @@ chmod 640 /var/log/httpd/error_log
chmod 640 /var/log/httpd/suexec.log
chmod 751 /var/log/httpd/domains
# Enable short_open_tag in php config
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php.ini
# Nginx
if [ -e '/etc/nginx/nginx.conf' ]; then
mv /etc/nginx/nginx.conf $vst_backups/nginx/
@ -1185,7 +548,7 @@ $VESTA/bin/v-add-cron-job 'admin' '*/30' '*' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-backup-users'
$VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-user-stats'
$VESTA/bin/v-add-cron-job 'admin' '20' '00' '01' '*' '*' "$command"
$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
command='sudo /usr/local/vesta/bin/v-update-sys-rrd'
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
@ -1285,4 +648,3 @@ cd
bash
# EOF
>>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

View file

@ -28,7 +28,6 @@ if (!empty($_POST['ok'])) {
$v_password = escapeshellarg($_POST['v_password']);
$v_type = $_POST['v_type'];
$v_charset = $_POST['v_charset'];
if (empty($_POST['v_notify'])) $v_notify = 'off';
// Check for errors
@ -41,6 +40,19 @@ if (!empty($_POST['ok'])) {
}
}
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
} else {
// Add Database
$v_type = escapeshellarg($_POST['v_type']);
$v_charset = escapeshellarg($_POST['v_charset']);
exec (VESTA_CMD."v-add-database ".$user." ".$v_database." ".$v_dbuser." ".$v_password." ".$v_type." 'default' ".$v_charset, $output, $return_var);
$v_type = $_POST['v_type'];
$v_charset = $_POST['v_charset'];
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = _('Error: vesta did not return any output.');
$_SESSION['error_msg'] = $error;
unset($v_password);
unset($output);
} else {
// Add Database
$v_type = escapeshellarg($_POST['v_type']);
@ -69,6 +81,7 @@ if (!empty($_POST['ok'])) {
$mailtext .= "--\n"._('Vesta Control Panel')."\n";
send_email($to, $subject, $mailtext, $from);
}
$_SESSION['ok_msg'] = _('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']);
unset($v_database);
@ -91,3 +104,4 @@ unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
?>

View file

@ -0,0 +1,28 @@
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
$service = $_POST['service'];
$action = $_POST['action'];
if ($_SESSION['user'] == 'admin') {
switch ($action) {
case 'stop': $cmd='v-stop-service';
break;
case 'start': $cmd='v-start-service';
break;
case 'restart': $cmd='v-restart-service';
break;
default: header("Location: /list/services/"); exit;
}
foreach ($service as $value) {
$value = escapeshellarg($value);
exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
}
}
header("Location: /list/services/");

View file

@ -415,7 +415,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; background: #fff; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 10pt; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Arial; color: #c69c6d;}
.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Arial; color: #323232;}
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }

View file

@ -481,6 +481,34 @@ if (!empty($_POST['save'])) {
$v_ftp_user = '';
$v_ftp_password = '';
}
if ((!empty($v_ftp_user)) && (!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
if (empty($_POST['v_ftp_user'])) $errors[] = _('ftp user');
if (empty($_POST['v_ftp_password'])) $errors[] = _('ftp user password');
if (!empty($errors[0])) {
foreach ($errors as $i => $error) {
if ( $i == 0 ) {
$error_msg = $error;
} else {
$error_msg = $error_msg.", ".$error;
}
}
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
}
if (($v_ftp_user != $_POST['v_ftp_user']) || ($_POST['v_ftp_password'] != "••••••••" ) && (empty($_SESSION['error_msg']))) {
$v_ftp_user = preg_replace("/^".$user."_/", "", $_POST['v_ftp_user']);
$v_ftp_user = escapeshellarg($v_ftp_user);
$v_ftp_password = escapeshellarg($_POST['v_ftp_password']);
exec (VESTA_CMD."v-add-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_user." ".$v_ftp_password, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = _('Error: vesta did not return any output.');
$_SESSION['error_msg'] = $error;
}
unset($output);
$v_ftp= '';
$v_ftp_user = '';
$v_ftp_password = '';
}
if ((!empty($v_ftp_user)) && (!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
if (empty($_POST['v_ftp_user'])) $errors[] = _('ftp user');
if (empty($_POST['v_ftp_password'])) $errors[] = _('ftp user password');
@ -509,6 +537,7 @@ if (!empty($_POST['save'])) {
$v_ftp_password = "••••••••";
}
}
}
if ((empty($v_ftp_user)) && (!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
if ((!empty($_POST['v_ftp_email'])) && (!filter_var($_POST['v_ftp_email'], FILTER_VALIDATE_EMAIL))) $_SESSION['error_msg'] = _('Please enter valid email address.');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

BIN
web/images/start.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
web/images/stop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

View file

@ -17,6 +17,9 @@ $LANG = array(
'minute'=>'минута',
'hour'=>'час',
'day'=>'день',
'days'=>'дня(ей)',
'hours'=>'часа(ов)',
'minutes'=>'минут(ы)',
'month'=>'месяц',
'day of week'=>'день недели',
'cmd'=>'командная строка',

View file

@ -65,10 +65,28 @@ function top_panel($user, $TAB) {
function humanize_time($usage) {
if ( $usage > 60 ) {
$usage = $usage / 60;
$usage = number_format($usage, 2);
$usage = $usage." Hour.";
if ( $usage > 24 ) {
$usage = $usage / 24;
$usage = number_format($usage, 0);
if ( $usage == 1 ) {
$usage = $usage." "._('day');
} else {
$usage = $usage." Min.";
$usage = $usage." "._('days');
}
} else {
$usage = number_format($usage, 0);
if ( $usage == 1 ) {
$usage = $usage." "._('hour');
} else {
$usage = $usage." "._('hours');
}
}
} else {
if ( $usage == 1 ) {
$usage = $usage." "._('minute');
} else {
$usage = $usage." "._('minutes');
}
}
return $usage;
}
@ -81,17 +99,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

@ -60,7 +60,7 @@ VE.callbacks.click.do_suspend = function(evt, elm) {
var ref = elm.hasClass('data-controls') ? elm : elm.parents('.data-controls');
var url = $('input[name="suspend_url"]', ref).val();
var dialog_elm = ref.find('.confirmation-text-suspention');
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm SUSPEND', url);
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm action', url);
}
/*
@ -70,7 +70,7 @@ VE.callbacks.click.do_unsuspend = function(evt, elm) {
var ref = elm.hasClass('data-controls') ? elm : elm.parents('.data-controls');
var url = $('input[name="unsuspend_url"]', ref).val();
var dialog_elm = ref.find('.confirmation-text-suspention');
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm UNSUSPEND', url);
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm action', url);
}
/*
@ -80,7 +80,7 @@ VE.callbacks.click.do_delete = function(evt, elm) {
var ref = elm.hasClass('data-controls') ? elm : elm.parents('.data-controls');
var url = $('input[name="delete_url"]', ref).val();
var dialog_elm = ref.find('.confirmation-text-delete');
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm DELETE', url);
VE.helpers.createConfirmationDialog(dialog_elm, 'Confirm action', url);
}

View file

@ -18,7 +18,6 @@ $data = json_decode(implode('', $output), true);
$data = array_reverse($data);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_log.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_log.html');
// Footer

View file

@ -0,0 +1,23 @@
<?php
// Init
error_reporting(NULL);
session_start();
$TAB = 'SERVICES';
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_services.html');
}
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -0,0 +1,22 @@
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-restart-service ".$v_service, $output, $return_var);
}
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: service '.$v_service.' restart failed';
$_SESSION['error_srv'] = $error;
}
unset($output);
}
header("Location: /list/services/");
exit;

View file

@ -0,0 +1,22 @@
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-start-service ".$v_service, $output, $return_var);
}
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: service '.$v_service.' start failed';
$_SESSION['error_srv'] = $error;
}
unset($output);
}
header("Location: /list/services/");
exit;

View file

@ -0,0 +1,22 @@
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-stop-service ".$v_service, $output, $return_var);
}
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: service '.$v_service.' stop failed';
$_SESSION['error_srv'] = $error;
}
unset($output);
}
header("Location: /list/services/");
exit;

View file

@ -1,4 +1,4 @@
<table class="sub-menu" style="background: white;">
<table class="sub-menu" style="background: white;">
<tr>
<td style="padding: 12px 0 8px 6px">
<div style="float:left">
@ -23,11 +23,10 @@
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</table>
</td>
</tr>
</table>
<div id="vstobjects">
<div style="height:10px; font-size:0;"></div>
<table class="data" style="background: #ebe9dc;">
@ -40,6 +39,7 @@
<div style="height:10px; font-size:0;"></div>
<table class="data">
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {

View file

@ -3,10 +3,10 @@
<tr>
<td style="padding: 12px 0 0 16px">
<div style="float:left">
<a class="vst" <?php if ((empty($_GET['period'])) || ($_GET['period'] == 'daily')) echo "style='color: #34536A'" ?> href="?period=daily"><?php print _('Daily');?></a>
<a class="vst" <?php if ($_GET['period'] == 'weekly') echo "style='color: #34536A'" ?> href="?period=weekly"><?php print _('Weekly');?></a>
<a class="vst" <?php if ($_GET['period'] == 'monthly') echo "style='color: #34536A'" ?> href="?period=monthly"><?php print _('Monthly');?></a>
<a class="vst" <?php if ($_GET['period'] == 'yearly') echo "style='color: #34536A'" ?> href="?period=yearly"><?php print _('Yearly');?></a>
<a class="vst" <?php if ((empty($_GET['period'])) || ($_GET['period'] == 'daily')) echo "style='color: #174f82'" ?> href="?period=daily"><?php print _('Daily');?></a>
<a class="vst" <?php if ($_GET['period'] == 'weekly') echo "style='color: #174f82'" ?> href="?period=weekly"><?php print _('Weekly');?></a>
<a class="vst" <?php if ($_GET['period'] == 'monthly') echo "style='color: #174f82'" ?> href="?period=monthly"><?php print _('Monthly');?></a>
<a class="vst" <?php if ($_GET['period'] == 'yearly') echo "style='color: #174f82'" ?> href="?period=yearly"><?php print _('Yearly');?></a>
</div>
<div style="text-align: right; float: right;">
<form action="/search/" method="get" >

View file

@ -0,0 +1,152 @@
<table class="sub-menu" style="background: white;">
<tr>
<td style="padding: 12px 0 8px 6px">
<div style="text-align: right; float: right;">
<form action="/search/" method="get" >
<input type="text" name="q" style="margin: 2px 2px 0px 0px; width: 250px; padding: 3px;" size="30">
<input type="submit" value="Search" class="button" style="font-size: 12px; height: 24px;">
</form>
</div>
<div style="float:left; padding-left: 0px;">
<form action="/bulk/service/" method="post" id="objects">
<a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
<select style="margin:0 2px 0 0px;" name="action">
<option>apply to selected</option>
<option>stop</option>
<option>start</option>
<option>restart</option>
</select>
<input type="submit" name="ok" value="" class="button" style="width: 37px; font-size: 12px; height: 24px;">
</div>
<?php
if (!empty($_SESSION['error_srv'])) {
?>
<div>
<script type="text/javascript">
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
</script>
<div id="dialog-message" title="Error">
<p><?php echo $_SESSION['error_srv'] ?></p>
</div>
</div>
<?php
unset($_SESSION['error_srv']);
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="vstobjects">
<table class='data'>
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['STATE'] == 'running') {
$status = 'active';
$action = 'stop';
} else {
$status = 'suspended';
$action = 'start';
}
$cpu = $data[$key]['CPU'] / 10;
$cpu = number_format($cpu, 1);
if ($cpu == '0.0') $cpu = 0;
?>
<tr class="data-row">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
<tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="service[]" value="<?php echo $key ?>" ></td></tr>
<tr><td class="data-<?php echo $status ?>"><b><?php echo $data[$key]['STATE'] ?></b></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px">
<tr>
<td></td>
<td class="data-controls" width="68px"><a href="/restart/service/?srv=<?php echo $key ?>"><img src="/images/reload.png" width="6px" height="7px"> restart</a></td>
<td class="data-controls" width="48px"><a href="/<?php echo $action ?>/service/?srv=<?php echo $key ?>"><img src="/images/<?php echo $action ?>.png" width="7px" height="7px"> <?php echo $action ?></a></td>
</tr>
</table>
<table class="data-col2" width="830px">
<tr>
<td colspan=4 class="domain" style="padding: 0 0 0 4px;">
<b><?php echo $key ?></b>
</td>
</tr>
<tr>
<td style="vertical-align:top;" width="200px">
<table>
<tr>
<td class="counter-name" style="padding: 2px 0 0 0">
<?php echo $data[$key]['SYSTEM'] ?>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="150px">
<table>
<tr>
<td class="counter-name">
CPU:
</td>
<td>
<a class="counter-value"> <?php echo $cpu ?>%</a>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" width="180px">
<table>
<tr>
<td class="counter-name">
Memory:
</td>
<td>
<a class="counter-value"><?php echo $data[$key]['MEM'] ?> mb</a>
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;" >
<table>
<tr>
<td class="counter-name">
Run Time:
</td>
<td>
<a class="counter-value"><?php echo humanize_time($data[$key]['RTIME']) ?> </a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php
}
?>
</table>
</form>
</div>

View file

@ -4,7 +4,7 @@
<td style="padding: 12px 0 0 16px">
<div style="float:left">
<form action="/list/stats/" method="get" id="objects">
<a class="vst" <?php if (empty($_GET['user'])) echo "style='color: #34536A'"; ?> href='/list/stats/'><?php print _('Overall Statistics');?></a>
<a class="vst" <?php if (empty($_GET['user'])) echo "style='color: #174f82'"; ?> href='/list/stats/'><?php print _('Overall Statistics');?></a>
<span style="padding: 0 8px;"></span>
<select style="margin:0 2px 0 0px;" name="user">
<option value=''><?php print _('show per user');?></option>

View file

@ -7,16 +7,16 @@
<td>
<table class="top">
<tr>
<td width="179px" style="border-bottom: 2px solid white; height: 24px;"></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'PACKAGE' ) echo 'selected-' ?>link" href="/list/package/"><b><?php print _('Packages');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'IP' ) echo 'selected-' ?>link" href="/list/ip/"><b><?php print _('IP Addresses');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'RRD' ) echo 'selected-' ?>link" href="/list/rrd/"><b><?php print _('RRD Graphics');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'STATS' ) echo 'selected-' ?>link" href="/list/stats/"><b><?php print _('Statistics');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'LOG' ) echo 'selected-' ?>link" href="/list/log/"><b><?php print _('History Log');?></a></b></td>
<td width="227px" style="border-bottom: 2px solid white; height: 24px; padding: 0 24px 0 0; text-align: right;"><b><?php if($user != $_SESSION['user']) echo 'admin / ' ?><?php echo $user ?></b><a class="top-link" style="padding: 0 0 0 6" href="/logout/"><?php print _('Log out');?></a></td>
<td width="179px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'PACKAGE' ) echo 'selected-' ?>link" href="/list/package/"><b><?php print _('Packages');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'IP' ) echo 'selected-' ?>link" href="/list/ip/"><b><?php print _('IP Addresses');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'RRD' ) echo 'selected-' ?>link" href="/list/rrd/"><b><?php print _('RRD Graphics');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'STATS' ) echo 'selected-' ?>link" href="/list/stats/"><b><?php print _('Statistics');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'LOG' ) echo 'selected-' ?>link" href="/list/log/"><b><?php print _('History Log');?></a></b></td>
<td width="227px" style="border-bottom: 1px solid #d6d6d6; height: 26px; padding: 0 24px 0 0; text-align: right;"><b><?php if($user != $_SESSION['user']) echo 'admin / ' ?><?php echo $user ?></b><a class="top-link" style="padding: 0 0 0 6" href="/logout/"><?php print _('Log out');?></a></td>
</tr>
<tr>
<td colspan="7" style="background: #ebe9dc; border-bottom: 8px solid #f7f6ed;">
<td colspan="7" style="background: #fff;">
<span class="nav-logo">
<img style="margin: 22px 0 0 4px;" src="/images/logo.png">

View file

@ -1,12 +1,4 @@
<table class="bottom">
<tr>
<td><?php print _('Powered by Vesta Control Panel');?></td>
</tr>
<tr>
<td><a href="http://vestacp.com">vestacp.com</a> | <a href="http://chto.su"><?php print _('Translation by ZonD80');?></a></td>
</tr>
</table>
</td>
</tr>
</table>
@ -16,7 +8,7 @@
VE.core.register($('.main'));
});
</script>
</center>
<br>
</body>
</html>

View file

@ -1,41 +1,44 @@
<html>
<head>
<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
<title>Vesta - <?php echo "$TAB"; ?> </title>
<style type="text/css">
<head>
<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
<title>Vesta - <?php echo "$TAB"; ?> </title>
<style type="text/css">
body {
body {
margin: 0;
margin-left: auto;
margin-right: auto;
background-image: url(/images/b.png);
font-family: Arial, sans-serif;
}
}
form {
form {
margin: 0;
}
}
.hidden {
.hidden {
display: none;
}
}
.main {
.main {
background: #ffffff;
padding: 0 0 28px 0;
box-shadow: 0 0 2px 2px #d7d7d7;
border-bottom: 1px solid #cccccc;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
<?php
<?php
if (!empty($_SESSION['look'])) {
echo " border-left: 2px solid #f79b44;\n";
echo " border-right: 2px solid #f79b44;\n";
}
?>
}
?>
}
.top {
background: #444;
color: #cce4f0;
.top {
background: #ebe9dc;
color: #825117;
padding: 0;
margin-left: auto;
margin-right: auto;
@ -45,97 +48,101 @@ form {
line-height: 1.2em;
border: 0px;
border-collapse:collapse;
}
}
.top-link {
.top-link {
text-decoration: none;
color: #e0e0e0;
}
color: #323232;
}
.top-link:hover {
color: white;
}
.top-link:hover {
color: #174f82;
}
.top-link:active{
color: #f5edb6;
}
.top-link:active{
color: #ccc;
}
.top-selected-link {
.top-selected-link {
text-decoration: none;
color: #f5edb6;
}
color: #174f82;
}
.top-logout {
.top-logout {
text-decoration: none;
color: #e6e6e6;
padding: 0 0 0 2px;
border: noner;
}
}
.top-logout:hover {
.top-logout:hover {
color: white;
}
}
.nav-logo {
.nav-logo {
float:left;
height:100px;
width:159px;
background: #ebe9dc;
}
height:104px;
width:161px;
margin: 0 0px 0 0;
border-bottom: 3px solid #d6d6d6;
}
.nav-lnk {
.nav-lnk {
text-decoration: none;
color: #444;
color: #323232;
float:left;
}
}
.nav-lnk:active {
.nav-lnk:active {
color: #ccc;
}
}
.nav-block {
margin: 0 2px 0 0;
height:100px;
width: 116px;
.nav-block {
margin: 0 0px 0 0;
height:104px;
width: 118px;
float:left;
cursor: pointer;
}
border-bottom: 3px solid #d6d6d6;
.nav-block:hover {
background: #fafafa;
}
}
.nav-selected-block {
margin: 0 2px 0 0;
color: #80a7cc;
height: 100px;
width: 116px;
.nav-block:hover {
border-bottom: 3px solid #f79b44;
}
.nav-selected-block {
margin: 0;
color: #174f82;
height: 104px;
width: 118px;
float: left;
background: #fafafa;
background: #fff;
border-bottom: 3px solid #777;
cursor: pointer;
}
}
.nav-selected-block:hover {
background: #fafafa;
}
.nav-selected-block:hover {
border-bottom: 3px solid #f79b44;
}
.nav-header {
padding: 13px 0 0 6px;
.nav-header {
padding: 16px 0 0 6px;
margin: 0;
letter-spacing: -1.0px;
font-size: 16pt;
font-weight: bold;
}
}
.nav-selected-header {
padding: 13px 0 0 6px;
.nav-selected-header {
padding: 16px 0 0 6px;
margin: 0;
letter-spacing: -1.0px;
font-size: 16pt;
font-weight: bold;
}
}
.nav-counters {
.nav-counters {
padding: 6px 0 5px 6px;
margin: 0;
height: 58px;
@ -143,9 +150,9 @@ form {
letter-spacing: 0.1px;
font-size: 9pt;
color: #555;
}
}
.sub-menu {
.sub-menu {
margin-left: auto;
margin-right: auto;
width: 990px;
@ -155,20 +162,20 @@ form {
vertical-align:top;
padding: 0px 10px 0px 0;
background: none repeat scroll 0% 0% white;
}
}
.select-controls {
.select-controls {
color: #6A6A6A;
font-size: 8pt;
letter-spacing: 0.1em;
text-decoration: none;
}
}
.select-controls:hover {
.select-controls:hover {
text-decoration: underline;
}
}
.bottom {
.bottom {
background: #ebe9dc;
color: #555;
margin: 30 0 0 0;
@ -181,41 +188,41 @@ form {
vertical-align:top;
line-height: 0.8em;
border-top: 4px solid #d6d4c9;
}
}
.bottom a:link {
.bottom a:link {
font-size: 8pt;
text-decoration: none;
color: #555;
}
}
.bottom a:visited {
.bottom a:visited {
text-decoration: none;
color: #555;
}
}
.bottom a:hover {
.bottom a:hover {
text-decoration: underline;
color: #7fa1cb;
}
}
.vst {
.vst {
padding: 0 8px 0 0;
margin: 0;
text-decoration: none;
color: #8B99A2;
color: #777;
font-size: 12pt;
}
}
.vst:hover {
.vst:hover {
text-decoration: underline;
}
}
.vst:active {
color: #34536A;
}
.vst:active {
color: #174f82;
}
.data {
.data {
border-collapse:collapse;
margin-left: auto;
margin-right: auto;
@ -226,258 +233,259 @@ form {
vertical-align:top;
margin: 0;
behavior:url("/css/csshover3.htc");
}
}
.data-row:hover {
.data-row:hover {
margin: 0;
background-color: #f7f6ed;
}
}
.datarowhover {
.datarowhover {
margin: 0;
background-color: #f7f6ed;
}
}
.data-null {
.data-null {
margin: 0;
width: 990px;
height: 10px;
border-top:1px dotted #dce8f5;
}
border-top:1px dotted #ccc;
}
.data-spacer {
.data-spacer {
margin: 0;
width: 990px;
}
}
.data-add {
.data-add {
margin: 0;
background-color: #f7f6ed;
}
border-bottom: 1px dotted #ccc;
}
.data-dotted {
.data-dotted {
text-align: left;
vertical-align:top;
border-top:1px dotted #dce8f5;
border-top:1px dotted #ccc;
padding: 0 0 26px 0;
margin: 0;
}
}
.data-dotted td {
.data-dotted td {
margin: 0;
}
}
.data-col1 {
.data-col1 {
text-align: left;
padding: 0;
}
}
.data-col2 {
.data-col2 {
text-align: left;
padding: 0;
overflow: hidden;
}
}
.data-col5 {
.data-col5 {
table-layout: fixed;
text-align: left;
padding: 0;
overflow: hidden;
white-space: nowrap;
}
}
.data-date {
.data-date {
padding: 0 0 0 18;
letter-spacing: 0.3em;
font-size: 8pt;
color: #6A6A6A
}
}
.data-active {
.data-active {
font-size: 8pt;
letter-spacing: 0.1em;
color: #9ba68c;
color: #81a64f;
padding: 0 0 13 18;
}
}
.data-suspended {
.data-suspended {
font-size: 8pt;
letter-spacing: 0.1em;
color: #de6c5d;
color: #de5543;
padding: 0 0 13 18;
}
}
.data-controls {
border-left: 1px solid #E6E6E6;
.data-controls {
border-left: 1px solid #ccc;
font-size: 8pt;
padding: 2 5 0 5;
letter-spacing: 0.1em;
color: #34536A;
color: #174f82;
text-decoration: none;
cursor: pointer;
}
}
.data-controls:hover {
.data-controls:hover {
color: #ffffff;
background: #f79b44;
}
}
.data-controls:active {
.data-controls:active {
color: #433832;
background: #f79b44;
}
}
.data-controls a:link {
color: #34536A;
.data-controls a:link {
color: #174f82;
text-decoration: none;
}
}
.data-controls a:visited {
color: #34536A;
}
.data-controls a:visited {
color: #174f82;
}
.data-controls a:hover {
.data-controls a:hover {
color: #ffffff;
}
}
.data-controls a:active {
.data-controls a:active {
color: #433832;
}
}
.data-controls img {
.data-controls img {
border: 0px;
}
}
.data-count {
.data-count {
background: #ebe9dc;
color: #555;
font-size: 8pt;
margin: 18px 0 0 0;
text-align:right;
padding: 0 16px 0 0;
}
}
.chart1 {
.chart1 {
font-size: 10pt;
}
}
.chart2 {
.chart2 {
color: #484243;
font-size: 8pt;
}
}
.username {
color: #555;
.username {
color: #323232;
font-size: 16pt;
line-height: 1.2em;
}
}
.domain {
color: #555;
.domain {
color: #323232;
font-size: 16pt;
line-height: 0.8em;
}
}
.cron {
color: #555;
.cron {
color: #323232;
font-size: 18px;
}
}
.log {
color: #555;
.log {
color: #323232;
font-size: 12pt;
}
}
.aliases {
.aliases {
font-size: 12pt;
color: #99a7af;
padding: 0 0 0 8px;
}
}
.nginx-ext {
.nginx-ext {
color: black;
vertical-align:top;
font-size: 10pt;
}
}
.fullname {
.fullname {
font-size: 18px;
color: #99a7af;
padding: 0 0 0 8px;
}
}
.counter-name {
.counter-name {
vertical-align:top;
line-height: 1.2em;
font-size: 10pt;
color: #484243;
color: #5c5455;
}
}
.cron-counter-name {
.cron-counter-name {
vertical-align:top;
line-height: 0.8em;
font-size: 8pt;
padding: 4 0 0 0;
color: #484243;
color: #5c5455;
}
}
.counter-value {
.counter-value {
vertical-align:top;
line-height: 1.2em;
font-size: 10pt;
color: black;
padding: 0 0 0 4px;
}
}
.log-counter-value {
.log-counter-value {
vertical-align:top;
font-size: 12pt;
color: #484243;
}
}
.cron-counter-value {
.cron-counter-value {
vertical-align:top;
line-height: 1.2em;
font-size: 12pt;
color: #484243;
}
}
.name {
.name {
font-size: 16pt;
color: #777;
padding: 0 0 0 10px;
}
}
.vst-ok {
.vst-ok {
font-size: 18px;
color: #62a358;
padding: 0 0 0 6px;
}
}
.vst-ok a{
.vst-ok a{
color: #58934f;
text-decoration: none;
}
}
.vst-ok a:hover{
.vst-ok a:hover{
text-decoration: underline;
}
}
.vst-error {
.vst-error {
font-size: 18px;
color: #de6c5d;
padding: 0 0 0 6px;
}
}
.vst-text {
.vst-text {
color: #333;
font-size: 12pt;
}
}
.vst-textinput {
.vst-textinput {
background-color: #FFFFFF;
border: 1px solid #999999;
border-radius: 3px 3px 3px 3px;
@ -486,17 +494,17 @@ form {
padding: 6px;
width: 360px;
height: 120px;
}
}
.vst-textinput:hover {
border: 1px solid #e5a907;
}
.vst-textinput:hover {
border: 1px solid #f79b44;
}
.vst-textinput:disabled {
.vst-textinput:disabled {
background-color: #F1F1F1;
}
}
.vst-input {
.vst-input {
background-color: #FFFFFF;
border: 1px solid #999999;
border-radius: 3px 3px 3px 3px;
@ -505,38 +513,38 @@ form {
padding: 6px;
width: 360px;
height: 36px;
}
}
.vst-input:hover {
border: 1px solid #e5a907;
}
.vst-input:hover {
border: 1px solid #f79b44;
}
.vst-input:disabled {
.vst-input:disabled {
background-color: #f1f1f1;
}
}
.vst-list {
.vst-list {
padding: 4px;
font-size: 12pt;
color: #555;
border-radius: 3px 3px 3px 3px;
border: 1px solid #999999;
}
}
.vst-list:hover {
border: 1px solid #e5a907;
}
.vst-list:hover {
border: 1px solid #f79b44;
}
.vst-checkbox {
.vst-checkbox {
padding: 4px;
font-size: 12pt;
}
}
.vst-checkbox:hover {
border: 1px solid #e5a907;
}
.vst-checkbox:hover {
border: 1px solid #f79b44;
}
button {
button {
cursor: pointer;
color: #333;
background-color: #fafafa;
@ -546,17 +554,17 @@ button {
padding: 2px 16px;
width: 108px;
height: 24px;
}
}
button:hover {
button:hover {
background-color: #f0f0f0;
}
}
button:active {
button:active {
background-color: #e6e6e6;
}
}
.button {
.button {
filter:chroma(color=#000000);
cursor: pointer;
color: #333;
@ -567,107 +575,107 @@ button:active {
padding: 2px 16px;
width: 108px;
height: 32px;
}
}
.button:hover {
.button:hover {
background-color: #f0f0f0;
}
}
.button:active {
.button:active {
background-color: #e6e6e6;
}
}
.genpass {
.genpass {
color: #34536a;
font-size: 8pt;
padding: 0 5px 0 8px;
letter-spacing: 0.1em;
text-decoration: underline;
}
}
.genpass:hover {
.genpass:hover {
color: #7fa1cb;
}
}
.vst-advanced {
.vst-advanced {
color: #34536a;
font-size: 10pt;
letter-spacing: 0.1em;
text-decoration: none;
border-bottom: 1px solid #f79b44;
}
}
.vst-advanced:hover {
.vst-advanced:hover {
color: #7fa1cb;
}
}
/* fixed header */
.fixed{
.fixed{
position: fixed;
border: none;
top: -3px;
border-bottom: 2px solid #ebe9dc;
border-bottom: 1px solid #ccc;
background-color: #fff;
}
}
*html .fixed{
*html .fixed{
position:absolute;
position:fixed; _position:absolute; top:0; _top:expression( eval(document.body.scrollTop) + 'px' );
}
}
#vstobjects{
#vstobjects{
padding-top: 188px;
width: 996px;
padding-left: 3px;
min-height: 370px;
}
}
.login {
.login {
margin: 80px 0 80px 0;
padding: 0;
border-top: 1px solid #cccccc;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
background: #ebe9dc;
background: #fff;
text-align: left;
vertical-align:top;
width: 500px;
box-shadow: 0 0 2px 2px #d7d7d7;
}
}
.login-box {
.login-box {
text-align: left;
vertical-align:top;
padding: 0 0 10px 40px;
color: #333;
}
color: #323232;
}
.login-bottom {
color: #574F51;
.login-bottom {
color: #ebe9dc;
text-align: right;
width: 500px;
height: 50px;
background: #484243;
background: #ebe9dc;
padding: 0 8px 0 0;
margin: 0;
}
}
.vestacp{
.vestacp{
font-size: 8pt;
color: #CCCCB4;
color: #323232;
text-align: right;
padding: 20px 0 0 0;
}
}
.error {
.error {
font-size: 10pt;
color: #DE6C5D;
}
color: #dE6c5d;
}
</style>
<!--[if IE]>
<style type="text/css">
</style>
<!--[if IE]>
<style type="text/css">
html, body, div, span, applet, object, iframe {
margin: 0;
padding: 0;
@ -686,20 +694,20 @@ button:active {
}
#vstobjects{
padding-top: 188px;
padding-top: 187px;
min-height: 370px;
height: auto !important;
height: 370px;
width: 996px;
}
</style>
<![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>
<script type="text/javascript" src="/js/jquery-ui-1.8.20.custom.min.js"></script>
<script language="JavaScript">
</style>
<![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>
<script type="text/javascript" src="/js/jquery-ui-1.8.20.custom.min.js"></script>
<script language="JavaScript">
var checked=false;
var frmname='';
function checkedAll(frmname) {
@ -713,6 +721,6 @@ button:active {
valus.elements[i].checked=checked;
}
}
</script>
</head>
<body>
</script>
</head>
<body>

View file

@ -7,16 +7,17 @@
<td>
<table class="top">
<tr>
<td width="174px" style="border-bottom: 2px solid white; height: 24px;"></td>
<td width="118px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'STATS' ) echo 'selected-' ?>link" href="/list/stats/"><b><?php print _('Statistics');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"><a class="top-<?php if($TAB == 'LOG' ) echo 'selected-' ?>link" href="/list/log/"><b><?php print _('History Log');?></a></b></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"></td>
<td width="120px" style="border-bottom: 2px solid white; height: 24px;"></td>
<td width="228px" style="border-bottom: 2px solid white; height: 24px; padding: 0 24px 0 0; text-align: right;"><b><?php if($user != $_SESSION['user']) echo 'admin / ' ?><?php echo $user ?></b><a class="top-link" style="padding: 0 0 0 6" href="/logout/"><?php print _('Log out');?></a></td>
<td width="174px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"></td>
<td width="118px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'STATS' ) echo 'selected-' ?>link" href="/list/stats/"><b><?php print _('Statistics');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"><a class="top-<?php if($TAB == 'LOG' ) echo 'selected-' ?>link" href="/list/log/"><b><?php print _('History Log');?></a></b></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"></td>
<td width="120px" style="border-bottom: 1px solid #d6d6d6; height: 26px;"></td>
<td width="228px" style="border-bottom: 1px solid #d6d6d6; height: 26px; padding: 0 24px 0 0; text-align: right;"><b><?php if($user != $_SESSION['user']) echo 'admin / ' ?><?php echo $user ?></b><a class="top-link" style="padding: 0 0 0 6" href="/logout/"><?php print _('Log out');?></a></td>
</tr>
<tr>
<td colspan="7" style="background: #ebe9dc; border-bottom: 8px solid #f7f6ed;">
<td colspan="7" style="background: #fff;">
<span class="nav-logo">
<img style="margin: 22px 0 0 4px;" src="/images/logo.png">