Selaa lähdekoodia

Merge changes from upstream

ZonD Eighty 13 vuotta sitten
vanhempi
sitoutus
c094d8582d
54 muutettua tiedostoa jossa 4979 lisäystä ja 5669 poistoa
  1. 11 94
      bin/v-add-dns-on-web-alias
  2. 7 81
      bin/v-add-web-domain-ftp
  3. 188 0
      bin/v-list-sys-services
  4. 3 0
      bin/v-list-user-stats
  5. 3 0
      bin/v-list-users-stats
  6. 1 1
      bin/v-rebuild-user
  7. 1 316
      bin/v-rebuild-web-domains
  8. 2 4
      bin/v-restart-cron
  9. 3 4
      bin/v-restart-dns
  10. 3 4
      bin/v-restart-mail
  11. 42 0
      bin/v-restart-service
  12. 9 13
      bin/v-restart-web
  13. 42 0
      bin/v-start-service
  14. 42 0
      bin/v-stop-service
  15. 1 173
      bin/v-update-user-stats
  16. 7 7
      func/domain.sh
  17. 1 1
      func/main.sh
  18. 21 78
      install/0.9.7/rhel/roundcube-driver.php
  19. 35 34
      install/0.9.7/rhel/templates/web/apache_phpcgi.stpl
  20. 28 27
      install/0.9.7/rhel/templates/web/apache_phpcgi.tpl
  21. 36 35
      install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl
  22. 28 27
      install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl
  23. 19 657
      install/vst-install.sh
  24. 107 93
      web/add/db/index.php
  25. 28 0
      web/bulk/service/index.php
  26. 545 545
      web/css/jquery-custom-dialogs.css
  27. 616 587
      web/edit/web/index.php
  28. BIN
      web/images/logo.png
  29. BIN
      web/images/start.png
  30. BIN
      web/images/stop.png
  31. 3 0
      web/inc/i18n/ru.php
  32. 176 158
      web/inc/main.php
  33. 124 124
      web/js/events.js
  34. 24 25
      web/list/log/index.php
  35. 23 0
      web/list/services/index.php
  36. 22 0
      web/restart/service/index.php
  37. 22 0
      web/start/service/index.php
  38. 22 0
      web/stop/service/index.php
  39. 184 184
      web/templates/admin/add_db.html
  40. 146 146
      web/templates/admin/list_dns.html
  41. 115 115
      web/templates/admin/list_dns_rec.html
  42. 173 173
      web/templates/admin/list_mail.html
  43. 162 162
      web/templates/admin/list_mail_acc.html
  44. 72 72
      web/templates/admin/list_rrd.html
  45. 152 0
      web/templates/admin/list_services.html
  46. 221 221
      web/templates/admin/list_stats.html
  47. 112 112
      web/templates/admin/panel.html
  48. 1 9
      web/templates/footer.html
  49. 726 718
      web/templates/header.html
  50. 136 136
      web/templates/user/list_dns.html
  51. 105 105
      web/templates/user/list_dns_rec.html
  52. 163 163
      web/templates/user/list_mail.html
  53. 152 152
      web/templates/user/list_mail_acc.html
  54. 114 113
      web/templates/user/panel.html

+ 11 - 94
bin/v-add-dns-on-web-alias

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 #!/bin/bash
 # info: add dns domain or dns record based on web domain alias restart
 # options: USER DOMAIN
@@ -50,15 +49,21 @@ 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
+        $BIN/v-add-dns-domain \
+            $user $dom_alias $IP '' '' '' '' '' $restart > /dev/null
     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
+        $BIN/v-add-dns-domain \
+            $user $dom $IP '' '' '' '' '' $restart > /dev/null
+
+        if [ $? -eq 0 ]; then
+            $BIN/v-add-dns-domain-record \
+                $user $dom "$sub" A $IP '' '' $restart
+        fi
     else
         if [ "$sub" == '*' ]; then
             rec=$(grep -w "RECORD='\*'" $USER_DATA/dns/$dom.conf)
@@ -66,7 +71,8 @@ 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
+            $BIN/v-add-dns-domain-record \
+                 $user $dom "$sub" A $IP '' '' $restart > /dev/null
         fi
     fi
 fi
@@ -79,92 +85,3 @@ fi
 # No Logging
 
 exit
-=======
-#!/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 > /dev/null
-    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 > /dev/null
-
-        if [ $? -eq 0 ]; then
-            $BIN/v-add-dns-domain-record \
-                $user $dom "$sub" A $IP '' '' $restart
-        fi
-    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 > /dev/null
-        fi
-    fi
-fi
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-# No Logging
-
-exit
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 7 - 81
bin/v-add-web-domain-ftp

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 #!/bin/bash
 # info: add ftp account for web domain.
 # options: USER DOMAIN FTP_USER FTP_PASSWORD
@@ -44,8 +43,14 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Get domain values
 get_domain_values 'web'
+check_ftp_user=$(grep "^$ftp_user:" /etc/passwd)
+if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then
+    echo "Error: ftp user $ftp_user already exists"
+    log_event "$E_EXISTS $EVENT"
+    exit $E_EXISTS
+fi
+
 if [ ! -z "$FTP_USER" ]; then
     /usr/sbin/userdel $FTP_USER
 fi
@@ -70,82 +75,3 @@ 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
-#
-# 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 'web'
-check_ftp_user=$(grep "^$ftp_user:" /etc/passwd)
-if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then
-    echo "Error: ftp user $ftp_user already exists"
-    log_event "$E_EXISTS $EVENT"
-    exit $E_EXISTS
-fi
-
-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
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 188 - 0
bin/v-list-sys-services

@@ -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

+ 3 - 0
bin/v-list-user-stats

@@ -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"

+ 3 - 0
bin/v-list-users-stats

@@ -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"

+ 1 - 1
bin/v-rebuild-user

@@ -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

+ 1 - 316
bin/v-rebuild-web-domains

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 #!/bin/bash
 # info: rebuild dns domains
 # options: USER [RESTART]
@@ -79,7 +78,7 @@ for domain in $(shell_list) ; do
 
     chmod 551 $HOMEDIR/$user/web/$domain
     chmod 771 $HOMEDIR/$user/web/$domain/private
-    chmod 771 $HOMEDIR/$user/web/$domain/cgi-bin
+    chmod 751 $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
@@ -311,317 +310,3 @@ fi
 log_event "$OK" "$EVENT"
 
 exit
-=======
-#!/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 751 $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
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 2 - 4
bin/v-restart-cron

@@ -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

+ 3 - 4
bin/v-restart-dns

@@ -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

+ 3 - 4
bin/v-restart-mail

@@ -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 - 0
bin/v-restart-service

@@ -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

+ 9 - 13
bin/v-restart-web

@@ -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 - 0
bin/v-start-service

@@ -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 - 0
bin/v-stop-service

@@ -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

+ 1 - 173
bin/v-update-user-stats

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 #!/bin/bash
 # info: update user statistics
 # options: USER
@@ -69,7 +68,7 @@ TOTAL_U_BACKUPS=0
 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')
+    next_month=$(date +'%m/01/%y' -d '+ 1 month')
     DATE=$(date -d "$next_month -1day" +%F)
 
     # Compiling report string
@@ -168,174 +167,3 @@ fi
 log_event "$OK" "$EVENT"
 
 exit
-=======
-#!/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/%y' -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
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 7 - 7
func/domain.sh

@@ -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"

+ 1 - 1
func/main.sh

@@ -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

+ 21 - 78
install/0.9.7/rhel/roundcube-driver.php

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 <?php
 
 /**
@@ -26,25 +25,31 @@ class rcube_vesta_password
             $vesta_port = '8083';
         }
 
-        $request  = 'email='.$_SESSION['username'].'&';
-        $request .= 'password='.$curpass.'&';
-        $request .= 'new='.$passwd.'&';
+        $postvars = array(
+          'email' => $_SESSION['username'],
+          'password' => $curpass,
+          'new' => $passwd
+        );
 
+        $postdata = http_build_query($postvars);
 
-        $context = stream_context_create(array(
-            'http' => array(
-                'method' => 'POST',
-                'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL,
-                'content' => $request,
-            ),
-        ));
+        $send  = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+        $send .= 'Host: ' . $vesta_host . PHP_EOL;
+        $send .= 'User-Agent: PHP Script' . PHP_EOL;
+        $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+        $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+        $send .= 'Connection: close' . PHP_EOL;
+        $send .= PHP_EOL;
+        $send .= $postdata . PHP_EOL . PHP_EOL;
 
-        $result = file_get_contents(
-            $file = "https://".$vesta_host.":".$vesta_port."/reset/mail/?",
-            $use_include_path = false,
-            $context);
+        $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+        fputs($fp, $send);
+        $result = fread($fp, 2048);
+        fclose($fp);
 
-        if ($result == 'ok'){
+
+        if(strpos($result, 'ok') && !strpos($html, 'error'))
+        {
             return PASSWORD_SUCCESS;
         }
         else {
@@ -53,65 +58,3 @@ class rcube_vesta_password
 
     }
 }
-=======
-<?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';
-        }
-
-        $postvars = array(
-          'email' => $_SESSION['username'],
-          'password' => $curpass,
-          'new' => $passwd
-        );
-
-        $postdata = http_build_query($postvars);
-
-        $send  = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
-        $send .= 'Host: ' . $vesta_host . PHP_EOL;
-        $send .= 'User-Agent: PHP Script' . PHP_EOL;
-        $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
-        $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
-        $send .= 'Connection: close' . PHP_EOL;
-        $send .= PHP_EOL;
-        $send .= $postdata . PHP_EOL . PHP_EOL;
-
-        $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
-        fputs($fp, $send);
-        $result = fread($fp, 2048);
-        fclose($fp);
-
-
-        if(strpos($result, 'ok') && !strpos($html, 'error'))
-        {
-            return PASSWORD_SUCCESS;
-        }
-        else {
-            return PASSWORD_ERROR;
-        }
-
-    }
-}
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 35 - 34
install/0.9.7/rhel/templates/web/apache_phpcgi.stpl

@@ -1,34 +1,35 @@
-<VirtualHost %ip%:%web_ssl_port%>
-
-    ServerName %domain_idn%
-    %alias_string%
-    ServerAdmin %email%
-    DocumentRoot %sdocroot%
-    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
-    Alias /vstats/ %home%/%user%/web/%domain%/stats/
-    Alias /error/ %home%/%user%/web/%domain%/document_errors/
-    SuexecUserGroup %user% %group%
-    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
-    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
-        Action phpcgi-script /cgi-bin/php
-        AddHandler phpcgi-script .php
-    </Directory>
-    <Directory %home%/%user%/web/%domain%/stats>
-        AllowOverride All
-    </Directory>
-    SSLEngine on
-    SSLVerifyClient none
-    SSLCertificateFile %ssl_crt%
-    SSLCertificateKeyFile %ssl_key%
-    %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
-
-    Include %home%/%user%/conf/web/shttpd.%domain%.conf*
-
-</VirtualHost>
-
+<VirtualHost %ip%:%web_ssl_port%>
+
+    ServerName %domain_idn%
+    %alias_string%
+    ServerAdmin %email%
+    DocumentRoot %sdocroot%
+    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
+    Alias /vstats/ %home%/%user%/web/%domain%/stats/
+    Alias /error/ %home%/%user%/web/%domain%/document_errors/
+    SuexecUserGroup %user% %group%
+    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
+    CustomLog /var/log/httpd/domains/%domain%.log combined
+    %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
+    <Directory %sdocroot%>
+        SSLRequireSSL
+        AllowOverride All
+        Options +Includes -Indexes +ExecCGI
+        Action phpcgi-script /cgi-bin/php
+        <Files *.php>
+            SetHandler phpcgi-script
+        </Files>
+    </Directory>
+    <Directory %home%/%user%/web/%domain%/stats>
+        AllowOverride All
+    </Directory>
+    SSLEngine on
+    SSLVerifyClient none
+    SSLCertificateFile %ssl_crt%
+    SSLCertificateKeyFile %ssl_key%
+    %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+    Include %home%/%user%/conf/web/shttpd.%domain%.conf*
+
+</VirtualHost>
+

+ 28 - 27
install/0.9.7/rhel/templates/web/apache_phpcgi.tpl

@@ -1,27 +1,28 @@
-<VirtualHost %ip%:%web_port%>
-
-    ServerName %domain_idn%
-    %alias_string%
-    ServerAdmin %email%
-    DocumentRoot %docroot%
-    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
-    Alias /vstats/ %home%/%user%/web/%domain%/stats/
-    Alias /error/ %home%/%user%/web/%domain%/document_errors/
-    SuexecUserGroup %user% %group%
-    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
-    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
-        Action phpcgi-script /cgi-bin/php
-        AddHandler phpcgi-script .php
-    </Directory>
-    <Directory %home%/%user%/web/%domain%/stats>
-        AllowOverride All
-    </Directory>
-    Include %home%/%user%/conf/web/httpd.%domain%.conf*
-
-</VirtualHost>
-
+<VirtualHost %ip%:%web_port%>
+
+    ServerName %domain_idn%
+    %alias_string%
+    ServerAdmin %email%
+    DocumentRoot %docroot%
+    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
+    Alias /vstats/ %home%/%user%/web/%domain%/stats/
+    Alias /error/ %home%/%user%/web/%domain%/document_errors/
+    SuexecUserGroup %user% %group%
+    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
+    CustomLog /var/log/httpd/domains/%domain%.log combined
+    %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
+    <Directory %docroot%>
+        AllowOverride All
+        Options +Includes -Indexes +ExecCGI
+        Action phpcgi-script /cgi-bin/php
+        <Files *.php>
+            SetHandler phpcgi-script
+        </Files>
+    </Directory>
+    <Directory %home%/%user%/web/%domain%/stats>
+        AllowOverride All
+    </Directory>
+    Include %home%/%user%/conf/web/httpd.%domain%.conf*
+
+</VirtualHost>
+

+ 36 - 35
install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl

@@ -1,35 +1,36 @@
-<VirtualHost %ip%:%web_ssl_port%>
-
-    ServerName %domain_idn%
-    %alias_string%
-    ServerAdmin %email%
-    DocumentRoot %sdocroot%
-    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
-    Alias /vstats/ %home%/%user%/web/%domain%/stats/
-    Alias /error/ %home%/%user%/web/%domain%/document_errors/
-    SuexecUserGroup %user% %group%
-    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
-    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
-        FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
-    </Directory>
-    <Directory %home%/%user%/web/%domain%/stats>
-        AllowOverride All
-    </Directory>
-    php_admin_value open_basedir none
-    SSLEngine on
-    SSLVerifyClient none
-    SSLCertificateFile %ssl_crt%
-    SSLCertificateKeyFile %ssl_key%
-    %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
-
-    Include %home%/%user%/conf/web/shttpd.%domain%.conf*
-
-</VirtualHost>
-
+<VirtualHost %ip%:%web_ssl_port%>
+
+    ServerName %domain_idn%
+    %alias_string%
+    ServerAdmin %email%
+    DocumentRoot %sdocroot%
+    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
+    Alias /vstats/ %home%/%user%/web/%domain%/stats/
+    Alias /error/ %home%/%user%/web/%domain%/document_errors/
+    SuexecUserGroup %user% %group%
+    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
+    CustomLog /var/log/httpd/domains/%domain%.log combined
+    %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
+    <Directory %sdocroot%>
+        SSLRequireSSL
+        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>
+        AllowOverride All
+    </Directory>
+    php_admin_value open_basedir none
+    SSLEngine on
+    SSLVerifyClient none
+    SSLCertificateFile %ssl_crt%
+    SSLCertificateKeyFile %ssl_key%
+    %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+    Include %home%/%user%/conf/web/shttpd.%domain%.conf*
+
+</VirtualHost>
+

+ 28 - 27
install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl

@@ -1,27 +1,28 @@
-<VirtualHost %ip%:%web_port%>
-
-    ServerName %domain_idn%
-    %alias_string%
-    ServerAdmin %email%
-    DocumentRoot %docroot%
-    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
-    Alias /vstats/ %home%/%user%/web/%domain%/stats/
-    Alias /error/ %home%/%user%/web/%domain%/document_errors/
-    SuexecUserGroup %user% %group%
-    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
-    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
-        FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
-    </Directory>
-    <Directory %home%/%user%/web/%domain%/stats>
-        AllowOverride All
-    </Directory>
-    Include %home%/%user%/conf/web/httpd.%domain%.conf*
-
-</VirtualHost>
-
+<VirtualHost %ip%:%web_port%>
+
+    ServerName %domain_idn%
+    %alias_string%
+    ServerAdmin %email%
+    DocumentRoot %docroot%
+    %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
+    Alias /vstats/ %home%/%user%/web/%domain%/stats/
+    Alias /error/ %home%/%user%/web/%domain%/document_errors/
+    SuexecUserGroup %user% %group%
+    CustomLog /var/log/httpd/domains/%domain%.bytes bytes
+    CustomLog /var/log/httpd/domains/%domain%.log combined
+    %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
+    <Directory %docroot%>
+        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>
+        AllowOverride All
+    </Directory>
+    Include %home%/%user%/conf/web/httpd.%domain%.conf*
+
+</VirtualHost>
+

+ 19 - 657
install/vst-install.sh

@@ -1,4 +1,3 @@
-<<<<<<< HEAD
 #!/bin/bash
 # Vesta installer
 
@@ -11,9 +10,9 @@ 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"
+tools="screen mc libpng libjpeg curl libmcrypt mhash zip unzip freetype ntp
+    openssl flex libxml2 ImageMagick sqlite pcre sudo bc jwhois mailx lsof
+    tar 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
@@ -41,6 +40,7 @@ release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
 
 help() {
     echo "usage: $0 [OPTIONS]
+   -d, --disable-remi         Disable remi
    -e, --email                Define email address
    -h, --help                 Print this help and exit
    -f, --force                Force installation"
@@ -52,6 +52,7 @@ for arg; do
     delim=""
     case "$arg" in
         --help)         args="${args}-h " ;;
+        --disable-remi) args="${args}-d " ;;
         --force)        args="${args}-f " ;;
         --email)        args="${args}-e " ;;
         *)              [[ "${arg:0:1}" == "-" ]] || delim="\""
@@ -61,8 +62,9 @@ done
 eval set -- "$args"
 
 # Getopt
-while getopts "hfe:" Option; do
+while getopts "dhfe:" Option; do
     case $Option in
+        d) disable_remi='yes' ;;          # Disable remi repo
         h) help ;;                        # Help
         e) email=$OPTARG ;;               # Contact email
         f) force=yes ;;                   # Force install
@@ -250,8 +252,12 @@ if [ -e '/root/.my.cnf' ]; then
     mv -f /root/.my.cnf
 fi
 
-# Vesta packages
-yum -y --enablerepo=remi install $rpms
+# Install Vesta packages
+if [ -z "$disable_remi" ]; then 
+    yum -y --enablerepo=remi install $rpms
+else
+    yum -y install $rpms
+fi
 if [ $? -ne 0 ]; then
     echo 'Error: yum install failed'
     exit 1
@@ -406,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/
@@ -502,6 +511,8 @@ sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php
 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
+wget $CHOST/$VERSION/roundcube-driver.php -O /usr/share/roundcubemail/plugins/password/vesta.php
+wget $CHOST/$VERSION/roundcube-pw.conf -O /usr/share/roundcubemail/plugins/password/config.inc.php
 
 r="$(gen_pass)"
 mysql -e "CREATE DATABASE roundcube"
@@ -537,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"
 
@@ -637,652 +648,3 @@ cd
 bash
 
 # EOF
-=======
-#!/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 libmcrypt mhash zip unzip freetype ntp
-    openssl flex libxml2 ImageMagick sqlite pcre sudo bc jwhois mailx lsof
-    tar 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]
-   -d, --disable-remi         Disable remi
-   -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 " ;;
-        --disable-remi) args="${args}-d " ;;
-        --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 "dhfe:" Option; do
-    case $Option in
-        d) disable_remi='yes' ;;          # Disable remi repo
-        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
-
-# Install Vesta packages
-if [ -z "$disable_remi" ]; then 
-    yum -y --enablerepo=remi install $rpms
-else
-    yum -y install $rpms
-fi
-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
-wget $CHOST/$VERSION/roundcube-driver.php -O /usr/share/roundcubemail/plugins/password/vesta.php
-wget $CHOST/$VERSION/roundcube-pw.conf -O /usr/share/roundcubemail/plugins/password/config.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
->>>>>>> 994c40901078e48fe939536f7b366e29c2e44a1d

+ 107 - 93
web/add/db/index.php

@@ -1,93 +1,107 @@
-<?php
-// Init
-error_reporting(NULL);
-ob_start();
-session_start();
-$TAB = 'DB';
-include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
-
-// Header
-include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
-
-// Panel
-top_panel($user,$TAB);
-
-// Are you admin?
-//if ($_SESSION['user'] == 'admin') {
-if (!empty($_POST['ok'])) {
-    // Check input
-    if (empty($_POST['v_database'])) $errors[] = _('database');
-    if (empty($_POST['v_dbuser'])) $errors[] = _('username');
-    if (empty($_POST['v_password'])) $errors[] = _('password');
-    if (empty($_POST['v_type'])) $errors[] = _('type');
-    if (empty($_POST['v_charset'])) $errors[] = _('charset');
-
-    // Protect input
-    $v_database = escapeshellarg($_POST['v_database']);
-    $v_dbuser = escapeshellarg($_POST['v_dbuser']);
-    $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
-    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);
-    } 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 {
-            if (empty($v_notify)) {
-                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
-                if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
-                if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
-
-                $to = $panel[$user]['CONTACT'];
-                $subject = _("Database Credentials");
-                $hostname = exec('hostname');
-                $from = _('MAIL_FROM',$hostname);
-                $mailtext = _('DATABASE_READY',$panel[$user]['FNAME'],$panel[$user]['LNAME'],$_POST['v_type'],$user,$_POST['v_database'],$user,$_POST['v_dbuser'],$_POST['v_password']);
-                $mailtext .= $db_admin_link."\n\n";
-
-                $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);
-            unset($v_dbuser);
-            unset($v_password);
-            unset($v_type);
-            unset($v_charset);
-            unset($output);
-        }
-    }
-}
-exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var);
-$db_types = json_decode(implode('', $output), true);
-unset($output);
-
-include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
-unset($_SESSION['error_msg']);
-unset($_SESSION['ok_msg']);
-//}
-
-// Footer
-include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+$TAB = 'DB';
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Header
+include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
+
+// Panel
+top_panel($user,$TAB);
+
+// Are you admin?
+//if ($_SESSION['user'] == 'admin') {
+if (!empty($_POST['ok'])) {
+    // Check input
+    if (empty($_POST['v_database'])) $errors[] = _('database');
+    if (empty($_POST['v_dbuser'])) $errors[] = _('username');
+    if (empty($_POST['v_password'])) $errors[] = _('password');
+    if (empty($_POST['v_type'])) $errors[] = _('type');
+    if (empty($_POST['v_charset'])) $errors[] = _('charset');
+
+        // Protect input
+        $v_database = escapeshellarg($_POST['v_database']);
+        $v_dbuser = escapeshellarg($_POST['v_dbuser']);
+        $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
+    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);
+    } 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']);
+            $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 {
+            if (empty($v_notify)) {
+                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
+                if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
+                if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
+
+                $to = $panel[$user]['CONTACT'];
+                $subject = _("Database Credentials");
+                $hostname = exec('hostname');
+                $from = _('MAIL_FROM',$hostname);
+                $mailtext = _('DATABASE_READY',$panel[$user]['FNAME'],$panel[$user]['LNAME'],$_POST['v_type'],$user,$_POST['v_database'],$user,$_POST['v_dbuser'],$_POST['v_password']);
+                $mailtext .= $db_admin_link."\n\n";
+
+                $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);
+            unset($v_dbuser);
+            unset($v_password);
+            unset($v_type);
+            unset($v_charset);
+            unset($output);
+        }
+    }
+}
+exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var);
+$db_types = json_decode(implode('', $output), true);
+unset($output);
+
+include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html');
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);
+//}
+
+// Footer
+include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
+?>

+ 28 - 0
web/bulk/service/index.php

@@ -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/");

+ 545 - 545
web/css/jquery-custom-dialogs.css

@@ -1,546 +1,546 @@
-/*!
- * jQuery UI CSS Framework 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
-.ui-helper-clearfix:after { clear: both; }
-.ui-helper-clearfix { zoom: 1; }
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #e6e6e6;}
-
-
-/*!
- * jQuery UI CSS Framework 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial, Helvetica, sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; }
-.ui-widget .ui-widget { font-size: 10pt; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
-.ui-widget-content { border: 1px solid #aaaaaa; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #d6d4c9; background: #ebe9dc; color: #777777; font-size: 10pt; font-weight: bold;}
-.ui-widget-header a { color: #222222; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
-
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { opacity: .30;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
- * jQuery UI Resizable 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizable#theming
- */
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
- * jQuery UI Selectable 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectable#theming
- */
-.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
-/*!
- * jQuery UI Accordion 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion#theming
- */
-/* IE/Win - Fix animation bug - #4615 */
-.ui-accordion { width: 100%; }
-.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
-.ui-accordion .ui-accordion-li-fix { display: inline; }
-.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
-.ui-accordion .ui-accordion-header a { display: block; font-size: 10pt; padding: .5em .5em .5em .7em; }
-.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
-.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 10pt 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
-.ui-accordion .ui-accordion-content-active { display: block; }
-/*!
- * jQuery UI Autocomplete 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete#theming
- */
-.ui-autocomplete { position: absolute; cursor: default; }	
-
-/* workarounds */
-* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
-
-/*
- * jQuery UI Menu 1.8.20
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu#theming
- */
-.ui-menu {
-	list-style:none;
-	padding: 2px;
-	margin: 0;
-	display:block;
-	float: left;
-}
-.ui-menu .ui-menu {
-	margin-top: -3px;
-}
-.ui-menu .ui-menu-item {
-	margin:0;
-	padding: 0;
-	zoom: 1;
-	float: left;
-	clear: left;
-	width: 100%;
-}
-.ui-menu .ui-menu-item a {
-	text-decoration:none;
-	display:block;
-	padding:.2em .4em;
-	line-height:1.5;
-	zoom:1;
-}
-.ui-menu .ui-menu-item a.ui-state-hover,
-.ui-menu .ui-menu-item a.ui-state-active {
-	font-weight: normal;
-	margin: -1px;
-}
-/*!
- * jQuery UI Button 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button#theming
- */
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .10pt; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
-.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
-button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
-.ui-button-icons-only { width: 3.4em; } 
-button.ui-button-icons-only { width: 3.7em; } 
-
-/*button text element */
-.ui-button .ui-button-text { display: block; line-height: 1.4;  }
-.ui-button-text-only .ui-button-text { padding: .4em 10pt; }
-.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
-.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 10pt .4em 2.10pt; }
-.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.10pt .4em 10pt; }
-.ui-button-text-icons .ui-button-text { padding-left: 2.10pt; padding-right: 2.10pt; }
-/* no icon support for input elements, provide padding by default */
-input.ui-button { padding: .4em 10pt; }
-
-/*button icon element(s) */
-.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
-.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
-.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
-.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-
-/*button sets*/
-.ui-buttonset { margin-right: 7px; }
-.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
-
-/* workarounds */
-button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
-/*!
- * jQuery UI Dialog 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.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-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; }
-.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 10pt; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 0 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 10pt .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { margin: 0 0 0 70px; }
-.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/*!
- * jQuery UI Slider 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider#theming
- */
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
- * jQuery UI Tabs 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs#theming
- */
-.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
-.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 10pt; text-decoration: none; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 10pt 1.4em; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
-/*!
- * jQuery UI Datepicker 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker#theming
- */
-.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:10pt; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month, 
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
-    display: none; /*sorry for IE5*/
-    display/**/: block; /*sorry for IE5*/
-    position: absolute; /*must have*/
-    z-index: -1; /*must have*/
-    filter: mask(); /*must have*/
-    top: -4px; /*must have*/
-    left: -4px; /*must have*/
-    width: 200px; /*must have*/
-    height: 200px; /*must have*/
-}/*!
- * jQuery UI Progressbar 1.8.20
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar#theming
- */
-.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
+/*!
+ * jQuery UI CSS Framework 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
+.ui-helper-clearfix:after { clear: both; }
+.ui-helper-clearfix { zoom: 1; }
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #e6e6e6;}
+
+
+/*!
+ * jQuery UI CSS Framework 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial, Helvetica, sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; }
+.ui-widget .ui-widget { font-size: 10pt; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
+.ui-widget-content { border: 1px solid #aaaaaa; color: #222222; }
+.ui-widget-content a { color: #222222; }
+.ui-widget-header { border: 1px solid #d6d4c9; background: #ebe9dc; color: #777777; font-size: 10pt; font-weight: bold;}
+.ui-widget-header a { color: #222222; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
+
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { opacity: .30;filter:Alpha(Opacity=30); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
+ * jQuery UI Resizable 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
+ * jQuery UI Selectable 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*!
+ * jQuery UI Accordion 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 10pt; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 10pt 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*!
+ * jQuery UI Autocomplete 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }	
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.20
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+	list-style:none;
+	padding: 2px;
+	margin: 0;
+	display:block;
+	float: left;
+}
+.ui-menu .ui-menu {
+	margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+	margin:0;
+	padding: 0;
+	zoom: 1;
+	float: left;
+	clear: left;
+	width: 100%;
+}
+.ui-menu .ui-menu-item a {
+	text-decoration:none;
+	display:block;
+	padding:.2em .4em;
+	line-height:1.5;
+	zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+	font-weight: normal;
+	margin: -1px;
+}
+/*!
+ * jQuery UI Button 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .10pt; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; } 
+button.ui-button-icons-only { width: 3.7em; } 
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4;  }
+.ui-button-text-only .ui-button-text { padding: .4em 10pt; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 10pt .4em 2.10pt; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.10pt .4em 10pt; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.10pt; padding-right: 2.10pt; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 10pt; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*!
+ * jQuery UI Dialog 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.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: #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; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 10pt; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 0 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 10pt .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { margin: 0 0 0 70px; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*!
+ * jQuery UI Slider 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
+ * jQuery UI Tabs 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 10pt; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 10pt 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/*!
+ * jQuery UI Datepicker 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:10pt; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month, 
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+    display: none; /*sorry for IE5*/
+    display/**/: block; /*sorry for IE5*/
+    position: absolute; /*must have*/
+    z-index: -1; /*must have*/
+    filter: mask(); /*must have*/
+    top: -4px; /*must have*/
+    left: -4px; /*must have*/
+    width: 200px; /*must have*/
+    height: 200px; /*must have*/
+}/*!
+ * jQuery UI Progressbar 1.8.20
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
 .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }

+ 616 - 587
web/edit/web/index.php

@@ -1,587 +1,616 @@
-<?php
-// Init
-error_reporting(NULL);
-ob_start();
-session_start();
-unset($_SESSION['error_msg']);
-
-$TAB = 'WEB';
-include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
-
-// Header
-include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
-
-// Panel
-top_panel($user,$TAB);
-
-
-// Check user argument?
-if (empty($_GET['domain'])) {
-    header("Location: /list/web/");
-    exit;
-}
-
-// Edit as someone else?
-if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
-    $user=escapeshellarg($_GET['user']);
-}
-
-
-// Check domain
-$v_domain = escapeshellarg($_GET['domain']);
-exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $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;
-} else {
-    $data = json_decode(implode('', $output), true);
-    unset($output);
-    $v_username = $user;
-    $v_domain = $_GET['domain'];
-    $v_ip = $data[$v_domain]['IP'];
-    $v_template = $data[$v_domain]['TPL'];
-    $v_aliases = str_replace(',', "\n", $data[$v_domain]['ALIAS']);
-    $valiases = explode(",", $data[$v_domain]['ALIAS']);
-    $v_tpl = $data[$v_domain]['IP'];
-    $v_cgi = $data[$v_domain]['CGI'];
-    $v_elog = $data[$v_domain]['ELOG'];
-    $v_ssl = $data[$v_domain]['SSL'];
-    if ( $v_ssl == 'yes' ) {
-        exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
-        $ssl_str = json_decode(implode('', $output), true);
-        unset($output);
-        $v_ssl_crt = $ssl_str[$v_domain]['CRT'];
-        $v_ssl_key = $ssl_str[$v_domain]['KEY'];
-        $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_stats = $data[$v_domain]['STATS'];
-    $v_stats_user = $data[$v_domain]['STATS_USER'];
-    if (!empty($v_stats_user)) $v_stats_password = "••••••••";
-    $v_ftp_user = $data[$v_domain]['FTP_USER'];
-    if (!empty($v_ftp_user)) $v_ftp_password = "••••••••";
-    $v_suspended = $data[$v_domain]['SUSPENDED'];
-    if ( $v_suspended == 'yes' ) {
-        $v_status =  'suspended';
-    } else {
-        $v_status =  'active';
-    }
-    $v_time = $data[$v_domain]['TIME'];
-    $v_date = $data[$v_domain]['DATE'];
-
-    exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var);
-    $ips = 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-web-stats json", $output, $return_var);
-    $stats = json_decode(implode('', $output), true);
-    unset($output);
-}
-
-// Action
-if (!empty($_POST['save'])) {
-    $v_domain = escapeshellarg($_POST['v_domain']);
-
-    // IP
-    if (($v_ip != $_POST['v_ip']) && (empty($_SESSION['error_msg']))) {
-        $v_ip = escapeshellarg($_POST['v_ip']);
-        exec (VESTA_CMD."v-change-web-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $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;
-        }
-        $restart_web = 'yes';
-        unset($output);
-        exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var);
-        if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
-            exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $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;
-            }
-            $restart_dns = 'yes';
-        }
-        unset($output);
-        foreach($valiases as $v_alias ){
-            exec (VESTA_CMD."v-list-dns-domain ".$v_username." '".$v_alias."' json", $output, $return_var);
-            if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
-                exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." '".$v_alias."' ".$v_ip, $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;
-                }
-                $restart_dns = 'yes';
-            }
-            unset($output);
-        }
-    }
-
-    // Template
-    if (( $_SESSION['user'] == 'admin') && ($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) {
-        $v_template = escapeshellarg($_POST['v_template']);
-        exec (VESTA_CMD."v-change-web-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $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);
-        $restart_web = 'yes';
-    }
-
-    // Aliases
-    if (empty($_SESSION['error_msg'])) {
-        $waliases = preg_replace("/\n/", " ", $_POST['v_aliases']);
-        $waliases = preg_replace("/,/", " ", $waliases);
-        $waliases = preg_replace('/\s+/', ' ',$waliases);
-        $waliases = trim($waliases);
-        $aliases = explode(" ", $waliases);
-        $v_aliases = str_replace(' ', "\n", $waliases);
-        $result = array_diff($valiases, $aliases);
-        foreach ($result as $alias) {
-            if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
-                $restart_web = 'yes';
-                $v_template = escapeshellarg($_POST['v_template']);
-                exec (VESTA_CMD."v-delete-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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);
-
-                if (empty($_SESSION['error_msg'])) {
-                    exec (VESTA_CMD."v-delete-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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;
-                    }
-                    $restart_dns = 'yes';
-                }
-                unset($output);
-            }
-        }
-
-        $result = array_diff($aliases, $valiases);
-        foreach ($result as $alias) {
-            if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
-                $restart_web = 'yes';
-                $v_template = escapeshellarg($_POST['v_template']);
-                exec (VESTA_CMD."v-add-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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);
-                if (empty($_SESSION['error_msg'])) {
-                    exec (VESTA_CMD."v-add-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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;
-                    }
-                    $restart_dns = 'yes';
-                }
-                unset($output);
-            }
-        }
-    }
-
-    // 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);
-        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);
-        unset($v_nginx);
-        $restart_web = 'yes';
-    }
-    if ((!empty($v_nginx)) && (!empty($_POST['v_nginx'])) && (empty($_SESSION['error_msg']))) {
-        $ext = preg_replace("/\n/", " ", $_POST['v_nginx_ext']);
-        $ext = preg_replace("/,/", " ", $ext);
-        $ext = preg_replace('/\s+/', ' ',$ext);
-        $ext = trim($ext);
-        $ext = str_replace(' ', ", ", $ext);
-        if ( $v_nginx_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);
-            if ($return_var != 0) {
-                $error = implode('<br>', $output);
-                if (empty($error)) $error = _('Error: vesta did not return any output.');
-                $_SESSION['error_msg'] = $error;
-            }
-            $v_nginx_ext = str_replace(',', ', ', $ext);
-            unset($output);
-            $restart_web = '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']);
-            $ext = preg_replace("/,/", " ", $ext);
-            $ext = preg_replace('/\s+/', ' ',$ext);
-            $ext = trim($ext);
-            $ext = str_replace(' ', ",", $ext);
-            $v_nginx_ext = str_replace(',', ', ', $ext);
-        }
-        exec (VESTA_CMD."v-add-web-domain-nginx ".$v_username." ".$v_domain." 'default' ".escapeshellarg($ext)." 'no'", $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_nginx = 'default';
-        $restart_web = 'yes';
-    }
-
-    // SSL
-    if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $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_ssl = 'no';
-        $restart_web = 'yes';
-    }
-    if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
-        if (( $v_ssl_crt != str_replace("\r\n", "\n",  $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n",  $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n",  $_POST['v_ssl_ca']))) {
-            exec ('mktemp -d', $mktemp_output, $return_var);
-            $tmpdir = $mktemp_output[0];
-
-            // Certificate
-            if (!empty($_POST['v_ssl_crt'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
-                fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_ssl_crt']));
-                fwrite($fp, "\n");
-                fclose($fp);
-            }
-
-            // Key
-            if (!empty($_POST['v_ssl_key'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
-                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
-                fwrite($fp, "\n");
-                fclose($fp);
-            }
-
-            // CA
-            if (!empty($_POST['v_ssl_ca'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
-                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
-                fwrite($fp, "\n");
-                fclose($fp);
-            }
-
-            exec (VESTA_CMD."v-change-web-domain-sslcert ".$user." ".$v_domain." ".$tmpdir." 'no'", $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);
-            $restart_web = 'yes';
-            $v_ssl_crt = $_POST['v_ssl_crt'];
-            $v_ssl_key = $_POST['v_ssl_key'];
-            $v_ssl_ca = $_POST['v_ssl_ca'];
-        }
-    }
-    if (( $v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
-        if ( $v_ssl_home != $_POST['v_ssl_home'] ) {
-            $v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
-            exec (VESTA_CMD."v-change-web-domain-sslhome ".$user." ".$v_domain." ".$v_ssl_home." 'no'", $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;
-            }
-            $v_ssl_home = $_POST['v_ssl_home'];
-            unset($output);
-        }
-    }
-    if (( $v_ssl == 'no') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
-        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = 'ssl certificate';
-        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = 'ssl key';
-        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_home']))) $errors[] = 'ssl home';
-        $v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
-        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);
-        } else {
-            exec ('mktemp -d', $mktemp_output, $return_var);
-            $tmpdir = $mktemp_output[0];
-
-            // Certificate
-            if (!empty($_POST['v_ssl_crt'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
-                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
-                fclose($fp);
-            }
-
-            // Key
-            if (!empty($_POST['v_ssl_key'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
-                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
-                fclose($fp);
-            }
-
-            // CA
-            if (!empty($_POST['v_ssl_ca'])) {
-                $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
-                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
-                fclose($fp);
-            }
-            exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $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_ssl = 'yes';
-            $restart_web = 'yes';
-            $v_ssl_crt = $_POST['v_ssl_crt'];
-            $v_ssl_key = $_POST['v_ssl_key'];
-            $v_ssl_ca = $_POST['v_ssl_ca'];
-            $v_ssl_home = $_POST['v_ssl_home'];
-        }
-    }
-
-    // Web Stats
-    if ((!empty($v_stats)) && ($_POST['v_stats'] == 'none') && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-delete-web-domain-stats ".$v_username." ".$v_domain, $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_stats = '';
-    }
-    if ((!empty($v_stats)) && ($_POST['v_stats'] != $v_stats) && (empty($_SESSION['error_msg']))) {
-        $v_stats = escapeshellarg($_POST['v_stats']);
-        exec (VESTA_CMD."v-change-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $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);
-    }
-    if ((empty($v_stats)) && ($_POST['v_stats'] != 'none') && (empty($_SESSION['error_msg']))) {
-        $v_stats = escapeshellarg($_POST['v_stats']);
-        exec (VESTA_CMD."v-add-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $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);
-    }
-
-    // Web Stats Auth
-    if ((!empty($v_stats_user)) && (empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-delete-web-domain-stats-user ".$v_username." ".$v_domain, $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_stats_user = '';
-        $v_stats_password = '';
-    }
-    if ((empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
-        if (empty($_POST['v_stats_user'])) $errors[] = _('stats username');
-        if (empty($_POST['v_stats_password'])) $errors[] = _('stats 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);
-        } else {
-            $v_stats_user = escapeshellarg($_POST['v_stats_user']);
-            $v_stats_password = escapeshellarg($_POST['v_stats_password']);
-            exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_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_stats_password = "••••••••";
-        }
-    }
-    if ((!empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
-        if (empty($_POST['v_stats_user'])) $errors[] = _('stats user');
-        if (empty($_POST['v_stats_password'])) $errors[] = _('stats 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_stats_user != $_POST['v_stats_user']) || ($_POST['v_stats_password'] != "••••••••" ) && (empty($_SESSION['error_msg']))) {
-            $v_stats_user = escapeshellarg($_POST['v_stats_user']);
-            $v_stats_password = escapeshellarg($_POST['v_stats_password']);
-            exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_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_stats_password = "••••••••";
-        }
-    }
-
-    // FTP Account
-    if ((!empty($v_ftp_user)) && (empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-delete-web-domain-ftp ".$v_username." ".$v_domain, $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');
-        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_user =  $_POST['v_ftp_user'];
-            $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.');
-        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 (empty($_SESSION['error_msg'])) {
-            $v_ftp_user = escapeshellarg($_POST['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;
-            } else {
-                if (!empty($_POST['v_ftp_email'])) {
-                    $to = $_POST['v_ftp_email'];
-                    $subject = _("FTP login credentials");
-                    $hostname = exec('hostname');
-                    $from = _('MAIL_FROM',$hostname);
-                    $mailtext .= _('FTP_ACCOUNT_READY',$_GET['domain'],$user."_".$_POST['v_ftp_user'],$_POST['v_ftp_password']);
-                    send_email($to, $subject, $mailtext, $from);
-                    unset($v_ftp_email);
-                }
-            }
-            unset($output);
-            $v_ftp_user =  $user."_".$_POST['v_ftp_user'];
-            $v_ftp_password = "••••••••";
-        }
-    }
-
-    // Restart web
-    if (!empty($restart_web) && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-restart-web", $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;
-        }
-    }
-
-    // Restart dns
-    if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) {
-        exec (VESTA_CMD."v-restart-dns", $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;
-        }
-    }
-
-    if (empty($_SESSION['error_msg'])) {
-        $_SESSION['ok_msg'] = _('OK: changes has been saved.');
-    }
-
-}
-if ($_SESSION['user'] == 'admin') {
-    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html');
-} else {
-    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_web.html');
-}
-unset($_SESSION['error_msg']);
-unset($_SESSION['ok_msg']);
-//}
-
-// Footer
-include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
+<?php
+// Init
+error_reporting(NULL);
+ob_start();
+session_start();
+unset($_SESSION['error_msg']);
+
+$TAB = 'WEB';
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Header
+include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
+
+// Panel
+top_panel($user,$TAB);
+
+
+// Check user argument?
+if (empty($_GET['domain'])) {
+    header("Location: /list/web/");
+    exit;
+}
+
+// Edit as someone else?
+if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
+    $user=escapeshellarg($_GET['user']);
+}
+
+
+// Check domain
+$v_domain = escapeshellarg($_GET['domain']);
+exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $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;
+} else {
+    $data = json_decode(implode('', $output), true);
+    unset($output);
+    $v_username = $user;
+    $v_domain = $_GET['domain'];
+    $v_ip = $data[$v_domain]['IP'];
+    $v_template = $data[$v_domain]['TPL'];
+    $v_aliases = str_replace(',', "\n", $data[$v_domain]['ALIAS']);
+    $valiases = explode(",", $data[$v_domain]['ALIAS']);
+    $v_tpl = $data[$v_domain]['IP'];
+    $v_cgi = $data[$v_domain]['CGI'];
+    $v_elog = $data[$v_domain]['ELOG'];
+    $v_ssl = $data[$v_domain]['SSL'];
+    if ( $v_ssl == 'yes' ) {
+        exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
+        $ssl_str = json_decode(implode('', $output), true);
+        unset($output);
+        $v_ssl_crt = $ssl_str[$v_domain]['CRT'];
+        $v_ssl_key = $ssl_str[$v_domain]['KEY'];
+        $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_stats = $data[$v_domain]['STATS'];
+    $v_stats_user = $data[$v_domain]['STATS_USER'];
+    if (!empty($v_stats_user)) $v_stats_password = "••••••••";
+    $v_ftp_user = $data[$v_domain]['FTP_USER'];
+    if (!empty($v_ftp_user)) $v_ftp_password = "••••••••";
+    $v_suspended = $data[$v_domain]['SUSPENDED'];
+    if ( $v_suspended == 'yes' ) {
+        $v_status =  'suspended';
+    } else {
+        $v_status =  'active';
+    }
+    $v_time = $data[$v_domain]['TIME'];
+    $v_date = $data[$v_domain]['DATE'];
+
+    exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var);
+    $ips = 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-web-stats json", $output, $return_var);
+    $stats = json_decode(implode('', $output), true);
+    unset($output);
+}
+
+// Action
+if (!empty($_POST['save'])) {
+    $v_domain = escapeshellarg($_POST['v_domain']);
+
+    // IP
+    if (($v_ip != $_POST['v_ip']) && (empty($_SESSION['error_msg']))) {
+        $v_ip = escapeshellarg($_POST['v_ip']);
+        exec (VESTA_CMD."v-change-web-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $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;
+        }
+        $restart_web = 'yes';
+        unset($output);
+        exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var);
+        if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
+            exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $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;
+            }
+            $restart_dns = 'yes';
+        }
+        unset($output);
+        foreach($valiases as $v_alias ){
+            exec (VESTA_CMD."v-list-dns-domain ".$v_username." '".$v_alias."' json", $output, $return_var);
+            if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
+                exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." '".$v_alias."' ".$v_ip, $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;
+                }
+                $restart_dns = 'yes';
+            }
+            unset($output);
+        }
+    }
+
+    // Template
+    if (( $_SESSION['user'] == 'admin') && ($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) {
+        $v_template = escapeshellarg($_POST['v_template']);
+        exec (VESTA_CMD."v-change-web-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $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);
+        $restart_web = 'yes';
+    }
+
+    // Aliases
+    if (empty($_SESSION['error_msg'])) {
+        $waliases = preg_replace("/\n/", " ", $_POST['v_aliases']);
+        $waliases = preg_replace("/,/", " ", $waliases);
+        $waliases = preg_replace('/\s+/', ' ',$waliases);
+        $waliases = trim($waliases);
+        $aliases = explode(" ", $waliases);
+        $v_aliases = str_replace(' ', "\n", $waliases);
+        $result = array_diff($valiases, $aliases);
+        foreach ($result as $alias) {
+            if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
+                $restart_web = 'yes';
+                $v_template = escapeshellarg($_POST['v_template']);
+                exec (VESTA_CMD."v-delete-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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);
+
+                if (empty($_SESSION['error_msg'])) {
+                    exec (VESTA_CMD."v-delete-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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;
+                    }
+                    $restart_dns = 'yes';
+                }
+                unset($output);
+            }
+        }
+
+        $result = array_diff($aliases, $valiases);
+        foreach ($result as $alias) {
+            if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
+                $restart_web = 'yes';
+                $v_template = escapeshellarg($_POST['v_template']);
+                exec (VESTA_CMD."v-add-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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);
+                if (empty($_SESSION['error_msg'])) {
+                    exec (VESTA_CMD."v-add-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $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;
+                    }
+                    $restart_dns = 'yes';
+                }
+                unset($output);
+            }
+        }
+    }
+
+    // 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);
+        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);
+        unset($v_nginx);
+        $restart_web = 'yes';
+    }
+    if ((!empty($v_nginx)) && (!empty($_POST['v_nginx'])) && (empty($_SESSION['error_msg']))) {
+        $ext = preg_replace("/\n/", " ", $_POST['v_nginx_ext']);
+        $ext = preg_replace("/,/", " ", $ext);
+        $ext = preg_replace('/\s+/', ' ',$ext);
+        $ext = trim($ext);
+        $ext = str_replace(' ', ", ", $ext);
+        if ( $v_nginx_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);
+            if ($return_var != 0) {
+                $error = implode('<br>', $output);
+                if (empty($error)) $error = _('Error: vesta did not return any output.');
+                $_SESSION['error_msg'] = $error;
+            }
+            $v_nginx_ext = str_replace(',', ', ', $ext);
+            unset($output);
+            $restart_web = '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']);
+            $ext = preg_replace("/,/", " ", $ext);
+            $ext = preg_replace('/\s+/', ' ',$ext);
+            $ext = trim($ext);
+            $ext = str_replace(' ', ",", $ext);
+            $v_nginx_ext = str_replace(',', ', ', $ext);
+        }
+        exec (VESTA_CMD."v-add-web-domain-nginx ".$v_username." ".$v_domain." 'default' ".escapeshellarg($ext)." 'no'", $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_nginx = 'default';
+        $restart_web = 'yes';
+    }
+
+    // SSL
+    if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $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_ssl = 'no';
+        $restart_web = 'yes';
+    }
+    if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
+        if (( $v_ssl_crt != str_replace("\r\n", "\n",  $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n",  $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n",  $_POST['v_ssl_ca']))) {
+            exec ('mktemp -d', $mktemp_output, $return_var);
+            $tmpdir = $mktemp_output[0];
+
+            // Certificate
+            if (!empty($_POST['v_ssl_crt'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
+                fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_ssl_crt']));
+                fwrite($fp, "\n");
+                fclose($fp);
+            }
+
+            // Key
+            if (!empty($_POST['v_ssl_key'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
+                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
+                fwrite($fp, "\n");
+                fclose($fp);
+            }
+
+            // CA
+            if (!empty($_POST['v_ssl_ca'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
+                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
+                fwrite($fp, "\n");
+                fclose($fp);
+            }
+
+            exec (VESTA_CMD."v-change-web-domain-sslcert ".$user." ".$v_domain." ".$tmpdir." 'no'", $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);
+            $restart_web = 'yes';
+            $v_ssl_crt = $_POST['v_ssl_crt'];
+            $v_ssl_key = $_POST['v_ssl_key'];
+            $v_ssl_ca = $_POST['v_ssl_ca'];
+        }
+    }
+    if (( $v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
+        if ( $v_ssl_home != $_POST['v_ssl_home'] ) {
+            $v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
+            exec (VESTA_CMD."v-change-web-domain-sslhome ".$user." ".$v_domain." ".$v_ssl_home." 'no'", $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;
+            }
+            $v_ssl_home = $_POST['v_ssl_home'];
+            unset($output);
+        }
+    }
+    if (( $v_ssl == 'no') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
+        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = 'ssl certificate';
+        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = 'ssl key';
+        if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_home']))) $errors[] = 'ssl home';
+        $v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
+        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);
+        } else {
+            exec ('mktemp -d', $mktemp_output, $return_var);
+            $tmpdir = $mktemp_output[0];
+
+            // Certificate
+            if (!empty($_POST['v_ssl_crt'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
+                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
+                fclose($fp);
+            }
+
+            // Key
+            if (!empty($_POST['v_ssl_key'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
+                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
+                fclose($fp);
+            }
+
+            // CA
+            if (!empty($_POST['v_ssl_ca'])) {
+                $fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
+                fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
+                fclose($fp);
+            }
+            exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $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_ssl = 'yes';
+            $restart_web = 'yes';
+            $v_ssl_crt = $_POST['v_ssl_crt'];
+            $v_ssl_key = $_POST['v_ssl_key'];
+            $v_ssl_ca = $_POST['v_ssl_ca'];
+            $v_ssl_home = $_POST['v_ssl_home'];
+        }
+    }
+
+    // Web Stats
+    if ((!empty($v_stats)) && ($_POST['v_stats'] == 'none') && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-delete-web-domain-stats ".$v_username." ".$v_domain, $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_stats = '';
+    }
+    if ((!empty($v_stats)) && ($_POST['v_stats'] != $v_stats) && (empty($_SESSION['error_msg']))) {
+        $v_stats = escapeshellarg($_POST['v_stats']);
+        exec (VESTA_CMD."v-change-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $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);
+    }
+    if ((empty($v_stats)) && ($_POST['v_stats'] != 'none') && (empty($_SESSION['error_msg']))) {
+        $v_stats = escapeshellarg($_POST['v_stats']);
+        exec (VESTA_CMD."v-add-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $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);
+    }
+
+    // Web Stats Auth
+    if ((!empty($v_stats_user)) && (empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-delete-web-domain-stats-user ".$v_username." ".$v_domain, $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_stats_user = '';
+        $v_stats_password = '';
+    }
+    if ((empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
+        if (empty($_POST['v_stats_user'])) $errors[] = _('stats username');
+        if (empty($_POST['v_stats_password'])) $errors[] = _('stats 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);
+        } else {
+            $v_stats_user = escapeshellarg($_POST['v_stats_user']);
+            $v_stats_password = escapeshellarg($_POST['v_stats_password']);
+            exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_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_stats_password = "••••••••";
+        }
+    }
+    if ((!empty($v_stats_user)) && (!empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
+        if (empty($_POST['v_stats_user'])) $errors[] = _('stats user');
+        if (empty($_POST['v_stats_password'])) $errors[] = _('stats 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_stats_user != $_POST['v_stats_user']) || ($_POST['v_stats_password'] != "••••••••" ) && (empty($_SESSION['error_msg']))) {
+            $v_stats_user = escapeshellarg($_POST['v_stats_user']);
+            $v_stats_password = escapeshellarg($_POST['v_stats_password']);
+            exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_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_stats_password = "••••••••";
+        }
+    }
+
+    // FTP Account
+    if ((!empty($v_ftp_user)) && (empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-delete-web-domain-ftp ".$v_username." ".$v_domain, $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');
+        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');
+            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_user =  $_POST['v_ftp_user'];
+                $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.');
+        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 (empty($_SESSION['error_msg'])) {
+            $v_ftp_user = escapeshellarg($_POST['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;
+            } else {
+                if (!empty($_POST['v_ftp_email'])) {
+                    $to = $_POST['v_ftp_email'];
+                    $subject = _("FTP login credentials");
+                    $hostname = exec('hostname');
+                    $from = _('MAIL_FROM',$hostname);
+                    $mailtext .= _('FTP_ACCOUNT_READY',$_GET['domain'],$user."_".$_POST['v_ftp_user'],$_POST['v_ftp_password']);
+                    send_email($to, $subject, $mailtext, $from);
+                    unset($v_ftp_email);
+                }
+            }
+            unset($output);
+            $v_ftp_user =  $user."_".$_POST['v_ftp_user'];
+            $v_ftp_password = "••••••••";
+        }
+    }
+
+    // Restart web
+    if (!empty($restart_web) && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-restart-web", $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;
+        }
+    }
+
+    // Restart dns
+    if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) {
+        exec (VESTA_CMD."v-restart-dns", $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;
+        }
+    }
+
+    if (empty($_SESSION['error_msg'])) {
+        $_SESSION['ok_msg'] = _('OK: changes has been saved.');
+    }
+
+}
+if ($_SESSION['user'] == 'admin') {
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html');
+} else {
+    include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_web.html');
+}
+unset($_SESSION['error_msg']);
+unset($_SESSION['ok_msg']);
+//}
+
+// Footer
+include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

BIN
web/images/logo.png


BIN
web/images/start.png


BIN
web/images/stop.png


+ 3 - 0
web/inc/i18n/ru.php

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

+ 176 - 158
web/inc/main.php

@@ -1,159 +1,177 @@
-<?php
-
-// need to be moved to user settings
-define('LANGUAGE','ru');
-
-require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.LANGUAGE.'.php');
-
-
-// works like sprintf if more than one arguments called
-function _() {
-    global $LANG;
-    $args = func_get_args();
-    $key = $args[0];
-    if (!isset($LANG[$key])) $text=$key; else
-        $text=$LANG[$key];
-
-    if (count($args)>1) { $args[0] = $text;
-        return call_user_func_array("sprintf",$args);
-    }
-    else return $text;
-}
-
-// Check user session
-if ((!isset($_SESSION['user'])) && (!isset($api_mode))&&!defined('NO_AUTH_REQUIRED')) {
-    $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
-    header("Location: /login/");
-    exit;
-}
-
-if (isset($_SESSION['look']) && ( $_SESSION['look'] != 'admin' )) {
-    $user = $_SESSION['look'];
-} else {
-    $user = $_SESSION['user'];
-}
-
-define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
-
-$i = 0;
-
-// Define functions
-function check_error($return_var){
-    if ( $return_var > 0 ) {
-        header("Location: /error/");
-        exit;
-    }
-}
-
-function top_panel($user, $TAB) {
-    global $panel;
-    $command = VESTA_CMD."v-list-user '".$user."' 'json'";
-    exec ($command, $output, $return_var);
-    if ( $return_var > 0 ) {
-        header("Location: /error/");
-        exit;
-    }
-    $panel = json_decode(implode('', $output), true);
-    unset($output);
-    if ( $user == 'admin' ) {
-        include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/panel.html');
-    } else {
-        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/panel.html');
-    }
-}
-
-function humanize_time($usage) {
-    if ( $usage > 60 ) {
-        $usage = $usage / 60;
-        $usage = number_format($usage, 2);
-        $usage = $usage." Hour.";
-    } else {
-        $usage = $usage." Min.";
-    }
-    return $usage;
-}
-
-function humanize_usage($usage) {
-    if ( $usage > 1000 ) {
-        $usage = $usage / 1000;
-        if ( $usage > 1000 ) {
-                $usage = $usage / 1000 ;
-                if ( $usage > 1000 ) {
-                    $usage = $usage / 1000 ;
-                    $usage = number_format($usage, 2);
-                    $usage = $usage." pb";
-                } else {
-                    $usage = number_format($usage, 2);
-                    $usage = $usage." tb";
-                }
-        } else {
-            $usage = number_format($usage, 2);
-            $usage = $usage." gb";
-        }
-    } else {
-        $usage = $usage." mb";
-    }
-    return $usage;
-}
-
-function get_percentage($used,$total) {
-    if (!isset($total)) $total =  0;
-    if (!isset($used)) $used =  0;
-    if ( $total == 0 ) {
-        $percent = 0;
-    } else {
-        $percent = $used / $total;
-        $percent = $percent * 100;
-        $percent = number_format($percent, 0, '', '');
-        if ( $percent > 100 ) {
-            $percent = 100;
-        }
-        if ( $percent < 0 ) {
-            $percent = 0;
-        }
-
-    }
-    return $percent;
-}
-
-function send_email($to,$subject,$mailtext,$from) {
-    $charset = "utf-8";
-    $to = '<'.$to.'>';
-    $boundary = '--' . md5( uniqid("myboundary") );
-    $priorities = array( '1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)' );
-    $priority = $priorities[2];
-    $ctencoding = "8bit";
-    $sep = chr(13) . chr(10);
-    $disposition = "inline";
-    $subject = "=?$charset?B?".base64_encode($subject)."?=";
-    $header = "From: $from \nX-Priority: $priority\nCC:\n";
-    $header .= "Mime-Version: 1.0\nContent-Type: text/plain; charset=$charset \n";
-    $header .= "Content-Transfer-Encoding: $ctencoding\nX-Mailer: Php/libMailv1.3\n";
-    $message = $mailtext;
-    mail($to, $subject, $message, $header);
-}
-
-function display_error_block() {
-    if (!empty($_SESSION['error_msg'])) {
-        echo '
-                        <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>';
-        echo $_SESSION['error_msg'];
-        echo "</p>\n                        </div>\n";
-        unset($_SESSION['error_msg']);
-    }
-}
+<?php
+
+// need to be moved to user settings
+define('LANGUAGE','ru');
+
+require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.LANGUAGE.'.php');
+
+
+// works like sprintf if more than one arguments called
+function _() {
+    global $LANG;
+    $args = func_get_args();
+    $key = $args[0];
+    if (!isset($LANG[$key])) $text=$key; else
+        $text=$LANG[$key];
+
+    if (count($args)>1) { $args[0] = $text;
+        return call_user_func_array("sprintf",$args);
+    }
+    else return $text;
+}
+
+// Check user session
+if ((!isset($_SESSION['user'])) && (!isset($api_mode))&&!defined('NO_AUTH_REQUIRED')) {
+    $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
+    header("Location: /login/");
+    exit;
+}
+
+if (isset($_SESSION['look']) && ( $_SESSION['look'] != 'admin' )) {
+    $user = $_SESSION['look'];
+} else {
+    $user = $_SESSION['user'];
+}
+
+define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
+
+$i = 0;
+
+// Define functions
+function check_error($return_var){
+    if ( $return_var > 0 ) {
+        header("Location: /error/");
+        exit;
+    }
+}
+
+function top_panel($user, $TAB) {
+    global $panel;
+    $command = VESTA_CMD."v-list-user '".$user."' 'json'";
+    exec ($command, $output, $return_var);
+    if ( $return_var > 0 ) {
+        header("Location: /error/");
+        exit;
+    }
+    $panel = json_decode(implode('', $output), true);
+    unset($output);
+    if ( $user == 'admin' ) {
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/panel.html');
+    } else {
+        include($_SERVER['DOCUMENT_ROOT'].'/templates/user/panel.html');
+    }
+}
+
+function humanize_time($usage) {
+    if ( $usage > 60 ) {
+        $usage = $usage / 60;
+        if ( $usage > 24 ) {
+             $usage = $usage / 24;
+            $usage = number_format($usage, 0);
+            if ( $usage == 1 ) {
+                $usage = $usage." "._('day');
+            } else {
+                $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;
+}
+
+function humanize_usage($usage) {
+    if ( $usage > 1000 ) {
+        $usage = $usage / 1000;
+        if ( $usage > 1000 ) {
+                $usage = $usage / 1000 ;
+                if ( $usage > 1000 ) {
+                    $usage = $usage / 1000 ;
+                    $usage = number_format($usage, 2);
+                    $usage = $usage." "._('pb');
+                } else {
+                    $usage = number_format($usage, 2);
+                    $usage = $usage." "._('tb');
+                }
+        } else {
+            $usage = number_format($usage, 2);
+            $usage = $usage." "._('gb');
+        }
+    } else {
+        $usage = $usage." "._('mb');
+    }
+    return $usage;
+}
+
+function get_percentage($used,$total) {
+    if (!isset($total)) $total =  0;
+    if (!isset($used)) $used =  0;
+    if ( $total == 0 ) {
+        $percent = 0;
+    } else {
+        $percent = $used / $total;
+        $percent = $percent * 100;
+        $percent = number_format($percent, 0, '', '');
+        if ( $percent > 100 ) {
+            $percent = 100;
+        }
+        if ( $percent < 0 ) {
+            $percent = 0;
+        }
+
+    }
+    return $percent;
+}
+
+function send_email($to,$subject,$mailtext,$from) {
+    $charset = "utf-8";
+    $to = '<'.$to.'>';
+    $boundary = '--' . md5( uniqid("myboundary") );
+    $priorities = array( '1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)' );
+    $priority = $priorities[2];
+    $ctencoding = "8bit";
+    $sep = chr(13) . chr(10);
+    $disposition = "inline";
+    $subject = "=?$charset?B?".base64_encode($subject)."?=";
+    $header = "From: $from \nX-Priority: $priority\nCC:\n";
+    $header .= "Mime-Version: 1.0\nContent-Type: text/plain; charset=$charset \n";
+    $header .= "Content-Transfer-Encoding: $ctencoding\nX-Mailer: Php/libMailv1.3\n";
+    $message = $mailtext;
+    mail($to, $subject, $message, $header);
+}
+
+function display_error_block() {
+    if (!empty($_SESSION['error_msg'])) {
+        echo '
+                        <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>';
+        echo $_SESSION['error_msg'];
+        echo "</p>\n                        </div>\n";
+        unset($_SESSION['error_msg']);
+    }
+}
 ?>

+ 124 - 124
web/js/events.js

@@ -1,124 +1,124 @@
-// Init kinda namespace object
-var VE = { // Vesta Events object
-    core: {}, // core functions
-    callbacks: { // events callback functions
-        click: {},
-        mouseover: {},
-        mouseout: {},
-        keypress: {}
-    },
-    helpers: {}, // simple handy methods
-    tmp: {}
-};
-
-/*
- * Main method that invokes further event processing
- * @param root is root HTML DOM element that. Pass HTML DOM Element or css selector
- * @param event_type (eg: click, mouseover etc..)
- */
-VE.core.register = function(root, event_type) {
-    var root = !root ? 'body' : root; // if elm is not passed just bind events to body DOM Element
-    var event_type = !event_type ? 'click' : event_type; // set event type to "click" by default
-    $(root).bind(event_type, function(evt) {
-        var elm = $(evt.target);
-        VE.core.dispatch(evt, elm, event_type); // dispatch captured event
-    });
-}
-
-/*
- * Dispatch event that was previously registered
- * @param evt related event object
- * @param elm that was catched
- * @param event_type (eg: click, mouseover etc..)
- */
-VE.core.dispatch = function(evt, elm, event_type) {
-    if ('undefined' == typeof VE.callbacks[event_type]) {
-        return VE.helpers.warn('There is no corresponding object that should contain event callbacks for "'+event_type+'" event type');
-    }
-    // get class of element
-    var classes = $(elm).attr('class');
-    // if no classes are attached, then just stop any further processings
-    if (!classes) {
-        return; // no classes assigned
-    }
-    // split the classes and check if it related to function
-    $(classes.split(/\s/)).each(function(i, key) {
-        VE.callbacks[event_type][key] && VE.callbacks[event_type][key](evt, elm);
-    });
-}
-
-//
-//  CALLBACKS
-//
-
-
-
-/*
- * Suspend action
- */
-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);
-}
-
-/*
- * Unsuspend action
- */
-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);
-}
-
-/*
- * Delete action
- */
-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);
-}
-
-
-/*
- * Create dialog box on the fly
- * @param elm Element which contains the dialog contents
- * @param dialog_title 
- * @param confirmed_location_url URL that will be redirected to if user hit "OK"
- * @param custom_config Custom configuration parameters passed to dialog initialization (optional)
- */
-VE.helpers.createConfirmationDialog = function(elm, dialog_title, confirmed_location_url, custom_config) {
-    var custom_config = !custom_config ? {} : custom_config;
-    var config = {
-        modal: true,
-        autoOpen: true,
-        width: 360,
-        title: dialog_title,
-        close: function() {
-            $(this).dialog("destroy");
-        },
-        buttons: {
-            "Ok": function(event, ui) {
-                 location.href = confirmed_location_url;
-            },
-            "Cancel": function() {
-                $(this).dialog("close");
-                $(this).dialog("destroy");
-            }
-        }
-    }
-    config = $.extend(config, custom_config);
-    var reference_copied = $(elm).clone();
-    $(reference_copied).dialog(config);
-}
-
-/*
- * Simple debug output
- */
-VE.helpers.warn = function(msg) {
-    alert('WARNING: ' + msg);
-}
+// Init kinda namespace object
+var VE = { // Vesta Events object
+    core: {}, // core functions
+    callbacks: { // events callback functions
+        click: {},
+        mouseover: {},
+        mouseout: {},
+        keypress: {}
+    },
+    helpers: {}, // simple handy methods
+    tmp: {}
+};
+
+/*
+ * Main method that invokes further event processing
+ * @param root is root HTML DOM element that. Pass HTML DOM Element or css selector
+ * @param event_type (eg: click, mouseover etc..)
+ */
+VE.core.register = function(root, event_type) {
+    var root = !root ? 'body' : root; // if elm is not passed just bind events to body DOM Element
+    var event_type = !event_type ? 'click' : event_type; // set event type to "click" by default
+    $(root).bind(event_type, function(evt) {
+        var elm = $(evt.target);
+        VE.core.dispatch(evt, elm, event_type); // dispatch captured event
+    });
+}
+
+/*
+ * Dispatch event that was previously registered
+ * @param evt related event object
+ * @param elm that was catched
+ * @param event_type (eg: click, mouseover etc..)
+ */
+VE.core.dispatch = function(evt, elm, event_type) {
+    if ('undefined' == typeof VE.callbacks[event_type]) {
+        return VE.helpers.warn('There is no corresponding object that should contain event callbacks for "'+event_type+'" event type');
+    }
+    // get class of element
+    var classes = $(elm).attr('class');
+    // if no classes are attached, then just stop any further processings
+    if (!classes) {
+        return; // no classes assigned
+    }
+    // split the classes and check if it related to function
+    $(classes.split(/\s/)).each(function(i, key) {
+        VE.callbacks[event_type][key] && VE.callbacks[event_type][key](evt, elm);
+    });
+}
+
+//
+//  CALLBACKS
+//
+
+
+
+/*
+ * Suspend action
+ */
+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 action', url);
+}
+
+/*
+ * Unsuspend action
+ */
+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 action', url);
+}
+
+/*
+ * Delete action
+ */
+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 action', url);
+}
+
+
+/*
+ * Create dialog box on the fly
+ * @param elm Element which contains the dialog contents
+ * @param dialog_title 
+ * @param confirmed_location_url URL that will be redirected to if user hit "OK"
+ * @param custom_config Custom configuration parameters passed to dialog initialization (optional)
+ */
+VE.helpers.createConfirmationDialog = function(elm, dialog_title, confirmed_location_url, custom_config) {
+    var custom_config = !custom_config ? {} : custom_config;
+    var config = {
+        modal: true,
+        autoOpen: true,
+        width: 360,
+        title: dialog_title,
+        close: function() {
+            $(this).dialog("destroy");
+        },
+        buttons: {
+            "Ok": function(event, ui) {
+                 location.href = confirmed_location_url;
+            },
+            "Cancel": function() {
+                $(this).dialog("close");
+                $(this).dialog("destroy");
+            }
+        }
+    }
+    config = $.extend(config, custom_config);
+    var reference_copied = $(elm).clone();
+    $(reference_copied).dialog(config);
+}
+
+/*
+ * Simple debug output
+ */
+VE.helpers.warn = function(msg) {
+    alert('WARNING: ' + msg);
+}

+ 24 - 25
web/list/log/index.php

@@ -1,25 +1,24 @@
-<?php
-// Init
-error_reporting(NULL);
-session_start();
-$TAB = 'LOG';
-include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
-
-// Header
-include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
-
-// Panel
-top_panel($user,$TAB);
-
-// Data
-exec (VESTA_CMD."v-list-user-log $user json", $output, $return_var);
-check_error($return_var);
-$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
-include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
+<?php
+// Init
+error_reporting(NULL);
+session_start();
+$TAB = 'LOG';
+include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
+
+// Header
+include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
+
+// Panel
+top_panel($user,$TAB);
+
+// Data
+exec (VESTA_CMD."v-list-user-log $user json", $output, $return_var);
+check_error($return_var);
+$data = json_decode(implode('', $output), true);
+$data = array_reverse($data);
+unset($output);
+
+include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_log.html');
+
+// Footer
+include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

+ 23 - 0
web/list/services/index.php

@@ -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');

+ 22 - 0
web/restart/service/index.php

@@ -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;

+ 22 - 0
web/start/service/index.php

@@ -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;

+ 22 - 0
web/stop/service/index.php

@@ -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;

+ 184 - 184
web/templates/admin/add_db.html

@@ -1,184 +1,184 @@
-<?php
-                                    $back = $_SESSION['back'];
-                                    if (empty($back)) {
-                                        $back = "location.href='/list/db/'";
-                                    } else {
-                                        $back = "location.href='".$back."'";
-                                    }
-                                ?>
-
-<table class="sub-menu" style="background: white;">
-    <tr>
-        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b><?php print _('Adding database');?></b></a>
-            <?php
-                                                if (!empty($_SESSION['error_msg'])) {
-                                                    echo "<span class=\"vst-error\"> → ".$_SESSION['error_msg']."</span>";
-            } else {
-            if (!empty($_SESSION['ok_msg'])) {
-            echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
-            }
-            }
-            ?>
-        </td>
-    </tr>
-</table>
-</td>
-</tr>
-</table>
-
-<form id="vstobjects" name="v_add_db" method="post">
-    <script type="text/javascript">
-        function elementHideShow(elementToHideOrShow) {
-            var el = document.getElementById(elementToHideOrShow);
-            if (el.style.display == "block") {
-                el.style.display = "none";
-            } else {
-                el.style.display = "block";
-            }
-        }
-        function randomString() {
-            var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
-            var string_length = 10;
-            var randomstring = '';
-            for (var i=0; i<string_length; i++) {
-                var rnum = Math.floor(Math.random() * chars.length);
-                randomstring += chars.substring(rnum,rnum+1);
-            }
-            document.v_add_db.v_password.value = randomstring;
-        }
-    </script>
-
-    <table class='data'>
-        <tr class="data-add">
-            <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
-                <table class="data-col1">
-                    <tr><td style="padding: 18 0 4 18;"></td></tr>
-                </table>
-            </td>
-            <td class="data-dotted" width="830px" style="vertical-align:top;">
-                <table width="830px">
-                    <tr>
-                        <td></td>
-                    </tr>
-                </table>
-                <table class="data-col2" width="600px">
-                    <tr>
-                        <td style="padding: 10 0 0 2px; color:99a7af;" >
-                            <?php print _('DB_PREFIX_WILL_BE_ADDED',$user."_");?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text" style="padding: 10 0 0 2px;">
-                            <?php print _('Database');?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <input type="text" size="20" class="vst-input" name="v_database" <?php if (!empty($v_database)) echo "value=".$v_database; ?>>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text" style="padding: 10px 0 0 2px;">
-                            <?php print _('Username');?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <input type="text" size="20" class="vst-input" name="v_dbuser" <?php if (!empty($v_dbuser)) echo "value=".$v_dbuser; ?>>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text" style="padding: 10px 0 0 2px;">
-                            <?php print _('Password');?> <a href="javascript:randomString();" class="genpass"><?php print _('generate');?></a>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <input type="text" size="20" class="vst-input" name="v_password">
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text" style="padding: 10 0 0 2px;">
-                            <?php print _('Type');?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <select class="vst-list" name="v_type">
-                                <?php
-                                                        foreach ($db_types as $key => $value) {
-                                echo "\t\t\t\t<option value=\"".$value."\"";
-                                if ((!empty($v_type)) && ( $value == $v_type )) echo ' selected';
-                                echo ">".$value."</option>\n";
-                                }
-                                ?>
-                            </select>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td class="vst-text" style="padding: 10 0 0 2px;">
-                            <?php print _('Charset');?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <select class="vst-list" name="v_charset">
-                                <option value=big5 <?php if ((!empty($v_charset)) && ( $v_charset == 'big5')) echo 'selected';?> >big5</option>
-                                <option value=dec8 <?php if ((!empty($v_charset)) && ( $v_charset == 'dec8')) echo 'selected';?> >dec8</option>
-                                <option value=cp850 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp850')) echo 'selected';?> >cp850</option>
-                                <option value=hp8 <?php if ((!empty($v_charset)) && ( $v_charset == 'hp8')) echo 'selected';?> >hp8</option>
-                                <option value=koi8r <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8r')) echo 'selected';?> >koi8r</option>
-                                <option value=latin1 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin1')) echo 'selected';?> >latin1</option>
-                                <option value=latin2 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin2')) echo 'selected';?> >latin2</option>
-                                <option value=swe7 <?php if ((!empty($v_charset)) && ( $v_charset == 'swe7')) echo 'selected';?> >swe7</option>
-                                <option value=ascii <?php if ((!empty($v_charset)) && ( $v_charset == 'ascii')) echo 'selected';?> >ascii</option>
-                                <option value=ujis <?php if ((!empty($v_charset)) && ( $v_charset == 'ujis')) echo 'selected';?> >ujis</option>
-                                <option value=sjis <?php if ((!empty($v_charset)) && ( $v_charset == 'sjis')) echo 'selected';?> >sjis</option>
-                                <option value=hebrew <?php if ((!empty($v_charset)) && ( $v_charset == 'hebrew')) echo 'selected';?> >hebrew</option>
-                                <option value=tis620 <?php if ((!empty($v_charset)) && ( $v_charset == 'tis620')) echo 'selected';?> >tis620</option>
-                                <option value=euckr <?php if ((!empty($v_charset)) && ( $v_charset == 'euckr')) echo 'selected';?> >euckr</option>
-                                <option value=koi8u <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8u')) echo 'selected';?> >koi8u</option>
-                                <option value=gb2312 <?php if ((!empty($v_charset)) && ( $v_charset == 'gb2312')) echo 'selected';?> >gb2312</option>
-                                <option value=greek <?php if ((!empty($v_charset)) && ( $v_charset == 'greek')) echo 'selected';?> >greek</option>
-                                <option value=cp1250 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1250')) echo 'selected';?> >cp1250</option>
-                                <option value=gbk <?php if ((!empty($v_charset)) && ( $v_charset == 'gbk')) echo 'selected';?> >gbk</option>
-                                <option value=latin5 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin5')) echo 'selected';?> >latin5</option>
-                                <option value=armscii8 <?php if ((!empty($v_charset)) && ( $v_charset == 'armscii8')) echo 'selected';?> >armscii8</option>
-                                <option value=utf8 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8')) echo 'selected';?> <?php if (empty($v_charset)) echo 'selected';?> >utf8</option>
-                                <option value=ucs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'ucs2')) echo 'selected';?> >ucs2</option>
-                                <option value=cp866 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp866')) echo 'selected';?> >cp866</option>
-                                <option value=keybcs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'keybcs2')) echo 'selected';?> >keybcs2</option>
-                                <option value=macce <?php if ((!empty($v_charset)) && ( $v_charset == 'macce')) echo 'selected';?> >macce</option>
-                                <option value=macroman <?php if ((!empty($v_charset)) && ( $v_charset == 'macroman')) echo 'selected';?> >macroman</option>
-                                <option value=cp852 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp852')) echo 'selected';?> >cp852</option>
-                                <option value=latin7 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin7')) echo 'selected';?> >latin7</option>
-                                <option value=cp1251 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1251')) echo 'selected';?> >cp1251</option>
-                                <option value=cp1256 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1256')) echo 'selected';?> >cp1256</option>
-                                <option value=cp1257 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1257')) echo 'selected';?> >cp1257</option>
-                                <option value=binary <?php if ((!empty($v_charset)) && ( $v_charset == 'binary')) echo 'selected';?> >binary</option>
-                                <option value=geostd8 <?php if ((!empty($v_charset)) && ( $v_charset == 'geostd8')) echo 'selected';?> >geostd8</option>
-                                <option value=cp932 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp932')) echo 'selected';?> >cp932</option>
-                                <option value=eucjpms <?php if ((!empty($v_charset)) && ( $v_charset == 'eucjpms')) echo 'selected';?> >eucjpms</option>
-                            </select>
-                        </td>
-                    <tr>
-                        <td class="vst-text" style="padding: 10px 0 0 2px;">
-                            <?php print _('Send credentials to'); echo $panel[$user]['CONTACT'] ?>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>
-                            <input type="checkbox" size="20" class="vst-checkbox" name="v_notify" <?php if (empty($v_notify)) echo "checked=yes"; ?>>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="padding: 24px 0 0 0;">
-                            <input type="submit" name="ok" value="<?php print _('Add');?>" class="button">
-                            <input type="button" class="button" value="<?php print _('Back');?>" onclick="<?php echo $back ?>">
-                        </td>
-                    </tr>
-                </table>
-            </td>
-        </tr>
-    </table>
-</form>
+<?php
+                                    $back = $_SESSION['back'];
+                                    if (empty($back)) {
+                                        $back = "location.href='/list/db/'";
+                                    } else {
+                                        $back = "location.href='".$back."'";
+                                    }
+                                ?>
+
+<table class="sub-menu" style="background: white;">
+    <tr>
+        <td style="padding: 10px 2px 10px 0;" ><a class="name"><b><?php print _('Adding database');?></b></a>
+            <?php
+                                                if (!empty($_SESSION['error_msg'])) {
+                                                    echo "<span class=\"vst-error\"> → ".$_SESSION['error_msg']."</span>";
+            } else {
+            if (!empty($_SESSION['ok_msg'])) {
+            echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
+            }
+            }
+            ?>
+        </td>
+    </tr>
+</table>
+</td>
+</tr>
+</table>
+
+<form id="vstobjects" name="v_add_db" method="post">
+    <script type="text/javascript">
+        function elementHideShow(elementToHideOrShow) {
+            var el = document.getElementById(elementToHideOrShow);
+            if (el.style.display == "block") {
+                el.style.display = "none";
+            } else {
+                el.style.display = "block";
+            }
+        }
+        function randomString() {
+            var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
+            var string_length = 10;
+            var randomstring = '';
+            for (var i=0; i<string_length; i++) {
+                var rnum = Math.floor(Math.random() * chars.length);
+                randomstring += chars.substring(rnum,rnum+1);
+            }
+            document.v_add_db.v_password.value = randomstring;
+        }
+    </script>
+
+    <table class='data'>
+        <tr class="data-add">
+            <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
+                <table class="data-col1">
+                    <tr><td style="padding: 18 0 4 18;"></td></tr>
+                </table>
+            </td>
+            <td class="data-dotted" width="830px" style="vertical-align:top;">
+                <table width="830px">
+                    <tr>
+                        <td></td>
+                    </tr>
+                </table>
+                <table class="data-col2" width="600px">
+                    <tr>
+                        <td style="padding: 10 0 0 2px; color:99a7af;" >
+                            <?php print _('DB_PREFIX_WILL_BE_ADDED',$user."_");?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="vst-text" style="padding: 10 0 0 2px;">
+                            <?php print _('Database');?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <input type="text" size="20" class="vst-input" name="v_database" <?php if (!empty($v_database)) echo "value=".$v_database; ?>>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="vst-text" style="padding: 10px 0 0 2px;">
+                            <?php print _('Username');?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <input type="text" size="20" class="vst-input" name="v_dbuser" <?php if (!empty($v_dbuser)) echo "value=".$v_dbuser; ?>>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="vst-text" style="padding: 10px 0 0 2px;">
+                            <?php print _('Password');?> <a href="javascript:randomString();" class="genpass"><?php print _('generate');?></a>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <input type="text" size="20" class="vst-input" name="v_password">
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="vst-text" style="padding: 10 0 0 2px;">
+                            <?php print _('Type');?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <select class="vst-list" name="v_type">
+                                <?php
+                                                        foreach ($db_types as $key => $value) {
+                                echo "\t\t\t\t<option value=\"".$value."\"";
+                                if ((!empty($v_type)) && ( $value == $v_type )) echo ' selected';
+                                echo ">".$value."</option>\n";
+                                }
+                                ?>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="vst-text" style="padding: 10 0 0 2px;">
+                            <?php print _('Charset');?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <select class="vst-list" name="v_charset">
+                                <option value=big5 <?php if ((!empty($v_charset)) && ( $v_charset == 'big5')) echo 'selected';?> >big5</option>
+                                <option value=dec8 <?php if ((!empty($v_charset)) && ( $v_charset == 'dec8')) echo 'selected';?> >dec8</option>
+                                <option value=cp850 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp850')) echo 'selected';?> >cp850</option>
+                                <option value=hp8 <?php if ((!empty($v_charset)) && ( $v_charset == 'hp8')) echo 'selected';?> >hp8</option>
+                                <option value=koi8r <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8r')) echo 'selected';?> >koi8r</option>
+                                <option value=latin1 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin1')) echo 'selected';?> >latin1</option>
+                                <option value=latin2 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin2')) echo 'selected';?> >latin2</option>
+                                <option value=swe7 <?php if ((!empty($v_charset)) && ( $v_charset == 'swe7')) echo 'selected';?> >swe7</option>
+                                <option value=ascii <?php if ((!empty($v_charset)) && ( $v_charset == 'ascii')) echo 'selected';?> >ascii</option>
+                                <option value=ujis <?php if ((!empty($v_charset)) && ( $v_charset == 'ujis')) echo 'selected';?> >ujis</option>
+                                <option value=sjis <?php if ((!empty($v_charset)) && ( $v_charset == 'sjis')) echo 'selected';?> >sjis</option>
+                                <option value=hebrew <?php if ((!empty($v_charset)) && ( $v_charset == 'hebrew')) echo 'selected';?> >hebrew</option>
+                                <option value=tis620 <?php if ((!empty($v_charset)) && ( $v_charset == 'tis620')) echo 'selected';?> >tis620</option>
+                                <option value=euckr <?php if ((!empty($v_charset)) && ( $v_charset == 'euckr')) echo 'selected';?> >euckr</option>
+                                <option value=koi8u <?php if ((!empty($v_charset)) && ( $v_charset == 'koi8u')) echo 'selected';?> >koi8u</option>
+                                <option value=gb2312 <?php if ((!empty($v_charset)) && ( $v_charset == 'gb2312')) echo 'selected';?> >gb2312</option>
+                                <option value=greek <?php if ((!empty($v_charset)) && ( $v_charset == 'greek')) echo 'selected';?> >greek</option>
+                                <option value=cp1250 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1250')) echo 'selected';?> >cp1250</option>
+                                <option value=gbk <?php if ((!empty($v_charset)) && ( $v_charset == 'gbk')) echo 'selected';?> >gbk</option>
+                                <option value=latin5 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin5')) echo 'selected';?> >latin5</option>
+                                <option value=armscii8 <?php if ((!empty($v_charset)) && ( $v_charset == 'armscii8')) echo 'selected';?> >armscii8</option>
+                                <option value=utf8 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8')) echo 'selected';?> <?php if (empty($v_charset)) echo 'selected';?> >utf8</option>
+                                <option value=ucs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'ucs2')) echo 'selected';?> >ucs2</option>
+                                <option value=cp866 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp866')) echo 'selected';?> >cp866</option>
+                                <option value=keybcs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'keybcs2')) echo 'selected';?> >keybcs2</option>
+                                <option value=macce <?php if ((!empty($v_charset)) && ( $v_charset == 'macce')) echo 'selected';?> >macce</option>
+                                <option value=macroman <?php if ((!empty($v_charset)) && ( $v_charset == 'macroman')) echo 'selected';?> >macroman</option>
+                                <option value=cp852 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp852')) echo 'selected';?> >cp852</option>
+                                <option value=latin7 <?php if ((!empty($v_charset)) && ( $v_charset == 'latin7')) echo 'selected';?> >latin7</option>
+                                <option value=cp1251 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1251')) echo 'selected';?> >cp1251</option>
+                                <option value=cp1256 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1256')) echo 'selected';?> >cp1256</option>
+                                <option value=cp1257 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp1257')) echo 'selected';?> >cp1257</option>
+                                <option value=binary <?php if ((!empty($v_charset)) && ( $v_charset == 'binary')) echo 'selected';?> >binary</option>
+                                <option value=geostd8 <?php if ((!empty($v_charset)) && ( $v_charset == 'geostd8')) echo 'selected';?> >geostd8</option>
+                                <option value=cp932 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp932')) echo 'selected';?> >cp932</option>
+                                <option value=eucjpms <?php if ((!empty($v_charset)) && ( $v_charset == 'eucjpms')) echo 'selected';?> >eucjpms</option>
+                            </select>
+                        </td>
+                    <tr>
+                        <td class="vst-text" style="padding: 10px 0 0 2px;">
+                            <?php print _('Send credentials to'); echo $panel[$user]['CONTACT'] ?>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <input type="checkbox" size="20" class="vst-checkbox" name="v_notify" <?php if (empty($v_notify)) echo "checked=yes"; ?>>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td style="padding: 24px 0 0 0;">
+                            <input type="submit" name="ok" value="<?php print _('Add');?>" class="button">
+                            <input type="button" class="button" value="<?php print _('Back');?>" onclick="<?php echo $back ?>">
+                        </td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</form>

+ 146 - 146
web/templates/admin/list_dns.html

@@ -1,146 +1,146 @@
-<table class="sub-menu" style="background: white;">
-    <tr>
-        <td style="padding: 12px 0 8px 6px">
-            <div style="float:left">
-                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> <?php print _('Add DNS Domain');?> </button>
-            </div>
-            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                </form>
-            </div>
-            <div style="float:left; padding-left: 26px;">
-                <form action="/bulk/dns/" method="post" id="objects">
-                    <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
-                    <select style="margin:0 2px 0 0px;" name="action">
-                        <option><?php print _('apply to selected');?></option>
-                        <option><?php print _('suspend');?></option>
-                        <option><?php print _('unsuspend');?></option>
-                        <option><?php print _('delete');?></option>
-                    </select>
-                    <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-            </div>
-        </td>
-    </tr>
-</table>
-</td>
-</tr>
-</table>
-
-<div id="vstobjects">
-    <table class="data">
-        <?php
-                                foreach ($data as $key => $value) {
-        ++$i;
-        if ($data[$key]['SUSPENDED'] == 'yes') {
-        $status = 'suspended';
-        $spnd_action = 'unsuspend' ;
-        } else {
-        $status = 'active';
-        $spnd_action = 'suspend' ;
-        }
-        ?>
-
-        <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
-                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status) ?></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="108px"><a href="/list/dns/?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> <?php print _('LIST_DOMAIN_RECORDS',$data[$key]['RECORDS']); ?> </a></td>
-                        <td class="data-controls" width="92px"><a href="/add/dns/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> <?php print _('add record');?></a></td>
-                        <td class="data-controls" width="50px"><a href="/edit/dns/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
-                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
-                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
-                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
-                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/dns/?domain=<?php echo $key ?>" />
-                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('DOMAIN_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
-                            </div>
-                        </td>
-                        <td class="data-controls do_delete" width="70px">
-                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
-                            <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $key ?>" />
-                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('DOMAIN_ACTION_CONFIRMATION',_('delete'),$key);?></p>
-                            </div>
-                        </td>
-                    </tr>
-                </table>
-                <table class="data-col2" width="830px">
-                    <tr>
-                        <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
-                            <b><?php echo $key ?></b>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td style="vertical-align:top;" >
-                            <table>
-                                <tr>
-                                    <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">
-                            <table>
-                                <tr>
-                                    <td class="counter-name">SOA:</td>
-                                    <td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
-                                </tr>
-                                <tr>
-                                    <td class="counter-name">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 date("Y M d", strtotime($data[$key]['EXP'])) ?></td>
-                                </tr>
-                                <tr>
-                                    <td class="counter-name"><?php print _('Records');?>:</td>
-                                    <td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
-                                </tr>
-                            </table>
-                        </td>
-                    </tr>
-                </table>
-            </td>
-        </tr>
-        <?php
-                                }
-                            ?>
-    </table>
-    </form>
-
-    <table class="data-count">
-        <tr>
-            <td width="160px"></td>
-            <td>
-                <?php
-                                        if ( $i == 1) {
-                                            echo _('one domain');
-                                        } else {
-                                            echo _('%s domains',$i);
-                                        }
-                                    ?>
-            </td>
-        </tr>
-    </table>
-</div>
+<table class="sub-menu" style="background: white;">
+    <tr>
+        <td style="padding: 12px 0 8px 6px">
+            <div style="float:left">
+                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> <?php print _('Add DNS Domain');?> </button>
+            </div>
+            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                </form>
+            </div>
+            <div style="float:left; padding-left: 26px;">
+                <form action="/bulk/dns/" method="post" id="objects">
+                    <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
+                    <select style="margin:0 2px 0 0px;" name="action">
+                        <option><?php print _('apply to selected');?></option>
+                        <option><?php print _('suspend');?></option>
+                        <option><?php print _('unsuspend');?></option>
+                        <option><?php print _('delete');?></option>
+                    </select>
+                    <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+            </div>
+        </td>
+    </tr>
+</table>
+</td>
+</tr>
+</table>
+
+<div id="vstobjects">
+    <table class="data">
+        <?php
+                                foreach ($data as $key => $value) {
+        ++$i;
+        if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+        } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+        }
+        ?>
+
+        <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
+                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status) ?></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="108px"><a href="/list/dns/?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> <?php print _('LIST_DOMAIN_RECORDS',$data[$key]['RECORDS']); ?> </a></td>
+                        <td class="data-controls" width="92px"><a href="/add/dns/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> <?php print _('add record');?></a></td>
+                        <td class="data-controls" width="50px"><a href="/edit/dns/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
+                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
+                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
+                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
+                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/dns/?domain=<?php echo $key ?>" />
+                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('DOMAIN_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
+                            </div>
+                        </td>
+                        <td class="data-controls do_delete" width="70px">
+                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
+                            <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $key ?>" />
+                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('DOMAIN_ACTION_CONFIRMATION',_('delete'),$key);?></p>
+                            </div>
+                        </td>
+                    </tr>
+                </table>
+                <table class="data-col2" width="830px">
+                    <tr>
+                        <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
+                            <b><?php echo $key ?></b>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td style="vertical-align:top;" >
+                            <table>
+                                <tr>
+                                    <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">
+                            <table>
+                                <tr>
+                                    <td class="counter-name">SOA:</td>
+                                    <td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
+                                </tr>
+                                <tr>
+                                    <td class="counter-name">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 date("Y M d", strtotime($data[$key]['EXP'])) ?></td>
+                                </tr>
+                                <tr>
+                                    <td class="counter-name"><?php print _('Records');?>:</td>
+                                    <td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+        <?php
+                                }
+                            ?>
+    </table>
+    </form>
+
+    <table class="data-count">
+        <tr>
+            <td width="160px"></td>
+            <td>
+                <?php
+                                        if ( $i == 1) {
+                                            echo _('one domain');
+                                        } else {
+                                            echo _('%s domains',$i);
+                                        }
+                                    ?>
+            </td>
+        </tr>
+    </table>
+</div>

+ 115 - 115
web/templates/admin/list_dns_rec.html

@@ -1,115 +1,115 @@
-<table class="sub-menu" style="background: white;">
-    <tr>
-        <td style="padding: 12px 0 8px 6px">
-            <div style="float:left">
-                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> <?php print _('Add DNS Record');?> </button>
-            </div>
-            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                </form>
-            </div>
-            <div style="float:left; padding-left: 26px;">
-                <form action="/bulk/dns/" method="post" id="objects">
-                    <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
-                    <select style="margin:0 2px 0 0px;" name="action">
-                        <option><?php print _('apply to selected');?></option>
-                        <option><?php print _('suspend');?></option>
-                        <option><?php print _('unsuspend');?></option>
-                        <option><?php print _('delete');?></option>
-                    </select>
-                    <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-            </div>
-        </td>
-    </tr>
-</table>
-</td>
-</tr>
-</table>
-
-<div id="vstobjects">
-    <div style="height:10px; font-size:0;"></div>
-    <table class="data" style="background: #ebe9dc;">
-        <tr>
-            <td style="padding: 8px 2px 8px 0;">
-                <a class="name" style="color: #555; font-size: 10pt;"><b><?php print _('Listing');?>  <?php echo $_GET['domain'] ?></b></a>
-            </td>
-        </tr>
-    </table>
-    <div style="height:10px; font-size:0;"></div>
-    <table class="data">
-        <?php
-                                foreach ($data as $key => $value) {
-        ++$i;
-        if ($data[$key]['SUSPENDED'] == 'yes') {
-        $status = 'suspended';
-        $spnd_action = 'unsuspend' ;
-        } else {
-        $status = 'active';
-        $spnd_action = 'suspend' ;
-        }
-        ?>
-
-        <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="record[]" value="<?php echo $data[$key]['ID']?>" > <input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
-                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="50px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
-                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
-                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
-                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
-                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
-                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('RECORD_ACTION_CONFIRMATION',_($spnd_action),$data[$key]['RECORD']);?></p>
-                            </div>
-                        </td>
-                        <td class="data-controls do_delete" width="70px">
-                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
-                            <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
-                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('RECORD_ACTION_CONFIRMATION',_('delete'),$data[$key]['RECORD']);?></p>
-                            </div>
-                        </td>
-                    </tr>
-                </table>
-                <table class="data-col5" width="780px">
-                    <tr>
-                        <td class="log" style="padding: 0 0 0 4px;" width="200"><b><?php echo $data[$key]['RECORD'] ?></b></td>
-                        <td class="log-counter-value" width="80"><?php echo $data[$key]['TYPE'] ?></td>
-                        <td class="log-counter-value" width="80"><?php echo $data[$key]['PRIORITY'] ?></td>
-                        <td class="log-counter-value" ><?php echo $data[$key]['VALUE'] ?></td>
-                    </tr>
-                </table>
-            </td>
-        </tr>
-        <?php
-                            }
-                        ?>
-    </table>
-    </form>
-
-    <table class="data-count">
-        <tr>
-            <td width="160px">
-            <td>
-                <?php
-                                    if ( $i == 1) {
-                                        echo _('one DNS record');
-                                    } else {
-                                        echo _('%s DNS records',$i);
-                                    }
-                                ?>
-            </td>
-        </tr>
-    </table>
-</div>
+                               <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> <?php print _('Add DNS Record');?> </button>
+                                            </div>
+                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                                                </form>
+                                            </div>
+                                            <div style="float:left; padding-left: 26px;">
+                                                <form action="/bulk/dns/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
+                                                    <option><?php print _('apply to selected');?></option>
+                                                    <option><?php print _('suspend');?></option>
+                                                    <option><?php print _('unsuspend');?></option>
+                                                    <option><?php print _('delete');?></option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+<div id="vstobjects">
+    <div style="height:10px; font-size:0;"></div>
+    <table class="data" style="background: #ebe9dc;">
+        <tr>
+            <td style="padding: 8px 2px 8px 0;">
+                <a class="name" style="color: #555; font-size: 10pt;"><b><?php print _('Listing');?>  <?php echo $_GET['domain'] ?></b></a>
+            </td>
+        </tr>
+    </table>
+    <div style="height:10px; font-size:0;"></div>
+    <table class="data">
+        <?php
+
+                                foreach ($data as $key => $value) {
+        ++$i;
+        if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+        } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+        }
+        ?>
+
+        <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="record[]" value="<?php echo $data[$key]['ID']?>" > <input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
+                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="50px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
+                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
+                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
+                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
+                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
+                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('RECORD_ACTION_CONFIRMATION',_($spnd_action),$data[$key]['RECORD']);?></p>
+                            </div>
+                        </td>
+                        <td class="data-controls do_delete" width="70px">
+                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
+                            <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
+                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('RECORD_ACTION_CONFIRMATION',_('delete'),$data[$key]['RECORD']);?></p>
+                            </div>
+                        </td>
+                    </tr>
+                </table>
+                <table class="data-col5" width="780px">
+                    <tr>
+                        <td class="log" style="padding: 0 0 0 4px;" width="200"><b><?php echo $data[$key]['RECORD'] ?></b></td>
+                        <td class="log-counter-value" width="80"><?php echo $data[$key]['TYPE'] ?></td>
+                        <td class="log-counter-value" width="80"><?php echo $data[$key]['PRIORITY'] ?></td>
+                        <td class="log-counter-value" ><?php echo $data[$key]['VALUE'] ?></td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+        <?php
+                            }
+                        ?>
+    </table>
+    </form>
+
+    <table class="data-count">
+        <tr>
+            <td width="160px">
+            <td>
+                <?php
+                                    if ( $i == 1) {
+                                        echo _('one DNS record');
+                                    } else {
+                                        echo _('%s DNS records',$i);
+                                    }
+                                ?>
+            </td>
+        </tr>
+    </table>
+</div>

+ 173 - 173
web/templates/admin/list_mail.html

@@ -1,173 +1,173 @@
-<table class="sub-menu" style="background: white;">
-    <tr>
-        <td style="padding: 12px 0 8px 6px">
-            <div style="float:left">
-                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> <?php print _('Add Mail Domain');?> </button>
-            </div>
-            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                </form>
-            </div>
-            <div style="float:left; padding-left: 26px;">
-                <form action="/bulk/mail/" method="post" id="objects">
-                    <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
-                    <select style="margin:0 2px 0 0px;" name="action">
-                        <option><?php print _('apply to selected');?></option>
-                        <option><?php print _('suspend');?></option>
-                        <option><?php print _('unsuspend');?></option>
-                        <option><?php print _('delete');?></option>
-                    </select>
-                    <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-            </div>
-        </td>
-    </tr>
-</table>
-</td>
-</tr>
-</table>
-
-<div id="vstobjects">
-    <table class="data">
-        <?php
-                                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
-                                foreach ($data as $key => $value) {
-        ++$i;
-        if ($data[$key]['SUSPENDED'] == 'yes') {
-        $status = 'suspended';
-        $spnd_action = 'unsuspend' ;
-        } else {
-        $status = 'active';
-        $spnd_action = 'suspend' ;
-        }
-        if (empty($data[$key]['CATCHALL'])) {
-        $data[$key]['CATCHALL'] = '/dev/null';
-        }
-        ?>
-
-        <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
-                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="112px"><a href="?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> <?php print _('list');?> <?php echo $data[$key]['ACCOUNTS'] ?> <?php print _('accounts');?></a></td>
-                        <td class="data-controls" width="98px"><a href="/add/mail/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> <?php print _('add account');?></a></td>
-                        <td class="data-controls" width="104px"><a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank"><img src="/images/new_window.png" width="8px" height="8px"> <?php print _('open webmail');?></a></td>
-                        <td class="data-controls" width="50px"><a href="/edit/mail/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
-                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
-                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
-                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
-                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/mail/?domain=<?php echo $key ?>" />
-                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('MAIL_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
-                            </div>
-                        </td>
-                        <td class="data-controls do_delete" width="70px">
-                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
-                            <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $key ?>" />
-                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
-                                <p class="counter-value"><?php print _('MAIL_ACTION_CONFIRMATION',_('delete'),$key);?></p>
-                            </div>
-                        </td>
-                    </tr>
-                </table>
-
-                <table class="data-col2" width="830px">
-                    <tr>
-                        <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
-                            <b><?php echo $key ?></b>
-                        </td>
-                    </tr>
-                    <tr>
-                        <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">
-                                        <?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>
-                                    </td>
-                                </tr>
-                            </table>
-                        </td>
-                        <td style="vertical-align:top;" width="250">
-                            <table>
-                                <tr>
-                                    <td class="counter-name">
-                                        <?php print _('AntiVirus Support');?>:
-                                    </td>
-                                    <td class="counter-value">
-                                        <?php echo $data[$key]['ANTIVIRUS'] ?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="counter-name">
-                                        <?php print _('AntiSpam Support');?>:
-                                    </td>
-                                    <td class="counter-value">
-                                        <?php echo $data[$key]['ANTISPAM'] ?>
-                                    </td>
-                                </tr>
-                            </table>
-                        </td>
-                        <td rowspan=4 style="vertical-align:top;" width="300">
-                            <table>
-                                <tr>
-                                    <td class="counter-name">
-                                        <?php print _('DKIM Support');?>:
-                                    </td>
-                                    <td class="counter-value">
-                                        <?php echo $data[$key]['DKIM'] ?>
-                                    </td>
-                                </tr>
-                                <tr>
-                                    <td class="counter-name">
-                                        <?php print _('Accounts');?>:
-                                    </td>
-                                    <td class="counter-value">
-                                        <?php echo $data[$key]['ACCOUNTS'] ?>
-                                    </td>
-                                </tr>
-                            </table>
-                        </td>
-                    </tr>
-                </table>
-            </td>
-        </tr>
-
-        <?php
-                                }
-                            ?>
-    </table>
-    </form>
-
-    <table class="data-count">
-        <tr>
-            <td width="160px"></td>
-            <td>
-                <?php
-                                        if ( $i == 1) {
-                                            echo _('one domain with email');
-                                        } else {
-                                            echo _('%s domains with email',$i);
-                                        }
-                                    ?>
-            </td>
-        </tr>
-    </table>
-</div>
+<table class="sub-menu" style="background: white;">
+    <tr>
+        <td style="padding: 12px 0 8px 6px">
+            <div style="float:left">
+                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> <?php print _('Add Mail Domain');?> </button>
+            </div>
+            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                </form>
+            </div>
+            <div style="float:left; padding-left: 26px;">
+                <form action="/bulk/mail/" method="post" id="objects">
+                    <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
+                    <select style="margin:0 2px 0 0px;" name="action">
+                        <option><?php print _('apply to selected');?></option>
+                        <option><?php print _('suspend');?></option>
+                        <option><?php print _('unsuspend');?></option>
+                        <option><?php print _('delete');?></option>
+                    </select>
+                    <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+            </div>
+        </td>
+    </tr>
+</table>
+</td>
+</tr>
+</table>
+
+<div id="vstobjects">
+    <table class="data">
+        <?php
+                                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
+                                foreach ($data as $key => $value) {
+        ++$i;
+        if ($data[$key]['SUSPENDED'] == 'yes') {
+        $status = 'suspended';
+        $spnd_action = 'unsuspend' ;
+        } else {
+        $status = 'active';
+        $spnd_action = 'suspend' ;
+        }
+        if (empty($data[$key]['CATCHALL'])) {
+        $data[$key]['CATCHALL'] = '/dev/null';
+        }
+        ?>
+
+        <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
+                    <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                    <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="112px"><a href="?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> <?php print _('list');?> <?php echo $data[$key]['ACCOUNTS'] ?> <?php print _('accounts');?></a></td>
+                        <td class="data-controls" width="98px"><a href="/add/mail/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> <?php print _('add account');?></a></td>
+                        <td class="data-controls" width="104px"><a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank"><img src="/images/new_window.png" width="8px" height="8px"> <?php print _('open webmail');?></a></td>
+                        <td class="data-controls" width="50px"><a href="/edit/mail/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
+                        <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
+                            <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
+                            <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
+                            <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/mail/?domain=<?php echo $key ?>" />
+                            <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('MAIL_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
+                            </div>
+                        </td>
+                        <td class="data-controls do_delete" width="70px">
+                            <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                            <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
+                            <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $key ?>" />
+                            <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
+                                <p class="counter-value"><?php print _('MAIL_ACTION_CONFIRMATION',_('delete'),$key);?></p>
+                            </div>
+                        </td>
+                    </tr>
+                </table>
+
+                <table class="data-col2" width="830px">
+                    <tr>
+                        <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
+                            <b><?php echo $key ?></b>
+                        </td>
+                    </tr>
+                    <tr>
+                        <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">
+                                        <?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>
+                                    </td>
+                                </tr>
+                            </table>
+                        </td>
+                        <td style="vertical-align:top;" width="250">
+                            <table>
+                                <tr>
+                                    <td class="counter-name">
+                                        <?php print _('AntiVirus Support');?>:
+                                    </td>
+                                    <td class="counter-value">
+                                        <?php echo $data[$key]['ANTIVIRUS'] ?>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td class="counter-name">
+                                        <?php print _('AntiSpam Support');?>:
+                                    </td>
+                                    <td class="counter-value">
+                                        <?php echo $data[$key]['ANTISPAM'] ?>
+                                    </td>
+                                </tr>
+                            </table>
+                        </td>
+                        <td rowspan=4 style="vertical-align:top;" width="300">
+                            <table>
+                                <tr>
+                                    <td class="counter-name">
+                                        <?php print _('DKIM Support');?>:
+                                    </td>
+                                    <td class="counter-value">
+                                        <?php echo $data[$key]['DKIM'] ?>
+                                    </td>
+                                </tr>
+                                <tr>
+                                    <td class="counter-name">
+                                        <?php print _('Accounts');?>:
+                                    </td>
+                                    <td class="counter-value">
+                                        <?php echo $data[$key]['ACCOUNTS'] ?>
+                                    </td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+
+        <?php
+                                }
+                            ?>
+    </table>
+    </form>
+
+    <table class="data-count">
+        <tr>
+            <td width="160px"></td>
+            <td>
+                <?php
+                                        if ( $i == 1) {
+                                            echo _('one domain with email');
+                                        } else {
+                                            echo _('%s domains with email',$i);
+                                        }
+                                    ?>
+            </td>
+        </tr>
+    </table>
+</div>

+ 162 - 162
web/templates/admin/list_mail_acc.html

@@ -1,162 +1,162 @@
-<table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <td style="padding: 12px 0 8px 6px">
-                                            <div style="float:left">
-                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> <?php print _('Add Mail Account');?> </button>
-                                            </div>
-                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                                                </form>
-                                            </div>
-                                            <div style="float:left; padding-left: 26px;">
-                                                <form action="/bulk/mail/" method="post" id="objects">
-                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
-                                                <select style="margin:0 2px 0 0px;" name="action">
-                                                    <option><?php print _('apply to selected');?></option>
-                                                    <option><?php print _('suspend');?></option>
-                                                    <option><?php print _('unsuspend');?></option>
-                                                    <option><?php print _('delete');?></option>
-                                                </select>
-                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data" style="background: #ebe9dc;">
-                            <tr>
-                                <td style="padding: 8px 2px 8px 0;">
-                                    <a class="name" style="color: #555; font-size: 10pt;"><b><?php print _('Listing');?>  <?php echo $_GET['domain'] ?></b></a>
-                                </td>
-                            </tr>
-                        </table>
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data">
-                            <?php
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                                    if ($data[$key]['SUSPENDED'] == 'yes') {
-                                        $status = 'suspended';
-                                        $spnd_action = 'unsuspend' ;
-                                    } else {
-                                        $status = 'active';
-                                        $spnd_action = 'suspend';
-                                    }
-                            ?>
-
-                            <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="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="50px"><a href="/edit/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
-                                            <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
-                                                <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
-                                                <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
-                                                <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
-                                                <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
-                                                    <p class="counter-value"><?php print _('MAIL_ACCOUNT_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
-                                                </div>
-                                            </td>
-                                            <td class="data-controls do_delete" width="70px">
-                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
-                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
-                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
-                                                    <p class="counter-value"><?php print _('MAIL_ACCOUNT_ACTION_CONFIRMATION',_('delete'),$key);?></p>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                </table>
-
-                                <table class="data-col2" width="830px">
-                                    <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key."@".$_GET['domain'] ?></b> <a class="aliases" style="padding: 0 20px 0 4px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
-                                    <tr>
-                                        <td style="vertical-align:top;" >
-                                            <table>
-                                                <tr>
-                                                    <td class="counter-name" style="padding: 4px 0 0 0;">
-                                                        <?php echo $data[$key]['IP'] ?>
-                                                    </td>
-                                                <tr>
-                                                    <td class="chart1" style="padding: 0 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>
-                                                    </td>
-                                                </tr>
-                                            </table>
-                                        </td>
-                                        <td style="vertical-align:top;" width="200">
-                                            <table>
-                                                <tr>
-                                                    <td class="counter-name">
-                                                        <?php print _('Quota');?>:
-                                                    </td>
-                                                    <td class="counter-value">
-                                                        <?php echo $data[$key]['QUOTA'] ?>
-                                                    </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Autoreply');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['AUTOREPLY'] ?>
-                                                        </td>
-                                                    </tr>
-                                            </table>
-                                        </td>
-                                        <td rowspan=4 style="vertical-align:top;" width="350">
-                                            <table width="350">
-                                                <tr>
-                                                    <td class="counter-name">
-                                                        <?php print _('Forward to');?>:
-                                                    </td>
-                                                    <td class="counter-value" style="padding: 0 0 0 8px;" >
-                                                        <?php echo str_replace(',', ', ', $data[$key]['FWD']) ?> 
-                                                    </td>
-                                                </tr>
-                                            </table>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-
-                        <?php
-                            }
-                        ?>
-                    </table>
-                    </form>
-
-                    <table class="data-count">
-                        <tr>
-                            <td width="160px"></td>
-                            <td>
-                                <?php
-                                    if ( $i == 1) {
-                                        echo _('one mail account');
-                                    } else {
-                                        echo _('%s mail accounts',$i);
-                                    }
-                                ?>
-                            </td>
-                        </tr>
-                    </table>
-                </div>
+<table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> <?php print _('Add Mail Account');?> </button>
+                                            </div>
+                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                                                </form>
+                                            </div>
+                                            <div style="float:left; padding-left: 26px;">
+                                                <form action="/bulk/mail/" method="post" id="objects">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
+                                                <select style="margin:0 2px 0 0px;" name="action">
+                                                    <option><?php print _('apply to selected');?></option>
+                                                    <option><?php print _('suspend');?></option>
+                                                    <option><?php print _('unsuspend');?></option>
+                                                    <option><?php print _('delete');?></option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data" style="background: #ebe9dc;">
+                            <tr>
+                                <td style="padding: 8px 2px 8px 0;">
+                                    <a class="name" style="color: #555; font-size: 10pt;"><b><?php print _('Listing');?>  <?php echo $_GET['domain'] ?></b></a>
+                                </td>
+                            </tr>
+                        </table>
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data">
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                                    if ($data[$key]['SUSPENDED'] == 'yes') {
+                                        $status = 'suspended';
+                                        $spnd_action = 'unsuspend' ;
+                                    } else {
+                                        $status = 'active';
+                                        $spnd_action = 'suspend';
+                                    }
+                            ?>
+
+                            <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="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></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="50px"><a href="/edit/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> <?php print _('edit');?></a></td>
+                                            <td class="data-controls do_<?php echo $spnd_action ?>" width="80px">
+                                                <img src="/images/suspend.png" width="7px" height="8px" class="do_<?php echo $spnd_action ?>">
+                                                <a id="<?php echo $spnd_action ?>_link_<?php echo $i ?>" class="do_<?php echo $spnd_action ?>"> <?php echo _($spnd_action); ?></a>
+                                                <input type="hidden" name="<?php echo $spnd_action ?>_url" value="/<?php echo $spnd_action ?>/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
+                                                <div id="<?php echo $spnd_action ?>_dialog_<?php echo $i ?>" class="confirmation-text-suspention hidden" title="<?php print _('Confirmation');?>">
+                                                    <p class="counter-value"><?php print _('MAIL_ACCOUNT_ACTION_CONFIRMATION',_($spnd_action),$key);?></p>
+                                                </div>
+                                            </td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> <?php print _('delete');?></a>
+                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
+                                                    <p class="counter-value"><?php print _('MAIL_ACCOUNT_ACTION_CONFIRMATION',_('delete'),$key);?></p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                </table>
+
+                                <table class="data-col2" width="830px">
+                                    <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key."@".$_GET['domain'] ?></b> <a class="aliases" style="padding: 0 20px 0 4px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
+                                    <tr>
+                                        <td style="vertical-align:top;" >
+                                            <table>
+                                                <tr>
+                                                    <td class="counter-name" style="padding: 4px 0 0 0;">
+                                                        <?php echo $data[$key]['IP'] ?>
+                                                    </td>
+                                                <tr>
+                                                    <td class="chart1" style="padding: 0 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>
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                        <td style="vertical-align:top;" width="200">
+                                            <table>
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        <?php print _('Quota');?>:
+                                                    </td>
+                                                    <td class="counter-value">
+                                                        <?php echo $data[$key]['QUOTA'] ?>
+                                                    </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Autoreply');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['AUTOREPLY'] ?>
+                                                        </td>
+                                                    </tr>
+                                            </table>
+                                        </td>
+                                        <td rowspan=4 style="vertical-align:top;" width="350">
+                                            <table width="350">
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        <?php print _('Forward to');?>:
+                                                    </td>
+                                                    <td class="counter-value" style="padding: 0 0 0 8px;" >
+                                                        <?php echo str_replace(',', ', ', $data[$key]['FWD']) ?> 
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+
+                        <?php
+                            }
+                        ?>
+                    </table>
+                    </form>
+
+                    <table class="data-count">
+                        <tr>
+                            <td width="160px"></td>
+                            <td>
+                                <?php
+                                    if ( $i == 1) {
+                                        echo _('one mail account');
+                                    } else {
+                                        echo _('%s mail accounts',$i);
+                                    }
+                                ?>
+                            </td>
+                        </tr>
+                    </table>
+                </div>

+ 72 - 72
web/templates/admin/list_rrd.html

@@ -1,72 +1,72 @@
-
-                                <table class="sub-menu" style="background: white;">
-                                    <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>
-                                            </div>
-                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                                                </form>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <table class='data'>
-                            <?php
-                                if (empty($_GET['period'])) {
-                                    $period='daily';
-                                } else {
-                                    $period=$_GET['period'];
-                                }
-                                foreach ($data as $key => $value) {
-                            ?>
-
-                            <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" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE']))?></a></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></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="80px"><a href="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>" target="_blank"><img src="/images/download.png" width="8px" height="8px"> <?php print _('download');?></a></td>
-                                        </tr>
-                                    </table>
-                                    <table class="data-col2" width="830px">
-                                        <tr><td colspan=3 class="domain" style="padding: 0 0 4 4;"><b><?php echo $data[$key]['TITLE'] ?></b></td></tr>
-                                        <tr>
-                                            <td style="vertical-align:top;" width="630px">
-                                                <table width="630px">
-                                                    </tr>
-                                                        <td style="background: #7a766d;" width="630px" height="250px">
-                                                            <img style="padding: 0 0 0 30;" src="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>">
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td style="vertical-align:top;">
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-
-                        <?php
-                            }
-                        ?> 
-                    </table>
-                </div>
+
+                                <table class="sub-menu" style="background: white;">
+                                    <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: #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" >
+                                                <input type="text" name="q" style="margin: 2px 2px 0px 0px; width: 250px; padding: 3px;" size="30">
+                                                <input type="submit" value="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                                                </form>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <table class='data'>
+                            <?php
+                                if (empty($_GET['period'])) {
+                                    $period='daily';
+                                } else {
+                                    $period=$_GET['period'];
+                                }
+                                foreach ($data as $key => $value) {
+                            ?>
+
+                            <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" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE']))?></a></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></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="80px"><a href="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>" target="_blank"><img src="/images/download.png" width="8px" height="8px"> <?php print _('download');?></a></td>
+                                        </tr>
+                                    </table>
+                                    <table class="data-col2" width="830px">
+                                        <tr><td colspan=3 class="domain" style="padding: 0 0 4 4;"><b><?php echo $data[$key]['TITLE'] ?></b></td></tr>
+                                        <tr>
+                                            <td style="vertical-align:top;" width="630px">
+                                                <table width="630px">
+                                                    </tr>
+                                                        <td style="background: #7a766d;" width="630px" height="250px">
+                                                            <img style="padding: 0 0 0 30;" src="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>">
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;">
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+
+                        <?php
+                            }
+                        ?> 
+                    </table>
+                </div>

+ 152 - 0
web/templates/admin/list_services.html

@@ -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>

+ 221 - 221
web/templates/admin/list_stats.html

@@ -1,221 +1,221 @@
-
-                                <table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <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>
-                                                <span style="padding: 0 8px;"></span>
-                                                <select style="margin:0 2px 0 0px;" name="user">
-                                                    <option value=''><?php print _('show per user');?></option>
-                                                <?php
-                                                    foreach ($users as $key => $value) {
-                                                        echo "\t\t\t\t<option value=\"".$value."\"";
-                                                        if ((!empty($v_user)) && ( $value == $_GET['user'])){
-                                                            echo ' selected';
-                                                        }
-                                                        echo ">".$value."</option>\n";
-                                                    }
-                                                ?> 
-                                                </select>
-                                                <input type="submit" name="list" value="›" class="button" style="width: 37px;font-size: 12px; height: 24px;">
-                                            </form>
-
-                                            </div>
-                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
-                                                </form>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <table class='data'>
-
-                            <?php
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                            ?>
-
-                            <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" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M 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>
-
-                                    <table class="data-col2" width="830px">
-                                        <tr>
-                                            <td colspan=3 class="username" style="padding: 10 0 0 4px;">
-                                                <b><?php echo date("M Y", strtotime($key))?></b>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <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;">
-                                                            <?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>
-                                                        </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>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td colspan=2>
-                                                            <table class="chart2">
-                                                                <tr>
-                                                                    <td>
-                                                                        <?php print _('Hosting');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
-                                                                        <?php print _('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
-                                                                    </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>
-                                                                </tr>
-                                                            </table>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td style="vertical-align:top;" width="280">
-                                                <table width="280">
-                                                    <tr>
-                                                        <td class="counter-name" width="37%">
-                                                            <?php print _('Web Domains');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_WEB_DOMAINS'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Web SSL Domains');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_WEB_SSL'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Web Aliases');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_WEB_ALIASES'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('DNS domains');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_DNS_DOMAINS'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('DNS records');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_DNS_RECORDS'] ?>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td style="vertical-align:top;" width="250">
-                                                <table class="data-col4" width="250">
-                                                    <tr>
-                                                        <td class="counter-name" width="43%">
-                                                            <?php print _('Mail domains');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_MAIL_DOMAINS'] ?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Mail Accounts');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_MAIL_ACCOUNTS'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Databases');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_DATABASES'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('Cron Jobs');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['U_CRON_JOBS'] ?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            <?php print _('IP Adresses');?>:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['IP_OWNED'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-
-                            <?php
-                                }
-                            ?> 
-
-                        </table>
-
-                        <table class="data-count">
-                            <tr>
-                                <td width="160px"></td>
-                                <td>
-                                    <?php
-                                        if ( $i == 1) {
-                                            echo _('one month');
-                                        } else {
-                                            echo _('%s months',$i);
-                                        }
-                                    ?>
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
-
+
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <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: #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>
+                                                <?php
+                                                    foreach ($users as $key => $value) {
+                                                        echo "\t\t\t\t<option value=\"".$value."\"";
+                                                        if ((!empty($v_user)) && ( $value == $_GET['user'])){
+                                                            echo ' selected';
+                                                        }
+                                                        echo ">".$value."</option>\n";
+                                                    }
+                                                ?> 
+                                                </select>
+                                                <input type="submit" name="list" value="›" class="button" style="width: 37px;font-size: 12px; height: 24px;">
+                                            </form>
+
+                                            </div>
+                                            <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="<?php print _('Search');?>" class="button" style="font-size: 12px; height: 24px;">
+                                                </form>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <table class='data'>
+
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                            ?>
+
+                            <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" title="<?php echo $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M 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>
+
+                                    <table class="data-col2" width="830px">
+                                        <tr>
+                                            <td colspan=3 class="username" style="padding: 10 0 0 4px;">
+                                                <b><?php echo date("M Y", strtotime($key))?></b>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <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;">
+                                                            <?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>
+                                                        </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>
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td colspan=2>
+                                                            <table class="chart2">
+                                                                <tr>
+                                                                    <td>
+                                                                        <?php print _('Hosting');?>: <?php echo humanize_usage($data[$key]['U_DISK_WEB'])?><br>
+                                                                        <?php print _('Mail');?>: <?php echo humanize_usage($data[$key]['U_DISK_MAIL'])?><br>
+                                                                    </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>
+                                                                </tr>
+                                                            </table>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;" width="280">
+                                                <table width="280">
+                                                    <tr>
+                                                        <td class="counter-name" width="37%">
+                                                            <?php print _('Web Domains');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_WEB_DOMAINS'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Web SSL Domains');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_WEB_SSL'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Web Aliases');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_WEB_ALIASES'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('DNS domains');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_DNS_DOMAINS'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('DNS records');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_DNS_RECORDS'] ?>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;" width="250">
+                                                <table class="data-col4" width="250">
+                                                    <tr>
+                                                        <td class="counter-name" width="43%">
+                                                            <?php print _('Mail domains');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_MAIL_DOMAINS'] ?>
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Mail Accounts');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_MAIL_ACCOUNTS'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Databases');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_DATABASES'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('Cron Jobs');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['U_CRON_JOBS'] ?>
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php print _('IP Adresses');?>:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['IP_OWNED'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+
+                            <?php
+                                }
+                            ?> 
+
+                        </table>
+
+                        <table class="data-count">
+                            <tr>
+                                <td width="160px"></td>
+                                <td>
+                                    <?php
+                                        if ( $i == 1) {
+                                            echo _('one month');
+                                        } else {
+                                            echo _('%s months',$i);
+                                        }
+                                    ?>
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+

+ 112 - 112
web/templates/admin/panel.html

@@ -1,112 +1,112 @@
-<center>
-    <table class="main">
-        <tr>
-            <td>
-                <table class="fixed" >
-                    <tr>
-                        <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>
-                                </tr>
-                                <tr>
-                                    <td colspan="7" style="background: #ebe9dc; border-bottom: 8px solid #f7f6ed;">
-
-                                            <span class="nav-logo">
-                                                <img style="margin: 22px 0 0 4px;" src="/images/logo.png">
-                                            </span>
-
-                                        <a class="nav-lnk" href="/list/user/">
-                                            <span class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>header">
-                                                    <?php print _('USER');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('users');?>: <? echo $panel[$user]['U_USERS'] ?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_USERS']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/web/">
-                                            <span class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>header">
-                                                    <?php print _('WEB');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
-                                                    <?php print _('aliases');?>: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_WEB']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/dns/">
-                                            <span class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>header">
-                                                    <?php print _('DNS');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_DNS_DOMAINS']?><br>
-                                                    <?php print _('records');?>: <? echo $panel[$user]['U_DNS_RECORDS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DNS']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/mail/">
-                                            <span class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>header">
-                                                    <?php print _('MAIL');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_MAIL_DOMAINS']?><br>
-                                                    <?php print _('accounts');?>: <? echo $panel[$user]['U_MAIL_ACCOUNTS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_MAIL']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/db/">
-                                            <span class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>header">
-                                                    <?php print _('DB');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('databases');?>: <? echo $panel[$user]['U_DATABASES']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DB']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/cron/">
-                                            <span class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>header">
-                                                    <?php print _('CRON');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('jobs');?>: <? echo $panel[$user]['U_CRON_JOBS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_CRON']?>
-                                                </p>
-                                            </span>
-                                        </a>
-
-                                        <a class="nav-lnk" href="/list/backup/">
-                                            <span class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>header">
-                                                    <?php print _('BACKUP');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('backups');?>: <? echo $panel[$user]['U_BACKUPS']?><br>
-                                                </p>
-                                            </span>
-                                        </a>
-                                    </td>
-                                </tr>
-                            </table>
+<center>
+    <table class="main">
+        <tr>
+            <td>
+                <table class="fixed" >
+                    <tr>
+                        <td>
+                            <table class="top">
+                                <tr>
+                                    <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: #fff;">
+
+                                            <span class="nav-logo">
+                                                <img style="margin: 22px 0 0 4px;" src="/images/logo.png">
+                                            </span>
+
+                                        <a class="nav-lnk" href="/list/user/">
+                                            <span class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>header">
+                                                    <?php print _('USER');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('users');?>: <? echo $panel[$user]['U_USERS'] ?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_USERS']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/web/">
+                                            <span class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>header">
+                                                    <?php print _('WEB');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
+                                                    <?php print _('aliases');?>: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_WEB']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/dns/">
+                                            <span class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>header">
+                                                    <?php print _('DNS');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_DNS_DOMAINS']?><br>
+                                                    <?php print _('records');?>: <? echo $panel[$user]['U_DNS_RECORDS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DNS']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/mail/">
+                                            <span class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>header">
+                                                    <?php print _('MAIL');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_MAIL_DOMAINS']?><br>
+                                                    <?php print _('accounts');?>: <? echo $panel[$user]['U_MAIL_ACCOUNTS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_MAIL']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/db/">
+                                            <span class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>header">
+                                                    <?php print _('DB');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('databases');?>: <? echo $panel[$user]['U_DATABASES']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DB']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/cron/">
+                                            <span class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>header">
+                                                    <?php print _('CRON');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('jobs');?>: <? echo $panel[$user]['U_CRON_JOBS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_CRON']?>
+                                                </p>
+                                            </span>
+                                        </a>
+
+                                        <a class="nav-lnk" href="/list/backup/">
+                                            <span class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>header">
+                                                    <?php print _('BACKUP');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('backups');?>: <? echo $panel[$user]['U_BACKUPS']?><br>
+                                                </p>
+                                            </span>
+                                        </a>
+                                    </td>
+                                </tr>
+                            </table>

+ 1 - 9
web/templates/footer.html

@@ -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>

+ 726 - 718
web/templates/header.html

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

+ 136 - 136
web/templates/user/list_dns.html

@@ -1,136 +1,136 @@
-                                <table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <td style="padding: 12px 0 8px 6px">
-                                            <div style="float:left">
-                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> Add DNS Domain </button>
-                                            </div>
-                                            <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: 26px;">
-                                                <form action="/bulk/dns/" 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>delete</option>
-                                                </select>
-                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <table class="data">
-                            <?php
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                                    if ($data[$key]['SUSPENDED'] == 'yes') {
-                                        $status = 'suspended';
-                                        $spnd_action = 'unsuspend' ;
-                                    } else {
-                                        $status = 'active';
-                                        $spnd_action = 'suspend' ;
-                                    }
-                            ?>
-
-                            <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="108px"><a href="/list/dns/?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> list <?php echo $data[$key]['RECORDS'] ?> records</a></td>
-                                            <td class="data-controls" width="92px"><a href="/add/dns/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> add record</a></td>
-                                            <td class="data-controls" width="50px"><a href="/edit/dns/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
-                                            <td class="data-controls do_delete" width="70px">
-                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
-                                                <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $key ?>" />
-                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
-                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                    <table class="data-col2" width="830px">
-                                        <tr>
-                                            <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
-                                                <b><?php echo $key ?></b>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="vertical-align:top;" >
-                                                <table>
-                                                    <tr>
-                                                        <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'] ?>] template
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td style="vertical-align:top;" width="250">
-                                                <table>
-                                                    <tr>
-                                                        <td class="counter-name">SOA:</td>
-                                                        <td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">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">Expire:</td>
-                                                        <td class="counter-value"><?php echo date("Y M d", strtotime($data[$key]['EXP'])) ?></td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">Records:</td>
-                                                        <td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <?php
-                                }
-                            ?>
-                        </table>
-                        </form>
-
-                        <table class="data-count">
-                            <tr>
-                                <td width="160px"></td>
-                                <td>
-                                    <?php
-                                        if ( $i == 1) {
-                                            echo "1 user dns domain ";
-                                        } else {
-                                            echo "$i dns domains ";
-                                        }
-                                    ?> 
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/'"> Add DNS Domain </button>
+                                            </div>
+                                            <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: 26px;">
+                                                <form action="/bulk/dns/" 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>delete</option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <table class="data">
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                                    if ($data[$key]['SUSPENDED'] == 'yes') {
+                                        $status = 'suspended';
+                                        $spnd_action = 'unsuspend' ;
+                                    } else {
+                                        $status = 'active';
+                                        $spnd_action = 'suspend' ;
+                                    }
+                            ?>
+
+                            <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="108px"><a href="/list/dns/?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> list <?php echo $data[$key]['RECORDS'] ?> records</a></td>
+                                            <td class="data-controls" width="92px"><a href="/add/dns/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> add record</a></td>
+                                            <td class="data-controls" width="50px"><a href="/edit/dns/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
+                                                <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $key ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                    <table class="data-col2" width="830px">
+                                        <tr>
+                                            <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
+                                                <b><?php echo $key ?></b>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td style="vertical-align:top;" >
+                                                <table>
+                                                    <tr>
+                                                        <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'] ?>] template
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;" width="250">
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name">SOA:</td>
+                                                        <td class="counter-value"><?php echo $data[$key]['SOA'] ?></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">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">Expire:</td>
+                                                        <td class="counter-value"><?php echo date("Y M d", strtotime($data[$key]['EXP'])) ?></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">Records:</td>
+                                                        <td class="counter-value"><?php echo $data[$key]['RECORDS'] ?></td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+                            <?php
+                                }
+                            ?>
+                        </table>
+                        </form>
+
+                        <table class="data-count">
+                            <tr>
+                                <td width="160px"></td>
+                                <td>
+                                    <?php
+                                        if ( $i == 1) {
+                                            echo "1 user dns domain ";
+                                        } else {
+                                            echo "$i dns domains ";
+                                        }
+                                    ?> 
+                                </td>
+                            </tr>
+                        </table>
+                    </div>

+ 105 - 105
web/templates/user/list_dns_rec.html

@@ -1,105 +1,105 @@
-<table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <td style="padding: 12px 0 8px 6px">
-                                            <div style="float:left">
-                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> Add DNS Record </button>
-                                            </div>
-                                            <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: 26px;">
-                                                <form action="/bulk/dns/" 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>delete</option>
-                                                </select>
-                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data" style="background: #ebe9dc;">
-                            <tr>
-                                <td style="padding: 8px 2px 8px 0;">
-                                    <a class="name" style="color: #555; font-size: 10pt;"><b>Listing  <?php echo $_GET['domain'] ?></b></a>
-                                </td>
-                            </tr>
-                        </table>
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data">
-                            <?php
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                                    if ($data[$key]['SUSPENDED'] == 'yes') {
-                                        $status = 'suspended';
-                                        $spnd_action = 'unsuspend' ;
-                                    } else {
-                                        $status = 'active';
-                                        $spnd_action = 'suspend' ;
-                                    }
-                            ?>
-
-                            <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="record[]" value="<?php echo $data[$key]['ID']?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="50px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
-                                            <td class="data-controls do_delete" width="70px">
-                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
-                                                <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
-                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
-                                                    <p class="counter-value">Are you sure you want to delete <span style="color: #34536A;"><b><?php echo $data[$key]['RECORD'] ?></b></span> record?</p>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                    <table class="data-col5" width="780px">
-                                        <tr>
-                                            <td class="log" style="padding: 0 0 0 4px;" width="200"><b><?php echo $data[$key]['RECORD'] ?></b></td>
-                                            <td class="log-counter-value" width="80"><?php echo $data[$key]['TYPE'] ?></td>
-                                            <td class="log-counter-value" width="80"><?php echo $data[$key]['PRIORITY'] ?></td>
-                                            <td class="log-counter-value" ><?php echo $data[$key]['VALUE'] ?></td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-                            <?php
-                                }
-                            ?>
-                        </table>
-                        </form>
-
-                        <table class="data-count">
-                            <tr>
-                                <td width="160px">
-                                <td>
-                                    <?php
-                                        if ( $i == 1) {
-                                            echo "1 dns record ";
-                                        } else {
-                                            echo "$i dns records ";
-                                        }
-                                    ?> 
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
+<table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/dns/?domain=<?php echo $_GET['domain'] ?>'"> Add DNS Record </button>
+                                            </div>
+                                            <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: 26px;">
+                                                <form action="/bulk/dns/" 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>delete</option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data" style="background: #ebe9dc;">
+                            <tr>
+                                <td style="padding: 8px 2px 8px 0;">
+                                    <a class="name" style="color: #555; font-size: 10pt;"><b>Listing  <?php echo $_GET['domain'] ?></b></a>
+                                </td>
+                            </tr>
+                        </table>
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data">
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                                    if ($data[$key]['SUSPENDED'] == 'yes') {
+                                        $status = 'suspended';
+                                        $spnd_action = 'unsuspend' ;
+                                    } else {
+                                        $status = 'active';
+                                        $spnd_action = 'suspend' ;
+                                    }
+                            ?>
+
+                            <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="record[]" value="<?php echo $data[$key]['ID']?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="50px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
+                                                <input type="hidden" name="delete_url" value="/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <span style="color: #34536A;"><b><?php echo $data[$key]['RECORD'] ?></b></span> record?</p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                    <table class="data-col5" width="780px">
+                                        <tr>
+                                            <td class="log" style="padding: 0 0 0 4px;" width="200"><b><?php echo $data[$key]['RECORD'] ?></b></td>
+                                            <td class="log-counter-value" width="80"><?php echo $data[$key]['TYPE'] ?></td>
+                                            <td class="log-counter-value" width="80"><?php echo $data[$key]['PRIORITY'] ?></td>
+                                            <td class="log-counter-value" ><?php echo $data[$key]['VALUE'] ?></td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+                            <?php
+                                }
+                            ?>
+                        </table>
+                        </form>
+
+                        <table class="data-count">
+                            <tr>
+                                <td width="160px">
+                                <td>
+                                    <?php
+                                        if ( $i == 1) {
+                                            echo "1 dns record ";
+                                        } else {
+                                            echo "$i dns records ";
+                                        }
+                                    ?> 
+                                </td>
+                            </tr>
+                        </table>
+                    </div>

+ 163 - 163
web/templates/user/list_mail.html

@@ -1,163 +1,163 @@
-<table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <td style="padding: 12px 0 8px 6px">
-                                            <div style="float:left">
-                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> Add Mail Domain </button>
-                                            </div>
-                                            <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: 26px;">
-                                                <form action="/bulk/mail/" 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>delete</option>
-                                                </select>
-                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <table class="data">
-                            <?php
-                                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                                    if ($data[$key]['SUSPENDED'] == 'yes') {
-                                        $status = 'suspended';
-                                        $spnd_action = 'unsuspend' ;
-                                    } else {
-                                        $status = 'active';
-                                        $spnd_action = 'suspend' ;
-                                    }
-                                    if (empty($data[$key]['CATCHALL'])) {
-                                        $data[$key]['CATCHALL'] = '/dev/null';
-                                    }
-                            ?> 
-
-                            <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="112px"><a href="?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> list <?php echo $data[$key]['ACCOUNTS'] ?> accounts</a></td>
-                                            <td class="data-controls" width="98px"><a href="/add/mail/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> add account</a></td>
-                                            <td class="data-controls" width="104px"><a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank"><img src="/images/new_window.png" width="8px" height="8px"> open webmail</a></td>
-                                            <td class="data-controls" width="50px"><a href="/edit/mail/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
-                                            <td class="data-controls do_delete" width="70px">
-                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
-                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $key ?>" />
-                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
-                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                    </table>
-
-                                    <table class="data-col2" width="830px">
-                                        <tr>
-                                            <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
-        	                                <b><?php echo $key ?></b>
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td style="vertical-align:top;" >
-                                                <table>
-                                                    <tr>
-                                                        <td class="counter-name" style="padding: 2px 0 2px 0">
-                                                            catchall > <?php echo $data[$key]['CATCHALL'] ?>
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="chart1">
-                                                            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>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td style="vertical-align:top;" width="250">
-                                                <table>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            Antivirus:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['ANTIVIRUS'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            Antispam:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['ANTISPAM'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                            <td rowspan=4 style="vertical-align:top;" width="300">
-                                                <table>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            DKIM:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['DKIM'] ?> 
-                                                        </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            Accounts:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['ACCOUNTS'] ?>
-                                                        </td>
-                                                    </tr>
-                                                </table>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </td>
-                            </tr>
-
-                            <?php
-                                }
-                            ?>
-                        </table>
-                        </form>
-
-                        <table class="data-count">
-                            <tr>
-                                <td width="160px"></td>
-                                <td>
-                                    <?php
-                                        if ( $i == 1) {
-                                            echo "1 mail domain ";
-                                        } else {
-                                            echo "$i mail domains ";
-                                        }
-                                    ?>
-                                </td>
-                            </tr>
-                        </table>
-                    </div>
+<table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/'"> Add Mail Domain </button>
+                                            </div>
+                                            <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: 26px;">
+                                                <form action="/bulk/mail/" 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>delete</option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <table class="data">
+                            <?php
+                                list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                                    if ($data[$key]['SUSPENDED'] == 'yes') {
+                                        $status = 'suspended';
+                                        $spnd_action = 'unsuspend' ;
+                                    } else {
+                                        $status = 'active';
+                                        $spnd_action = 'suspend' ;
+                                    }
+                                    if (empty($data[$key]['CATCHALL'])) {
+                                        $data[$key]['CATCHALL'] = '/dev/null';
+                                    }
+                            ?> 
+
+                            <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="domain[]" value="<?php echo "$key" ?>" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="112px"><a href="?domain=<?php echo $key ?>"><img src="/images/more.png" width="8px" height="8px"> list <?php echo $data[$key]['ACCOUNTS'] ?> accounts</a></td>
+                                            <td class="data-controls" width="98px"><a href="/add/mail/?domain=<?php echo $key ?>"><img src="/images/add.png" width="8px" height="8px"> add account</a></td>
+                                            <td class="data-controls" width="104px"><a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank"><img src="/images/new_window.png" width="8px" height="8px"> open webmail</a></td>
+                                            <td class="data-controls" width="50px"><a href="/edit/mail/?domain=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
+                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $key ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> domain?</p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    </table>
+
+                                    <table class="data-col2" width="830px">
+                                        <tr>
+                                            <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
+        	                                <b><?php echo $key ?></b>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td style="vertical-align:top;" >
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name" style="padding: 2px 0 2px 0">
+                                                            catchall > <?php echo $data[$key]['CATCHALL'] ?>
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="chart1">
+                                                            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>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;" width="250">
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Antivirus:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['ANTIVIRUS'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Antispam:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['ANTISPAM'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td rowspan=4 style="vertical-align:top;" width="300">
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            DKIM:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['DKIM'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Accounts:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['ACCOUNTS'] ?>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+
+                            <?php
+                                }
+                            ?>
+                        </table>
+                        </form>
+
+                        <table class="data-count">
+                            <tr>
+                                <td width="160px"></td>
+                                <td>
+                                    <?php
+                                        if ( $i == 1) {
+                                            echo "1 mail domain ";
+                                        } else {
+                                            echo "$i mail domains ";
+                                        }
+                                    ?>
+                                </td>
+                            </tr>
+                        </table>
+                    </div>

+ 152 - 152
web/templates/user/list_mail_acc.html

@@ -1,152 +1,152 @@
-<table class="sub-menu" style="background: white;">
-                                    <tr>
-                                        <td style="padding: 12px 0 8px 6px">
-                                            <div style="float:left">
-                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> Add Mail Account </button>
-                                            </div>
-                                            <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: 26px;">
-                                                <form action="/bulk/mail/" 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>delete</option>
-                                                </select>
-                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
-                                            </div>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-
-                    <div id="vstobjects">
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data" style="background: #ebe9dc;">
-                            <tr>
-                                <td style="padding: 8px 2px 8px 0;">
-                                    <a class="name" style="color: #555; font-size: 10pt;"><b>Listing  <?php echo $_GET['domain'] ?></b></a>
-                                </td>
-                            </tr>
-                        </table>
-                        <div style="height:10px; font-size:0;"></div>
-                        <table class="data">
-                            <?php
-                                foreach ($data as $key => $value) {
-                                    ++$i;
-                                    if ($data[$key]['SUSPENDED'] == 'yes') {
-                                        $status = 'suspended';
-                                        $spnd_action = 'unsuspend' ;
-                                    } else {
-                                        $status = 'active';
-                                        $spnd_action = 'suspend';
-                                    }
-                            ?>
-
-                            <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="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
-                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="50px"><a href="/edit/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
-                                            <td class="data-controls do_delete" width="70px">
-                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
-                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
-                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
-                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
-                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo $key ?></b> account?</p>
-                                                </div>
-                                            </td>
-                                        </tr>
-                                </table>
-
-                                <table class="data-col2" width="830px">
-                                    <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key."@".$_GET['domain'] ?></b> <a class="aliases" style="padding: 0 20px 0 4px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
-                                    <tr>
-                                        <td style="vertical-align:top;" >
-                                            <table>
-                                                <tr>
-                                                    <td class="counter-name" style="padding: 4px 0 0 0;">
-                                                        <?php echo $data[$key]['IP'] ?>
-                                                    </td>
-                                                <tr>
-                                                    <td class="chart1" style="padding: 0 0 2px 0">
-                                                        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>
-                                                    </td>
-                                                </tr>
-                                            </table>
-                                        </td>
-                                        <td style="vertical-align:top;" width="200">
-                                            <table>
-                                                <tr>
-                                                    <td class="counter-name">
-                                                        Quota:
-                                                    </td>
-                                                    <td class="counter-value">
-                                                        <?php echo $data[$key]['QUOTA'] ?>
-                                                    </td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="counter-name">
-                                                            Autoreply:
-                                                        </td>
-                                                        <td class="counter-value">
-                                                            <?php echo $data[$key]['AUTOREPLY'] ?>
-                                                        </td>
-                                                    </tr>
-                                            </table>
-                                        </td>
-                                        <td rowspan=4 style="vertical-align:top;" width="350">
-                                            <table width="350">
-                                                <tr>
-                                                    <td class="counter-name">
-                                                        Forward:
-                                                    </td>
-                                                    <td class="counter-value" style="padding: 0 0 0 8px;" >
-                                                        <?php echo str_replace(',', ', ', $data[$key]['FWD']) ?> 
-                                                    </td>
-                                                </tr>
-                                            </table>
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-
-                        <?php
-                            }
-                        ?>
-                    </table>
-                    </form>
-
-                    <table class="data-count">
-                        <tr>
-                            <td width="160px"></td>
-                            <td>
-                                <?php
-                                    if ( $i == 1) {
-                                        echo "1 mail account ";
-                                    } else {
-                                        echo "$i mail accounts ";
-                                    }
-                                ?>
-                            </td>
-                        </tr>
-                    </table>
-                </div>
+<table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/mail/?domain=<?php echo $_GET['domain'] ?>'"> Add Mail Account </button>
+                                            </div>
+                                            <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: 26px;">
+                                                <form action="/bulk/mail/" 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>delete</option>
+                                                </select>
+                                                <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <div id="vstobjects">
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data" style="background: #ebe9dc;">
+                            <tr>
+                                <td style="padding: 8px 2px 8px 0;">
+                                    <a class="name" style="color: #555; font-size: 10pt;"><b>Listing  <?php echo $_GET['domain'] ?></b></a>
+                                </td>
+                            </tr>
+                        </table>
+                        <div style="height:10px; font-size:0;"></div>
+                        <table class="data">
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                                    if ($data[$key]['SUSPENDED'] == 'yes') {
+                                        $status = 'suspended';
+                                        $spnd_action = 'unsuspend' ;
+                                    } else {
+                                        $status = 'active';
+                                        $spnd_action = 'suspend';
+                                    }
+                            ?>
+
+                            <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="account[]" value="<?php echo $key?>" ><input type="hidden" name="domain" value="<?php echo $_GET['domain'] ?>" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-<?php echo $status ?>"><b><?php echo $status ?></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="50px"><a href="/edit/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>"><img src="/images/edit.png" width="8px" height="8px"> edit</a></td>
+                                            <td class="data-controls do_delete" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px" class="do_delete">
+                                                <a id="delete_link_<?php echo $i ?>" class="do_delete"> delete</a>
+                                                <input type="hidden" name="delete_url" value="/delete/mail/?domain=<?php echo $_GET['domain'] ?>&account=<?php echo $key ?>" />
+                                                <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo $key ?></b> account?</p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                </table>
+
+                                <table class="data-col2" width="830px">
+                                    <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key."@".$_GET['domain'] ?></b> <a class="aliases" style="padding: 0 20px 0 4px"><?php echo str_replace(',', ', ', $data[$key]['ALIAS']) ?></a></td></tr>
+                                    <tr>
+                                        <td style="vertical-align:top;" >
+                                            <table>
+                                                <tr>
+                                                    <td class="counter-name" style="padding: 4px 0 0 0;">
+                                                        <?php echo $data[$key]['IP'] ?>
+                                                    </td>
+                                                <tr>
+                                                    <td class="chart1" style="padding: 0 0 2px 0">
+                                                        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>
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                        <td style="vertical-align:top;" width="200">
+                                            <table>
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        Quota:
+                                                    </td>
+                                                    <td class="counter-value">
+                                                        <?php echo $data[$key]['QUOTA'] ?>
+                                                    </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Autoreply:
+                                                        </td>
+                                                        <td class="counter-value">
+                                                            <?php echo $data[$key]['AUTOREPLY'] ?>
+                                                        </td>
+                                                    </tr>
+                                            </table>
+                                        </td>
+                                        <td rowspan=4 style="vertical-align:top;" width="350">
+                                            <table width="350">
+                                                <tr>
+                                                    <td class="counter-name">
+                                                        Forward:
+                                                    </td>
+                                                    <td class="counter-value" style="padding: 0 0 0 8px;" >
+                                                        <?php echo str_replace(',', ', ', $data[$key]['FWD']) ?> 
+                                                    </td>
+                                                </tr>
+                                            </table>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+
+                        <?php
+                            }
+                        ?>
+                    </table>
+                    </form>
+
+                    <table class="data-count">
+                        <tr>
+                            <td width="160px"></td>
+                            <td>
+                                <?php
+                                    if ( $i == 1) {
+                                        echo "1 mail account ";
+                                    } else {
+                                        echo "$i mail accounts ";
+                                    }
+                                ?>
+                            </td>
+                        </tr>
+                    </table>
+                </div>

+ 114 - 113
web/templates/user/panel.html

@@ -1,113 +1,114 @@
-    <center>
-        <table class="main">
-            <tr>
-                <td>
-                    <table class="fixed" >
-                        <tr>
-                            <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>
-                                    </tr>
-                                    <tr>
-                                        <td colspan="7" style="background: #ebe9dc; border-bottom: 8px solid #f7f6ed;">
-
-                                            <span class="nav-logo">
-                                                <img style="margin: 22px 0 0 4px;" src="/images/logo.png">
-                                            </span>
-
-                                            <a class="nav-lnk" href="/list/user/">
-                                            <span class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>header">
-                                                    <?php print _('USER');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('disk');?>: <? echo humanize_usage($panel[$user]['U_DISK']) ?> <br>
-                                                    <?php print _('traffic');?>: <? echo humanize_usage($panel[$user]['U_BANDWIDTH']) ?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/web/">
-                                            <span class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>header">
-                                                    <?php print _('WEB');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
-                                                    <?php print _('aliases');?>: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_WEB']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/dns/">
-                                            <span class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>header">
-                                                    <?php print _('DNS');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_DNS_DOMAINS']?><br>
-                                                    <?php print _('records');?>: <? echo $panel[$user]['U_DNS_RECORDS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DNS']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/mail/">
-                                            <span class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>header">
-                                                    <?php print _('MAIL');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_MAIL_DOMAINS']?><br>
-                                                    <?php print _('accounts');?>: <? echo $panel[$user]['U_MAIL_ACCOUNTS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_MAIL']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/db/">
-                                            <span class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>header">
-                                                    <?php print _('DB');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('databases');?>: <? echo $panel[$user]['U_DATABASES']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DB']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/cron/">
-                                            <span class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>header">
-                                                    <?php print _('CRON');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('jobs');?>: <? echo $panel[$user]['U_CRON_JOBS']?><br>
-                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_CRON']?>
-                                                </p>
-                                            </span>
-                                            </a>
-
-                                            <a class="nav-lnk" href="/list/backup/">
-                                            <span class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>block">
-                                                <p class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>header">
-                                                    <?php print _('BACKUP');?>
-                                                </p>
-                                                <p class="nav-counters" style="decoration: none;">
-                                                    <?php print _('backups');?>: <? echo $panel[$user]['U_BACKUPS']?><br>
-                                                </p>
-                                            </span>
-                                            </a>
-                                        </td>
-                                    </tr>
-                                </table>
+    <center>
+        <table class="main">
+            <tr>
+                <td>
+                    <table class="fixed" >
+                        <tr>
+                            <td>
+                                <table class="top">
+                                    <tr>
+<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: #fff;">
+
+                                            <span class="nav-logo">
+                                                <img style="margin: 22px 0 0 4px;" src="/images/logo.png">
+                                            </span>
+
+                                            <a class="nav-lnk" href="/list/user/">
+                                            <span class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'USER' ) echo 'selected-' ?>header">
+                                                    <?php print _('USER');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('disk');?>: <? echo humanize_usage($panel[$user]['U_DISK']) ?> <br>
+                                                    <?php print _('traffic');?>: <? echo humanize_usage($panel[$user]['U_BANDWIDTH']) ?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/web/">
+                                            <span class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'WEB' ) echo 'selected-' ?>header">
+                                                    <?php print _('WEB');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_WEB_DOMAINS']?><br>
+                                                    <?php print _('aliases');?>: <? echo $panel[$user]['U_WEB_ALIASES']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_WEB']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/dns/">
+                                            <span class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'DNS' ) echo 'selected-' ?>header">
+                                                    <?php print _('DNS');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_DNS_DOMAINS']?><br>
+                                                    <?php print _('records');?>: <? echo $panel[$user]['U_DNS_RECORDS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DNS']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/mail/">
+                                            <span class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'MAIL' ) echo 'selected-' ?>header">
+                                                    <?php print _('MAIL');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('domains');?>: <? echo $panel[$user]['U_MAIL_DOMAINS']?><br>
+                                                    <?php print _('accounts');?>: <? echo $panel[$user]['U_MAIL_ACCOUNTS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_MAIL']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/db/">
+                                            <span class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'DB' ) echo 'selected-' ?>header">
+                                                    <?php print _('DB');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('databases');?>: <? echo $panel[$user]['U_DATABASES']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_DB']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/cron/">
+                                            <span class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'CRON' ) echo 'selected-' ?>header">
+                                                    <?php print _('CRON');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('jobs');?>: <? echo $panel[$user]['U_CRON_JOBS']?><br>
+                                                    <?php print _('suspended');?>: <? echo $panel[$user]['SUSPENDED_CRON']?>
+                                                </p>
+                                            </span>
+                                            </a>
+
+                                            <a class="nav-lnk" href="/list/backup/">
+                                            <span class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>block">
+                                                <p class="nav-<?php if($TAB == 'BACKUP' ) echo 'selected-' ?>header">
+                                                    <?php print _('BACKUP');?>
+                                                </p>
+                                                <p class="nav-counters" style="decoration: none;">
+                                                    <?php print _('backups');?>: <? echo $panel[$user]['U_BACKUPS']?><br>
+                                                </p>
+                                            </span>
+                                            </a>
+                                        </td>
+                                    </tr>
+                                </table>