From 204fbcda4880daba84928373d5dcd67833758017 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:49:08 +0300 Subject: [PATCH 01/84] Shared SSL certificate --- install/ubuntu/dovecot/conf.d/10-ssl.conf | 4 ++-- install/ubuntu/exim4.conf.template | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/ubuntu/dovecot/conf.d/10-ssl.conf b/install/ubuntu/dovecot/conf.d/10-ssl.conf index e1d444239..3aaff6eec 100644 --- a/install/ubuntu/dovecot/conf.d/10-ssl.conf +++ b/install/ubuntu/dovecot/conf.d/10-ssl.conf @@ -1,3 +1,3 @@ ssl = yes -ssl_cert = Date: Sat, 14 Jun 2014 11:50:57 +0300 Subject: [PATCH 02/84] Improved spelling --- install/vst-install-debian.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index e457c3cd5..08189f3aa 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -499,7 +499,7 @@ chown root:mail /usr/local/vesta/ssl/* chmod 660 /usr/local/vesta/ssl/* rm /tmp/vst.pem -# Enable password auth +# Enable SSH password auth sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config service ssh restart @@ -554,9 +554,9 @@ wget $CHOST/$VERSION/apache2-status.conf \ wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf -echo "# Powever by vesta" > /etc/apache2/sites-available/default -echo "# Powever by vestas" > /etc/apache2/sites-available/default-ssl -echo "# Powever by vestas" > /etc/apache2/ports.conf +echo "# Powevered by vesta" > /etc/apache2/sites-available/default +echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powevered by vesta" > /etc/apache2/ports.conf touch /var/log/apache2/access.log touch /var/log/apache2/error.log mkdir -p /var/log/apache2/domains @@ -665,12 +665,6 @@ tar -xzf dovecot-conf.d.tar.gz rm -f dovecot-conf.d.tar.gz chown -R root:root /etc/dovecot gpasswd -a dovecot mail -if [ "$codename" = 'precise' ]; then - dovecot_ssl_conf="/etc/dovecot/conf.d/10-ssl.conf" - echo "ssl = yes" > $dovecot_ssl_conf - echo "ssl_cert = > $dovecot_ssl_conf - echo "ssl_key = > $dovecot_ssl_conf -fi update-rc.d dovecot defaults service dovecot stop > /dev/null 2>&1 service dovecot start @@ -715,6 +709,7 @@ wget $CHOST/$VERSION/apache2-pma.conf -O /etc/phpmyadmin/apache.conf wget $CHOST/$VERSION/pma.conf -O /etc/phpmyadmin/config.inc.php ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf mv -f /etc/phpmyadmin/config-db.php /etc/phpmyadmin/config-db.php_ +chmod 777 /var/lib/phpmyadmin/tmp # Roundcube configuration wget $CHOST/$VERSION/apache2-webmail.conf -O /etc/roundcube/apache.conf @@ -733,7 +728,7 @@ mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql mkdir -p /var/log/roundcube/error chmod -R 777 /var/log/roundcube -# Adding admin user +# Deleting old admin user account if exists if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 userdel -f admin @@ -750,7 +745,7 @@ if [ -z "$vpass" ]; then vpass=$(gen_pass) fi -# Adding vesta account +# Adding admin account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -789,7 +784,7 @@ $VESTA/bin/v-add-dns-domain admin default.domain $vst_ip # Add default mail domain $VESTA/bin/v-add-mail-domain admin default.domain -# Configuring crond +# Configuring cron jobs 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' @@ -805,7 +800,7 @@ $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" -# Build inititall rrd images +# Building inititall rrd images $VESTA/bin/v-update-sys-rrd # Enable file system quota From 2e77a533236bd231064612bd5103b3a827e8aa08 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:51:27 +0300 Subject: [PATCH 03/84] New installer for Ubuntu --- install/vst-install-ubuntu.sh | 249 ++++++++++++++++++++-------------- 1 file changed, 146 insertions(+), 103 deletions(-) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index b4e718585..65bcac2ad 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Vesta Ubuntu installer v.01 +# Vesta Ubuntu installer v.04 #----------------------------------------------------------# # Variables&Functions # @@ -14,17 +14,21 @@ software="nginx apache2 apache2-utils apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql php5-curl libapache2-mod-php5 vsftpd mc exim4 exim4-daemon-heavy - clamav-daemon flex dovecot-imapd dovecot-pop3d phpMyAdmin awstats - webalizer jwhois rssh git spamassassin roundcube roundcube-mysql + clamav-daemon flex dovecot-imapd dovecot-pop3d phpMyAdmin awstats e2fslibs + webalizer jwhois rssh git spamassassin roundcube roundcube-mysql quota roundcube-plugins apparmor-utils sudo bc ftp lsof ntpdate rrdtool dnsutils vesta vesta-nginx vesta-php" help() { echo "usage: $0 [OPTIONS] - -e, --email Define email address - -h, --help Print this help and exit + -e, --email Set email address -f, --force Force installation - -n, --noupdate Do not run apt-get upgrade command" + -h, --help Print this help and exit + -n, --noupdate Do not run yum update command + -m, --mysql-password Set MySQL password instead of generating it + -p, --password Set admin password instead of generating it + -s, --hostname Set server hostname + -q, --quota Enable File System Quota" exit 1 } @@ -48,10 +52,14 @@ gen_pass() { for arg; do delim="" case "$arg" in - --help) args="${args}-h " ;; - --force) args="${args}-f " ;; - --email) args="${args}-e " ;; - --noupdate) args="${args}-n " ;; + --email) args="${args}-e " ;; + --force) args="${args}-f " ;; + --help) args="${args}-h " ;; + --noupdate) args="${args}-n " ;; + --mysql-password) args="${args}-m " ;; + --password) args="${args}-p " ;; + --hostname) args="${args}-s " ;; + --quota) args="${args}-q " ;; *) [[ "${arg:0:1}" == "-" ]] || delim="\"" args="${args}${delim}${arg}${delim} ";; esac @@ -59,12 +67,16 @@ done eval set -- "$args" # Getopt -while getopts "dhfne:" Option; do +while getopts "dhfnqe:m:p:s:" Option; do case $Option in h) help ;; # Help e) email=$OPTARG ;; # Set email - f) force='yes' ;; # Force apt-get install - n) noupdate='yes' ;; # Disable apt-get upgrade + f) force='yes' ;; # Force install + n) noupdate='yes' ;; # Disable yum update + m) mpass=$OPTARG ;; # MySQL pasword + p) vpass=$OPTARG ;; # Admin password + s) servername=$OPTARG ;; # Server hostname + q) quota='yes' ;; # Enable quota *) help ;; # Default esac done @@ -89,9 +101,9 @@ else fi os=$(head -n 1 /etc/issue | cut -f 1 -d ' ') release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' ) -codename=$(lsb_release -cs | grep "[precise|raring|saucy]") +codename=$(lsb_release -cs | egrep "precise|quantal|raring|saucy|trusty") if [ -z "$codename" ]; then - echo 'Error: only Ubuntu 12.04, 13.04 and 13.10 is supported' + echo "Error: Ubuntu $(lsb_release -r|awk '{print $2}') is not supported" exit 1 fi @@ -214,6 +226,14 @@ if [ -z $email ]; then # Check email read -p 'Please enter valid email address: ' email + + # Define server hostname + if [ -z "$servername" ]; then + read -p "Please enter hostname [$(hostname)]: " servername + fi + if [ -z "$servername" ]; then + servername=$(hostname) + fi fi # Validate email @@ -252,9 +272,6 @@ apt=/etc/apt/sources.list.d echo "deb http://nginx.org/packages/ubuntu/ $codename nginx" > $apt/nginx.list wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key apt-key add /tmp/nginx_signing.key -if [ $codename = 'trusty' ]; then - sed -i "s/trusty/saucy/g" $apt/nginx.list -fi # Install vesta repo echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list @@ -400,7 +417,91 @@ rm -f /usr/sbin/policy-rc.d # Set writable permission on tmp directory chmod 777 /tmp -# Enable password auth +# Vesta configuration +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 +wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta + +# Directory tree +mkdir -p $VESTA/conf +mkdir -p $VESTA/log +mkdir -p $VESTA/ssl +mkdir -p $VESTA/data +mkdir -p $VESTA/data/ips +mkdir -p $VESTA/data/queue +mkdir -p $VESTA/data/users +touch $VESTA/data/queue/backup.pipe +touch $VESTA/data/queue/disk.pipe +touch $VESTA/data/queue/webstats.pipe +touch $VESTA/data/queue/restart.pipe +touch $VESTA/data/queue/traffic.pipe +chmod 750 $VESTA/conf +chmod 750 $VESTA/data/users +chmod 750 $VESTA/data/ips +chmod -R 750 $VESTA/data/queue +ln -s /usr/local/vesta/log /var/log/vesta +touch /var/log/vesta/system.log +touch /var/log/vesta/nginx-error.log +touch /var/log/vesta/auth.log +chmod 660 /var/log/vesta/* +adduser backup > /dev/null 2>&1 +mkdir -p /home/backup +chown backup:backup /home/backup +ln -s /home/backup /backup +chmod a+x /backup + +# vesta.conf +wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf + sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf +fi + +# Set server hostname +/usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null + +# Templates +cd /usr/local/vesta/data +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 +if [ "$codename" = 'saucy' ] || [ "$codename" = 'trusty' ]; then + sed -i "s/Include /IncludeOptional /g" \ + $VESTA/data/templates/web/apache2/*tpl +fi +chmod -R 755 /usr/local/vesta/data/templates +cp templates/web/skel/public_html/index.html /var/www/ +sed -i 's/%domain%/It worked!/g' /var/www/index.html +if [ "$srv_type" = 'micro' ]; then + rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* +fi + +# Generating SSL certificate +$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \ + 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem + +# Parsing merged certificate file +crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:) +key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:) +key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:) + +# Adding SSL certificate +cd /usr/local/vesta/ssl +sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt +sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key +chown root:mail /usr/local/vesta/ssl/* +chmod 660 /usr/local/vesta/ssl/* +rm /tmp/vst.pem + +# Enable SSH password auth sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config service ssh restart @@ -456,9 +557,9 @@ fi wget $CHOST/$VERSION/apache2-status.conf \ -O /etc/apache2/mods-enabled/status.conf wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 -echo "# Powever by vesta" > /etc/apache2/sites-available/default -echo "# Powever by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powever by vesta" > /etc/apache2/ports.conf +echo "# Powevered by vesta" > /etc/apache2/sites-available/default +echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powevered by vesta" > /etc/apache2/ports.conf mkdir -p /etc/apache2/conf.d rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf @@ -491,6 +592,11 @@ if [ "$?" -ne 0 ]; then exit 1 fi +# Generating MySQL password if it wasn't set +if [ -z "$mpass" ]; then + mpass=$(gen_pass) +fi + # MySQL configuration mpass=$(gen_pass) wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf @@ -506,7 +612,7 @@ mysqladmin -u root password $mpass echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf chmod 600 /root/.my.cnf mysql -e "DELETE FROM mysql.user WHERE User=''" -mysql -e "DROP DATABASE test" +mysql -e "DROP DATABASE test" > /dev/null 2>&1 mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" mysql -e "DELETE FROM mysql.user WHERE user='' or password='';" mysql -e "FLUSH PRIVILEGES" @@ -564,12 +670,6 @@ tar -xzf dovecot-conf.d.tar.gz rm -f dovecot-conf.d.tar.gz chown -R root:root /etc/dovecot gpasswd -a dovecot mail -if [ "$codename" = 'precise' ]; then - dovecot_ssl_conf="/etc/dovecot/conf.d/10-ssl.conf" - echo "ssl = yes" > $dovecot_ssl_conf - echo "ssl_cert = > $dovecot_ssl_conf - echo "ssl_key = > $dovecot_ssl_conf -fi update-rc.d dovecot defaults service dovecot stop > /dev/null 2>&1 service dovecot start @@ -630,7 +730,8 @@ wget $CHOST/$VERSION/roundcube-driver.php -O \ wget $CHOST/$VERSION/roundcube-pw.conf -O \ /etc/roundcube/plugins/password/config.inc.php r="$(gen_pass)" -mysql -e "CREATE DATABASE roundcube" +mysql -e "DROP DATABASE roundcube" > /dev/null 2>&1 +mysql -e "CREATE DATABASE roundcube" mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql @@ -643,76 +744,7 @@ fi mkdir -p /var/log/roundcube/error chmod -R 777 /var/log/roundcube -# Vesta configuration -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 -wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta - -# Directory tree -mkdir -p $VESTA/conf -mkdir -p $VESTA/log -mkdir -p $VESTA/ssl -mkdir -p $VESTA/data -mkdir -p $VESTA/data/ips -mkdir -p $VESTA/data/queue -mkdir -p $VESTA/data/users -touch $VESTA/data/queue/backup.pipe -touch $VESTA/data/queue/disk.pipe -touch $VESTA/data/queue/webstats.pipe -touch $VESTA/data/queue/restart.pipe -touch $VESTA/data/queue/traffic.pipe -chmod 750 $VESTA/conf -chmod 750 $VESTA/data/users -chmod 750 $VESTA/data/ips -chmod -R 750 $VESTA/data/queue -ln -s /usr/local/vesta/log /var/log/vesta -touch /var/log/vesta/system.log -touch /var/log/vesta/nginx-error.log -touch /var/log/vesta/auth.log -chmod 660 /var/log/vesta/* -adduser backup > /dev/null 2>&1 -mkdir -p /home/backup -chown backup:backup /home/backup -ln -s /home/backup /backup -chmod a+x /backup - -# vesta.conf -wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf - sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf -fi - -# Templates -cd /usr/local/vesta/data -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 -if [ "$codename" = 'saucy' ] || [ "$codename" = 'trusty' ]; then - sed -i "s/Include /IncludeOptional /g" \ - $VESTA/data/templates/web/apache2/*tpl -fi -chmod -R 755 /usr/local/vesta/data/templates -cp templates/web/skel/public_html/index.html /var/www/ -sed -i 's/%domain%/It worked!/g' /var/www/index.html -if [ "$srv_type" = 'micro' ]; then - rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* -fi - -# Default 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 +# Deleting old admin user account if exists if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 userdel -f admin @@ -723,7 +755,13 @@ fi if [ ! -z "$(grep ^admin: /etc/group)" ]; then groupdel admin > /dev/null 2>&1 fi -vpass=$(gen_pass) + +# Generating admin password if it wasn't set +if [ -z "$vpass" ]; then + vpass=$(gen_pass) +fi + +# Adding admin account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -762,7 +800,7 @@ $VESTA/bin/v-add-dns-domain admin default.domain $vst_ip # Add default mail domain $VESTA/bin/v-add-mail-domain admin default.domain -# Configuring crond +# Configuring cron jobs 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' @@ -778,9 +816,14 @@ $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" -# Build inititall rrd images +# Building inititall rrd images $VESTA/bin/v-update-sys-rrd +# Enable file system quota +if [ "$quota" = 'yes' ]; then + $VESTA/bin/v-add-sys-quota +fi + # Start system service update-rc.d vesta defaults service vesta stop > /dev/null 2>&1 From 23b28a73d8d686e10eac21fc13bc574e6a5c49db Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:52:47 +0300 Subject: [PATCH 04/84] RRD graph for Exim --- bin/v-list-sys-rrd | 11 +++-- bin/v-update-sys-rrd | 5 ++ bin/v-update-sys-rrd-mail | 96 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 4 deletions(-) create mode 100755 bin/v-update-sys-rrd-mail diff --git a/bin/v-list-sys-rrd b/bin/v-list-sys-rrd index 49b0b2e78..2dc026b91 100755 --- a/bin/v-list-sys-rrd +++ b/bin/v-list-sys-rrd @@ -37,6 +37,9 @@ json_list_rrd() { [ "$type" = 'ssh' ]; then title="$(echo $rrd| tr '[:lower:]' '[:upper:]') Usage" fi + if [ "$type" = 'mail' ]; then + title="Exim Usage" + fi if [ "$type" = 'db' ]; then db_type=$(echo $rrd|cut -f 1 -d _ |sed -e 's/mysql/MySQL/g' \ -e 's/pgsql/PostgreSQL/g' ) @@ -84,14 +87,14 @@ if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then rrd_types="$rrd_types web" fi +if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then + rrd_types="$rrd_types mail" +fi + if [ -n "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then rrd_types="$rrd_types db" fi -#if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then -# rrd_types="$rrd_types mail" -#fi - if [ -n "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then rrd_types="$rrd_types ftp" fi diff --git a/bin/v-update-sys-rrd b/bin/v-update-sys-rrd index 6420f6079..81cc6d64e 100755 --- a/bin/v-update-sys-rrd +++ b/bin/v-update-sys-rrd @@ -110,6 +110,11 @@ for period in $periods; do $BIN/v-update-sys-rrd-$PROXY_SYSTEM $period >/dev/null 2>&1 fi + # Updating mail stats + if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then + $BIN/v-update-sys-rrd-mail $period >/dev/null 2>&1 + fi + # Updating ftp stats if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then $BIN/v-update-sys-rrd-ftp $period >/dev/null 2>&1 diff --git a/bin/v-update-sys-rrd-mail b/bin/v-update-sys-rrd-mail new file mode 100755 index 000000000..1f01b52d3 --- /dev/null +++ b/bin/v-update-sys-rrd-mail @@ -0,0 +1,96 @@ +#!/bin/bash +# info: update mail rrd +# options: PERIOD +# +# The function is for updating mail rrd database and graphic. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +period=${1-daily} + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Switching on time period +case $period in + daily) start='-1d'; end='now'; grid='MINUTE:30:HOUR:1:HOUR:4:0:%H:%M';; + weekly) start='-7d'; end='now'; grid='HOUR:8:DAY:1:DAY:1:0:%a %d';; + monthly) start='-1m'; end='now'; grid='WEEK:1:WEEK:1:WEEK:1:0:%b %d';; + yearly) start='-1y'; end='now'; grid='MONTH:1:YEAR:1:MONTH:2:2419200:%b';; + *) exit $E_RRD ;; +esac + +# Checking directory +if [ ! -d "$RRD/mail" ]; then + mkdir $RRD/mail +fi + +# Checking database +if [ ! -e "$RRD/mail/mail.rrd" ]; then + # Adding database + rrdtool create $RRD/mail/mail.rrd --step $RRD_STEP \ + DS:A:GAUGE:600:U:U \ + RRA:AVERAGE:0.5:1:600 \ + RRA:AVERAGE:0.5:6:700 \ + RRA:AVERAGE:0.5:24:775 \ + RRA:AVERAGE:0.5:288:797 \ + RRA:MAX:0.5:1:600 \ + RRA:MAX:0.5:6:700 \ + RRA:MAX:0.5:24:775 \ + RRA:MAX:0.5:288:797 +fi + +# Parsing data +if [ "$period" = 'daily' ]; then + a=0 + a=$(exim -bpc) + + # Updating rrd database + rrdtool update $RRD/mail/mail.rrd N:$a +fi + +# Updating daily graph +rrdtool graph $RRD/mail/$period-mail.png \ + --imgformat PNG \ + --height="120" \ + --width="440" \ + --start "$start" \ + --end "$end" \ + --vertical-label "Queue Size" \ + --x-grid "$grid" \ + -c "BACK#7a766d" \ + -c "SHADEA#7a766d" \ + -c "SHADEB#7a766d" \ + -c "FONT#FFFFFF" \ + -c "CANVAS#302c2d" \ + -c "GRID#666666" \ + -c "MGRID#AAAAAA" \ + -c "FRAME#302c2d" \ + -c "ARROW#FFFFFF" \ + DEF:a=$RRD/mail/mail.rrd:A:AVERAGE \ + COMMENT:'\r' \ + LINE1:a#fefda0:"Emails " \ + GPRINT:a:'LAST:Current\:''%8.0lf' \ + GPRINT:a:'MIN:Min\:''%8.0lf' \ + GPRINT:a:'MAX:Max\:''%8.0lf\j' &>/dev/null; result=$? + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +if [ "$result" -ne 0 ]; then + exit $E_RRD +fi + +exit From b5acf1f2b2a80ec41d8d64c061104997b023b4fc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:54:01 +0300 Subject: [PATCH 05/84] Added back button and imporved html layout --- web/templates/login.html | 15 ++++++++++----- web/templates/reset_1.html | 11 ++++++----- web/templates/reset_2.html | 11 ++++++----- web/templates/reset_3.html | 19 ++++++++----------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/web/templates/login.html b/web/templates/login.html index df6eb4261..d6c838bcc 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -22,7 +22,12 @@ - + + + + + + @@ -45,10 +50,10 @@ - - - - + diff --git a/web/templates/reset_1.html b/web/templates/reset_1.html index cdc3a71eb..291ecba83 100644 --- a/web/templates/reset_1.html +++ b/web/templates/reset_1.html @@ -8,7 +8,7 @@ Vesta Control Panel -
+ @@ -36,10 +37,10 @@ - - - - + diff --git a/web/templates/reset_2.html b/web/templates/reset_2.html index 8658078ee..917bb0ff1 100644 --- a/web/templates/reset_2.html +++ b/web/templates/reset_2.html @@ -16,7 +16,7 @@ - + @@ -28,6 +28,7 @@ + @@ -36,10 +37,10 @@ - - - - + diff --git a/web/templates/reset_3.html b/web/templates/reset_3.html index 396f55f41..fdd0192ea 100644 --- a/web/templates/reset_3.html +++ b/web/templates/reset_3.html @@ -4,10 +4,10 @@ - -
+ Vesta Control Panel + @@ -34,12 +34,9 @@ - - - - @@ -48,10 +45,10 @@
- - - - +
From 3b5f5f738b2439d14a494231bfdcfcdf5d12ed0c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:54:46 +0300 Subject: [PATCH 06/84] little bit more contrast background --- web/css/main.css | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/web/css/main.css b/web/css/main.css index cfa86d9b1..331b58592 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1,6 +1,7 @@ body { font-family: Arial, Helvetica, sans-serif; background-color: #e5e5e5; + background-color: #e1e8e8; margin: 0; padding: 0; border: 0; @@ -52,7 +53,7 @@ td { } .top-link:active{ - color: #2361a1; + color: #333; background-color: #f1f1f1; } @@ -65,7 +66,7 @@ td { line-height: 22px; padding: 0 20px 2px; color: #333; - background-color: #f1f1f1; + background-color: #e2e2e2; } .top-selected-link:hover { @@ -195,6 +196,7 @@ td { height: 58px; line-height: 1.4em; font-size: 9pt; + font-family: Arial, Helvetica, sans-serif; color: #333; decoration: none; } @@ -838,12 +840,12 @@ td { } .generate:hover { - color: #7fa1cb; + background-color: #f79b44; + color: #fff; } .generate:active { - background-color: #f79b44; - color: #fff; + background-color: #999; } .vst-advanced { @@ -903,19 +905,18 @@ td { } .login-bottom { - color: #ebe9dc; text-align: right; vertical-align:top; - width: 500px; + width: 474px; height: 50px; margin: 0; + padding: 0 26px 0 0; } .vestacp{ font-size: 8pt; - color: #222; + color: #505050; text-align: right; - padding: 0 8px 0 0; } .error { From 18879e39907c146d9f5142deac56c0bfd1bcbc83 Mon Sep 17 00:00:00 2001 From: jlamer Date: Sun, 15 Jun 2014 16:03:25 +0200 Subject: [PATCH 07/84] Update vst-install-debian.sh Fixed few spelling problems ... --- install/vst-install-debian.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 08189f3aa..8dd53c611 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not run yum update command + -n, --noupdate Do not apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname @@ -72,7 +72,7 @@ while getopts "dhfnqe:m:p:s:" Option; do h) help ;; # Help e) email=$OPTARG ;; # Set email f) force='yes' ;; # Force install - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade m) mpass=$OPTARG ;; # MySQL pasword p) vpass=$OPTARG ;; # Admin password s) servername=$OPTARG ;; # Server hostname @@ -89,7 +89,7 @@ fi # Check supported version if [ -e '/etc/redhat-release' ] || [ -e '/etc/lsb-release' ]; then - echo 'Error: sorry, this installer can work only on Debian 7' + echo 'Error: sorry, this installer works only on Debian 7' exit 1 fi @@ -554,9 +554,9 @@ wget $CHOST/$VERSION/apache2-status.conf \ wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf -echo "# Powevered by vesta" > /etc/apache2/sites-available/default -echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powevered by vesta" > /etc/apache2/ports.conf +echo "# Powered by vesta" > /etc/apache2/sites-available/default +echo "# Powered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powered by vesta" > /etc/apache2/ports.conf touch /var/log/apache2/access.log touch /var/log/apache2/error.log mkdir -p /var/log/apache2/domains From 1a009ce84e37db4ce7e1e144cc448b23dd9b5353 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:26:49 +0300 Subject: [PATCH 08/84] a couple spelling errors --- install/vst-install-debian.sh | 2 +- install/vst-install-ubuntu.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 8dd53c611..f3a7eacd4 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not apt-get upgrade command + -n, --noupdate Do not run apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 65bcac2ad..b40d4f8d9 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not run yum update command + -n, --noupdate Do not run apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname @@ -72,7 +72,7 @@ while getopts "dhfnqe:m:p:s:" Option; do h) help ;; # Help e) email=$OPTARG ;; # Set email f) force='yes' ;; # Force install - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade m) mpass=$OPTARG ;; # MySQL pasword p) vpass=$OPTARG ;; # Admin password s) servername=$OPTARG ;; # Server hostname @@ -89,7 +89,7 @@ fi # Check supported version if [ -e '/etc/redhat-release' ]; then - echo 'Error: sorry, this installer can work only on Debian or Ubuntu' + echo 'Error: sorry, this installer works only on Ubuntu' exit 1 fi @@ -557,9 +557,9 @@ fi wget $CHOST/$VERSION/apache2-status.conf \ -O /etc/apache2/mods-enabled/status.conf wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 -echo "# Powevered by vesta" > /etc/apache2/sites-available/default -echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powevered by vesta" > /etc/apache2/ports.conf +echo "# Powered by vesta" > /etc/apache2/sites-available/default +echo "# Powered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powered by vesta" > /etc/apache2/ports.conf mkdir -p /etc/apache2/conf.d rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf From b9dd6f4b73be3a7245957eef4cd45dc3f086ab01 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:28:13 +0300 Subject: [PATCH 09/84] data-count div instead of table --- web/css/main.css | 32 +++++++++---------- web/templates/admin/list_backup.html | 24 ++++++-------- web/templates/admin/list_backup_detail.html | 1 - .../admin/list_backup_exclusions.html | 12 ++----- web/templates/admin/list_cron.html | 24 ++++++-------- web/templates/admin/list_db.html | 23 ++++++------- web/templates/admin/list_dns.html | 23 ++++++------- web/templates/admin/list_dns_rec.html | 24 ++++++-------- web/templates/admin/list_ip.html | 23 ++++++------- web/templates/admin/list_log.html | 23 ++++++------- web/templates/admin/list_mail.html | 23 ++++++------- web/templates/admin/list_mail_acc.html | 23 ++++++------- web/templates/admin/list_packages.html | 23 ++++++------- web/templates/admin/list_rrd.html | 2 +- web/templates/admin/list_search.html | 23 ++++++------- web/templates/admin/list_stats.html | 24 ++++++-------- web/templates/admin/list_user.html | 23 ++++++------- web/templates/admin/list_web.html | 23 ++++++------- web/templates/user/list_cron.html | 24 ++++++-------- web/templates/user/list_db.html | 23 ++++++------- web/templates/user/list_dns.html | 23 ++++++------- web/templates/user/list_dns_rec.html | 25 ++++++--------- web/templates/user/list_mail.html | 24 ++++++-------- web/templates/user/list_mail_acc.html | 23 ++++++------- web/templates/user/list_search.html | 23 ++++++------- web/templates/user/list_stats.html | 24 ++++++-------- web/templates/user/list_user.html | 23 ++++++------- web/templates/user/list_web.html | 23 ++++++------- 28 files changed, 237 insertions(+), 371 deletions(-) diff --git a/web/css/main.css b/web/css/main.css index 331b58592..b2a114e83 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1,6 +1,5 @@ body { font-family: Arial, Helvetica, sans-serif; - background-color: #e5e5e5; background-color: #e1e8e8; margin: 0; padding: 0; @@ -28,7 +27,7 @@ td { .top { width: 1000px; position: fixed; background: #fff; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .top-menu { @@ -66,7 +65,7 @@ td { line-height: 22px; padding: 0 20px 2px; color: #333; - background-color: #e2e2e2; + background-color: #f0f0f0; } .top-selected-link:hover { @@ -126,7 +125,7 @@ td { height: 111px; width: 167px; margin: 0; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .nav-lnk { @@ -146,7 +145,7 @@ td { width: 119px; float:left; cursor: pointer; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .nav-block:hover { @@ -320,13 +319,13 @@ td { } .submenu-select-link:hover { - text-decoration: underline; + color: #fff; + background-color: #f79b44; } .submenu-select-link:active { color: #fff; - background-color: #f79b44; - text-decoration: underline; + background-color: #777; } .submenu-select-dropdown { @@ -460,7 +459,7 @@ td { .data-row:hover { margin: 0; - background-color: #f7f6ed; + background-color: #f0f0f0; } .data-row:active { @@ -573,11 +572,9 @@ td { .data-count { font-family: Arial, Helvetica, sans-serif; - background-color: #f3f3f3; - color: #555; + color: #505050; font-size: 8pt; - margin: 18px 0 0 0; - padding: 0 16px 0 0; + padding: 20px 0 20px 174px; } .chart1 { @@ -635,7 +632,7 @@ td { .counter-name { white-space: nowrap; vertical-align:top; - line-height: 1.3em; + line-height: 1.2em; font-size: 10pt; color: #222; padding: 2px 4px 1px 0; @@ -651,7 +648,7 @@ td { .counter-value { vertical-align:top; - line-height: 1.3em; + line-height: 1.2em; font-size: 10pt; color: #222; padding: 2px 0 1px 2px; @@ -858,12 +855,13 @@ td { } .vst-advanced:hover { - color: #7fa1cb; + color: #fff; + background-color: #f79b44; } .vst-advanced:active { color: #fff; - background-color: #f79b44; + background-color: #777; } .fixed{ diff --git a/web/templates/admin/list_backup.html b/web/templates/admin/list_backup.html index 837c5b81c..3fb26ed11 100644 --- a/web/templates/admin/list_backup.html +++ b/web/templates/admin/list_backup.html @@ -135,19 +135,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_backup_detail.html b/web/templates/admin/list_backup_detail.html index a33709886..51dad6dc5 100644 --- a/web/templates/admin/list_backup_detail.html +++ b/web/templates/admin/list_backup_detail.html @@ -264,4 +264,3 @@ - diff --git a/web/templates/admin/list_backup_exclusions.html b/web/templates/admin/list_backup_exclusions.html index a0da3ce53..f78b20ee5 100644 --- a/web/templates/admin/list_backup_exclusions.html +++ b/web/templates/admin/list_backup_exclusions.html @@ -81,13 +81,7 @@ - - - - - -
- ... -
+
+ ... +
- diff --git a/web/templates/admin/list_cron.html b/web/templates/admin/list_cron.html index e52dd9cb7..aa58a26b0 100644 --- a/web/templates/admin/list_cron.html +++ b/web/templates/admin/list_cron.html @@ -138,19 +138,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index 4ca3dbf04..7d541a81a 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -159,18 +159,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index 52e6cbeb1..c8091cbca 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -144,18 +144,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index 29e3554ab..e8ebff34b 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -88,19 +88,13 @@ ?> - - - - - -
- - -
+
+ +
diff --git a/web/templates/admin/list_ip.html b/web/templates/admin/list_ip.html index bdd38396a..730e79533 100644 --- a/web/templates/admin/list_ip.html +++ b/web/templates/admin/list_ip.html @@ -135,18 +135,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_log.html b/web/templates/admin/list_log.html index f3a616403..b8771006c 100644 --- a/web/templates/admin/list_log.html +++ b/web/templates/admin/list_log.html @@ -46,18 +46,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index b92729552..1850c5239 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -170,18 +170,13 @@ ?> - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index f7de2b12a..7281384a1 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -142,18 +142,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_packages.html b/web/templates/admin/list_packages.html index 92ebb3333..7b15ea3be 100644 --- a/web/templates/admin/list_packages.html +++ b/web/templates/admin/list_packages.html @@ -159,18 +159,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_rrd.html b/web/templates/admin/list_rrd.html index 3910ffa02..f6eac4b2a 100644 --- a/web/templates/admin/list_rrd.html +++ b/web/templates/admin/list_rrd.html @@ -67,4 +67,4 @@ } ?> - \ No newline at end of file + diff --git a/web/templates/admin/list_search.html b/web/templates/admin/list_search.html index f6e51cdd3..a18044292 100644 --- a/web/templates/admin/list_search.html +++ b/web/templates/admin/list_search.html @@ -193,18 +193,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_stats.html b/web/templates/admin/list_stats.html index 69658f152..ff8f8cf28 100644 --- a/web/templates/admin/list_stats.html +++ b/web/templates/admin/list_stats.html @@ -194,19 +194,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_user.html b/web/templates/admin/list_user.html index efa6201cf..3615c3ead 100644 --- a/web/templates/admin/list_user.html +++ b/web/templates/admin/list_user.html @@ -249,18 +249,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 30ba742f2..5d65c2ed7 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -209,18 +209,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/user/list_cron.html b/web/templates/user/list_cron.html index 48497801e..067df3d8b 100644 --- a/web/templates/user/list_cron.html +++ b/web/templates/user/list_cron.html @@ -126,19 +126,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/user/list_db.html b/web/templates/user/list_db.html index 626b394a3..f94ffb9e9 100644 --- a/web/templates/user/list_db.html +++ b/web/templates/user/list_db.html @@ -147,18 +147,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_dns.html b/web/templates/user/list_dns.html index 12c3f5547..a1544aee9 100644 --- a/web/templates/user/list_dns.html +++ b/web/templates/user/list_dns.html @@ -132,18 +132,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 227dd233f..933b0a6e3 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -86,19 +86,14 @@ ?> - - - - - -
- - -
+ +
+ +
diff --git a/web/templates/user/list_mail.html b/web/templates/user/list_mail.html index 75ce9a08d..6491339d4 100644 --- a/web/templates/user/list_mail.html +++ b/web/templates/user/list_mail.html @@ -158,18 +158,14 @@ ?> - - - - - -
- -
+ +
+ +
diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html index 8120d6ab2..f661b5854 100644 --- a/web/templates/user/list_mail_acc.html +++ b/web/templates/user/list_mail_acc.html @@ -130,18 +130,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_search.html b/web/templates/user/list_search.html index 414f6b306..373eb5c96 100644 --- a/web/templates/user/list_search.html +++ b/web/templates/user/list_search.html @@ -170,18 +170,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_stats.html b/web/templates/user/list_stats.html index 33d805598..cb6553677 100644 --- a/web/templates/user/list_stats.html +++ b/web/templates/user/list_stats.html @@ -179,19 +179,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/user/list_user.html b/web/templates/user/list_user.html index 15af6372b..9f122f8ef 100644 --- a/web/templates/user/list_user.html +++ b/web/templates/user/list_user.html @@ -174,18 +174,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/user/list_web.html b/web/templates/user/list_web.html index 27bac6504..2fd60dec7 100644 --- a/web/templates/user/list_web.html +++ b/web/templates/user/list_web.html @@ -197,18 +197,13 @@ - - - - -
- - -
+
+ +
From 3b7eee439360e5ff560a5612b1f8b6bd77b14011 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:28:33 +0300 Subject: [PATCH 10/84] Fixed NameServer validation bug --- func/domain.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index 1bf1cde8a..fc10c38da 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -491,9 +491,9 @@ is_dns_nameserver_valid() { if [ ! -z "$remote" ]; then zone=$USER_DATA/dns/$d.conf a_record=$(echo $r |cut -f 1 -d '.') - record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'") - if [ -z "$record" ]; then - echo "Error: corresponding A record $a_record.$d is not exist" + n_record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'") + if [ -z "$n_record" ]; then + echo "Error: corresponding A record $a_record.$d does not exist" log_event "$E_NOTEXIST" "$EVENT" exit $E_NOTEXIST fi From 809c4b41e1002f9bcc22dd2f30963dd0bde0a253 Mon Sep 17 00:00:00 2001 From: kotso Date: Mon, 16 Jun 2014 17:07:51 +0400 Subject: [PATCH 11/84] Fix DNS_USER variable names In all other files DNS_USER variable is in upper case, here in lower case and when adding remote dns host you are not able to change DNS_USER --- bin/v-add-remote-dns-host | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/v-add-remote-dns-host b/bin/v-add-remote-dns-host index a9bdd25c4..9562840c3 100755 --- a/bin/v-add-remote-dns-host +++ b/bin/v-add-remote-dns-host @@ -17,6 +17,9 @@ password=$4 type=${5-api} dns_user=${6-dns-cluster} +# fix for variable name in other files +DNS_USER=$dns_user + # Includes source $VESTA/func/main.sh source $VESTA/func/remote.sh From 01357404bb362d083dd587634022d526d7b9c9dc Mon Sep 17 00:00:00 2001 From: demlasjr Date: Mon, 16 Jun 2014 18:08:57 +0200 Subject: [PATCH 12/84] Changing conversion: 1 mb = 1024 kb I found that quota is using MB as 1024 KB, but in vestacp, if you set quota for a package 1024 MB, it's showing you 1,02 GB inside the panel. If you edit the package and add 1000 MB, it's showing correctly in the panel, 1GB, but quota is exceeded at 976 MB. humanize_usage use 1000 MB as 1GB instead of 1024 MB, so I fixed it. --- web/inc/main.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/inc/main.php b/web/inc/main.php index abd34fb26..2ce468130 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -151,12 +151,12 @@ function humanize_time($usage) { } function humanize_usage($usage) { - if ( $usage > 1000 ) { - $usage = $usage / 1000; - if ( $usage > 1000 ) { - $usage = $usage / 1000 ; - if ( $usage > 1000 ) { - $usage = $usage / 1000 ; + if ( $usage > 1024 ) { + $usage = $usage / 1024; + if ( $usage > 1024 ) { + $usage = $usage / 1024 ; + if ( $usage > 1024 ) { + $usage = $usage / 1024 ; $usage = number_format($usage, 2); $usage = $usage."".__('pb'); } else { From 6bee67c723d9720fc1b289b208ec5e1a9481a206 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 19 Jun 2014 23:59:51 +0300 Subject: [PATCH 13/84] Argument length increase. Fixes #165 --- func/main.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 93cb4caa1..6864545cb 100644 --- a/func/main.sh +++ b/func/main.sh @@ -740,11 +740,16 @@ validate_format_mhdmw() { # proxy extention or DNS record validate_format_common() { exclude="[!|#|$|^|&|(|)|+|=|{|}|:|<|>|?|/|\|\"|'|;|%|\`| ]" - if [[ "$1" =~ $exclude ]] || [ 200 -le ${#1} ]; then + if [[ "$1" =~ $exclude ]]; then echo "Error: $2 $1 is not valid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi + if [ 400 -le ${#1} ]; then + echo "Error: $2 $1 is too long" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID + fi } # DNS record value From a06a90e5bb762eed3bc6c766332e62102585ffe5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 20 Jun 2014 00:00:15 +0300 Subject: [PATCH 14/84] Custom FTP dir --- bin/v-add-web-domain-ftp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index d6c3fb45f..129e3939d 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -1,6 +1,6 @@ #!/bin/bash # info: add ftp account for web domain. -# options: USER DOMAIN FTP_USER FTP_PASSWORD +# options: USER DOMAIN FTP_USER FTP_PASSWORD FTP_PATH # # The function creates addutional ftp account for web domain. @@ -15,6 +15,7 @@ domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") ftp_user=${1}_${3} ftp_password=$4 +ftp_path=$5 # Includes source $VESTA/func/main.sh @@ -30,7 +31,7 @@ EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9" # Verifications # #----------------------------------------------------------# -check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH]' validate_format 'user' 'domain' 'ftp_user' 'ftp_password' is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' is_object_valid 'user' 'USER' "$user" @@ -47,7 +48,7 @@ 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" + log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi @@ -61,12 +62,29 @@ if [ -e "/usr/bin/rssh" ]; then shell='/usr/bin/rssh' fi +# Define path +if [ -z "$ftp_path" ]; then + ftp_path="$HOMEDIR/$user/web/$domain" +else + ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") + if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: path $ftp_path is invalid" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID + fi +fi + +# Create ftp docroot +mkdir -p $ftp_path +chown $user:$user $ftp_path +chmod 751 $ftp_path + # Adding user /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 + -M -d "$ftp_path" > /dev/null 2>&1 echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" @@ -79,6 +97,9 @@ ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" +add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" + # Logging log_history "added ftp account $ftp_user for $domain" log_event "$OK" "$EVENT" From 2570dc984c36c1daf651c78e80cbe3ca4c3f76ea Mon Sep 17 00:00:00 2001 From: Kovacs Akos Date: Fri, 20 Jun 2014 00:21:53 +0200 Subject: [PATCH 15/84] Hungarian language file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created by Kovács Ákos. --- web/inc/i18n/hu.php | 443 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 443 insertions(+) create mode 100644 web/inc/i18n/hu.php diff --git a/web/inc/i18n/hu.php b/web/inc/i18n/hu.php new file mode 100644 index 000000000..25b52d700 --- /dev/null +++ b/web/inc/i18n/hu.php @@ -0,0 +1,443 @@ + 'Csomagok', + 'IP' => 'IP', + 'Graphs' => 'Grafikonok', + 'Statistics' => 'Statisztikák', + 'Log' => 'Log', + 'Services' => 'Szolgáltatások', + 'Updates' => 'Frissítések', + 'Log in' => 'Belépés', + 'Log out' => 'Kilépés', + + 'USER' => 'FELHASZNÁLÓ', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'MAIL', + 'DB' => 'ADATBÁZIS', + 'CRON' => 'CRON', + 'BACKUP' => 'MENTÉS', + + 'Add User' => 'Új felhasználó', + 'Add Domain' => 'Új domain', + 'Add Web Domain' => 'Új Web Domain', + 'Add DNS Domain' => 'Új DNS Domain', + 'Add DNS Record' => 'Új DNS Record', + 'Add Mail Domain' => 'Új Mail Domain', + 'Add Mail Account' => 'Új Mail fiók', + 'Add Database' => 'Új adatbázis', + 'Add Cron Job' => 'Új Cron Job', + 'Create Backup' => 'Mentés készítése', + 'Configure' => 'Beállítás', + 'Restore All' => 'Összes visszaállítása', + 'Add Package' => 'Csomag hozzáadása', + 'Add IP' => 'Új IP', + 'Search' => 'Keresés', + 'Overall Statistics' => 'Átfogó statisztikák', + 'Daily' => 'Napi', + 'Weekly' => 'Heti', + 'Monthly' => 'Havi', + 'Yearly' => 'Éves', + 'Add' => 'Hozzáadás', + 'Back' => 'Vissza', + 'Save' => 'Mentés', + 'Submit' => 'OK', + + 'toggle all' => 'összes kinyit/bezár', + 'apply to selected' => 'alkalmazás a kiválasztottakra', + 'rebuild' => 'újratelepít', + 'rebuild web' => 'web újraépítés', + 'rebuild dns' => 'dns újraépítés', + 'rebuild mail' => 'mail újraépítés', + 'rebuild db' => 'adatbázis újraépítés', + 'rebuild cron' => 'cron újraépítés', + 'update counters' => 'számlálók frissítése', + 'suspend' => 'felfüggeszt', + 'unsuspend' => 'újraaktivál', + 'delete' => 'törlés', + 'show per user' => 'felhasználónként listáz', + 'login as' => 'bejelentkezés, mint', + 'logout' => 'kilépés', + 'edit' => 'szerkesztés', + 'open webstats' => 'statisztikák megnyitása', + 'view logs' => 'logok megnyitása', + 'list records' => '%s record listázása', + 'add record' => 'rekord hozzáadása', + 'list accounts' => '%s fiók listázása', + 'add account' => 'fiók hozzáadása', + 'open webmail' => 'webmail megnyitása', + 'open %s' => '%s megnyitása', + 'download' => 'letöltés', + 'restore' => 'visszaállítás', + 'configure restore settings' => 'visszaállítási beállítások konfigurálása', + 'stop' => 'stop', + 'start' => 'start', + 'restart' => 'újraindítás', + 'update' => 'frissítés', + 'generate' => 'létrehoz', + 'Generate CSR' => 'CSR generálás', + 'reread IP' => 'IP újraolvasása', + 'enable autoupdate' => 'automatikus frissítés engedélyezése', + 'disable autoupdate' => 'automatikus frissítés tiltása', + + 'Adding User' => 'Felhasználó hozzáadása', + 'Editing User' => 'Felhasználó szerkesztése', + 'Adding Domain' => 'Domain hozzáadása', + 'Editing Domain' => 'Domain szerkesztése', + 'Adding DNS Domain' => 'DNS Domain hozzáadása', + 'Editing DNS Domain' => 'DNS Domain szerkesztése', + 'Adding DNS Record' => 'DNS Rekord hozzáadása', + 'Editing DNS Record' => 'DNS Record szerkesztése', + 'Adding Mail Domain' => 'Mail Domain hozzáadása', + 'Editing Mail Domain' => 'Mail Domain szerkesztése', + 'Adding Mail Account' => 'Mail Fiók hozzáadása', + 'Editing Mail Account' => 'Mail Fiók szerkesztése', + 'Adding database' => 'Adatbázis hozzáadása', + 'Editing Cron Job' => 'Cron Job szerkesztése', + 'Adding Cron Job' => 'Cron Job hozzáadása', + 'Editing Database' => 'Adatbázis szerkesztése', + 'Adding Package' => 'Csomag hozzáadása', + 'Editing Package' => 'Csomag szerkesztése', + 'Adding IP address' => 'IP cím hozzáadása', + 'Editing IP Address' => 'IP cím szerkesztése', + 'Editing Backup Exclusions' => 'Mentési kivételek szerkesztése', + 'Generating CSR' => 'CSR generálása', + 'Listing' => 'Listázás', + 'Search Results' => 'Keresési eredmények', + + 'active' => 'aktív', + 'spnd' => 'felfüggesztett', + 'suspended' => 'felfüggesztett', + 'running' => 'fut', + 'stopped' => 'megállított', + 'outdated' => 'elavult', + 'updated' => 'frissített', + + 'yes' => 'igen', + 'no' => 'nem', + 'none' => 'egyik sem', + 'pb' => 'pb', + 'tb' => 'tb', + 'gb' => 'gb', + 'mb' => 'mb', + 'minute' => 'perc', + 'hour' => 'óra', + 'day' => 'nap', + 'days' => 'nap', + 'hours' => 'óra', + 'minutes' => 'perc', + 'month' => 'hónap', + 'package' => 'csomag', + 'Bandwidth' => 'Sávszélesség', + 'Disk' => 'Lemezterület', + 'Web' => 'Web', + 'Mail' => 'Mail', + 'Databases' => 'Adatbázis', + 'User Directories' => 'Felhasználói könyvtárak', + 'Template' => 'Sablon', + 'Web Template' => 'Apache sablon, + 'Proxy Template' => 'Nginx sablon', + 'DNS Template' => 'DNS sablon', + 'Web Domains' => 'Web Domainek', + 'SSL Domains' => 'SSL Domainek', + 'Web Aliases' => 'Web Alias', + 'per domain' => 'domainenként', + 'DNS domains' => 'DNS Domainek', + 'DNS domains' => 'DNS Domainek', + 'DNS records' => 'DNS recordok' , + 'Name Servers' => 'Name Serverek', + 'Mail Domains' => 'Mail Domainek', + 'Mail Accounts' => 'Mail Fiókok', + 'Cron Jobs' => 'Cron Jobs', + 'SSH Access' => 'SSH hozzáférés', + 'IP Addresses' => 'IP Címek', + 'Backups' => 'Mentések', + 'Backup System' => 'Mentési rendszer', + 'backup exclusions' => 'kihagyás a mentésből', + 'template' => 'sablon', + 'SSL Support' => 'SSL támogatás', + 'SSL Home Directory' => 'SSL kezdőlap', + 'Proxy Support' => 'Nginx támogatás', + 'Proxy Extensions' => 'Nginx kiterjesztések', + 'Web Statistics' => 'Web statisztikák', + 'Additional FTP Account' => 'Hozzáadott FTP', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Lejár', + 'Records' => 'Rekordok', + 'Catchall email' => 'Catchall email', + 'AntiVirus Support' => 'AntiVirus támogatás', + 'AntiSpam Support' => 'AntiSpam támogatás', + 'DKIM Support' => 'DKIM támogatás', + 'Accounts' => 'Fiókok', + 'Quota' => 'Kvóta', + 'Autoreply' => 'Automatikus válasz', + 'Forward to' => 'Továbbítás', + 'Do not store forwarded mail' => 'Továbbított e-mailek mentésének tiltása', + 'database' => 'adatbázis', + 'User' => 'Felhasználó', + 'Host' => 'Hoszt', + 'Charset' => 'Karakterkódolás', + 'Min' => 'Perc', + 'Hour' => 'Óra', + 'Day' => 'Nap', + 'Month' => 'Hónap', + 'Day of week' => 'A hét napja', + 'local' => 'helyi', + 'Run Time' => 'Futási idő', + 'Backup Size' => 'Mentés mérete', + 'SYS' => 'SYS', + 'Domains' => 'Domainek', + 'Status' => 'Státusz', + 'shared' => 'megosztott', + 'dedicated' => 'dedikált', + 'Owner' => 'Tulajdonos', + 'Users' => 'Felhasználók', + 'Load Average' => 'Load átlag', + 'Memory Usage' => 'Memória használat', + 'HTTPD Usage' => 'HTTPD használat', + 'NGINX Usage' => 'NGINX használat', + 'MySQL Usage on localhost' => 'MySQL használat a localhoston', + 'PostgreSQL Usage on localhost' => 'PostgreSQL használat a localhoston', + 'Bandwidth Usage eth0' => 'eth0 sávszélesség használat', + 'FTP Usage' => 'FTP használat', + 'SSH Usage' => 'SSH használat', + 'reverse proxy' => 'fordított proxy', + 'web server' => 'web szerver', + 'dns server' => 'dns szerver', + 'mail server' => 'mail szerver', + 'pop/imap server' => 'pop/imap szerver', + 'email antivirus' => 'email antivirus', + 'email antispam' => 'email antispam', + 'database server' => 'adatbázis szerver', + 'ftp server' => 'ftp szerver', + 'job scheduler' => 'job ütemező', + 'CPU' => 'CPU', + 'Memory' => 'Memória', + 'Uptime' => 'Futási idő', + 'core package' => 'alapcsomag', + 'php interpreter' => 'php értelmező', + 'internal web server' => 'külső web szerver', + 'Version' => 'Verzió', + 'Release' => 'Kiadás', + 'Architecture' => 'Architektúra', + 'Object' => 'Objektum', + 'Owner' => 'Tulajdonos', + 'Username' => 'Felhasználónév', + 'Password' => 'Jelszó', + 'Email' => 'Email', + 'Package' => 'Csomag', + 'Language' => 'Nyelv', + 'First Name' => 'Keresztnév', + 'Last Name' => 'Vezetéknév', + 'Send login credentials to email address' => 'Belépési adatok küldése e-mailben', + 'Default Template' => 'Alapértelmezett sablon', + 'Default Name Servers' => 'Alapértelmezett névszerverek', + 'Domain' => 'Domain', + 'DNS Support' => 'DNS támogatás', + 'Mail Support' => 'Mail támogatás', + 'Advanced options' => 'Haladó beállítások', + 'Aliases' => 'Aliaszok', + 'SSL Certificate' => 'SSL igazolás', + 'SSL Key' => 'SSL kulcs', + 'SSL Certificate Authority / Intermediate' => 'SSL igazolás engedélyezése', + 'SSL CSR' => 'SSL CSR', + 'optional' => 'opcionális', + 'internal' => 'belső', + 'Statistics Authorization' => 'Statisztika engedélyezése', + 'Statistics Auth' => 'Statisztika engedélyezése', + 'Account' => 'Fiók', + 'Prefix will be automaticaly added to username' => 'A(z) %s előtag automatikusan hozzáadásra kerül a felhasználónévhez.', + 'Send FTP credentials to email' => 'FTP adatok küldése e-mailben', + 'Expiration Date' => 'Lejárati dárum', + 'YYYY-MM-DD' => 'ÉÉÉÉ-HH-NN', + 'Name servers' => 'Névszerverek', + 'Record' => 'Rekord', + 'IP or Value' => 'IP avgy érték', + 'Priority' => 'Prioritás', + 'Record Number' => 'Rekord száma', + 'in megabytes' => 'megabájtokban', + 'Message' => 'üzenet', + 'use local-part' => 'helyi rész használata', + 'one or more email addresses' => 'egy vagy több e-mail cím', + 'Prefix will be automaticaly added to database name and database user' => 'A(z) %s előtag automatikusan hozzáadásra kerül az adatbázis felhasználónévhez', + 'Database' => 'Adatbázis', + 'Type' => 'Típus', + 'Minute' => 'Perc', + 'Command' => 'Parancs', + 'Package Name' => 'Csomagnév', + 'Netmask' => 'Netmask', + 'Interface' => 'Interfész', + 'Shared' => 'Megosztott', + 'Assigned user' => 'Hozzárendelt felhasználó', + 'Assigned domain' => 'Hozzárendelt domain', + 'NAT IP association' => 'NAT IP hozzárendelés', + 'shell' => 'rendszerhéj', + 'web domains' => 'web domainek', + 'web aliases' => 'web aliaszok', + 'dns records' => 'dns rekordok', + 'mail domains' => 'mail domainek', + 'mail accounts' => 'mail fiókok', + 'accounts' => 'fiókok', + 'databases' => 'adatbázisok', + 'cron jobs' => 'cron jobs', + 'backups' => 'mentések', + 'quota' => 'kvóta', + 'day of week' => 'a hét napja', + 'cmd' => 'cmd', + 'users' => 'felhasználók', + 'domains' => 'domainek', + 'aliases' => 'aliaszok', + 'records' => 'rekordok', + 'jobs' => 'jobs', + 'username' => 'felhasználónév', + 'password' => 'jelszó', + 'type' => 'típus', + 'charset' => 'karakterkódolás', + 'domain' => 'domain', + 'ip' => 'ip', + 'ip address' => 'ip cím', + 'IP address' => 'IP cím', + 'netmask' => 'netmaszk', + 'interface' => 'interfész', + 'assigned user' => 'hozzárendelt felhasználó', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'felhasználó', + 'email' => 'email', + 'first name' => 'vezetéknév', + 'last name' => 'keresztnév', + 'account' => 'fiók', + 'ssl certificate' => 'ssl hitelesítés', + 'ssl key' => 'ssl kulcs', + 'stats user password' => 'stats user password', + 'stats username' => 'stats username', + 'stats password' => 'stats password', + 'ftp user password' => 'ftp felhasználónév', + 'ftp user' => 'ftp felhasználó', + 'Last 70 lines of %s.%s.log' => 'A %s.%s.log utolsó 70 sora', + 'Download AccessLog' => 'AccessLog letöltése', + 'Download ErrorLog' => 'ErrorLog letöltése', + 'Country' => 'Ország', + '2 letter code' => '2 Irányítószám', + 'State / Province' => 'Megye', + 'City / Locality' => 'Város', + 'Organization' => 'Szervezet', + + '1 account' => '1 fiók', + '%s accounts' => '%s fiók', + '1 domain' => '1 domain', + '%s domains' => '%s domainek', + '1 record' => '1 rekord', + '%s records' => '%s recordok', + '1 mail account' => '1 mail fiók', + '%s mail accounts' => '%s mail fiókok', + '1 database' => '1 adatbázis', + '%s databases' => '%s adatbázis', + '1 cron job' => '1 cron job', + '%s cron jobs' => '%s cron job', + '1 archive' => '1 archívum', + '%s archives' => '%s archívum', + '1 package' => '1 csomag', + '%s packages' => '%s csomag', + '1 IP address' => '1 IP cím', + '%s IP addresses' => '%s IP cím', + '1 month' => '1 hónap', + '%s months' => '%s hónap', + '1 log record' => '1 log rekord', + '%s log records' => '%s log rekord', + '1 object' => '1 objektum', + '%s objects' => '%s objektum', + 'no exclusions' => 'nincs kihagyás', + + 'USER_CREATED_OK' => '%s felhasználó sikeresen létrehozva.', + 'WEB_DOMAIN_CREATED_OK' => '%s domain sikeresen létrehozva.', + 'DNS_DOMAIN_CREATED_OK' => '%s DNS domain sikeresen létrehozva.', + 'DNS_RECORD_CREATED_OK' => '%s.%s rekord sikeresen létrehozva.', + 'MAIL_DOMAIN_CREATED_OK' => '%s ail domain sikeresen létrehozva.', + 'MAIL_ACCOUNT_CREATED_OK' => '%s@%s mail fiók sikeresen létrehozva.', + 'DATABASE_CREATED_OK' => '%s adatbázis sikeresen létrehozva.', + 'CRON_CREATED_OK' => 'Cron job sikeresen létrehozva.', + 'IP_CREATED_OK' => '%s IP cím sikeresen létrehozva.', + 'PACKAGE_CREATED_OK' => 'A(z) %s csomag sikeresen létrehozva.', + 'SSL_GENERATED_OK' => 'A tanúsítvány sikeresen létrehozva.', + 'Autoupdate has been successfully enabled' => 'Az automatikus frissítés bekapcsolva.', + 'Autoupdate has been successfully disabled' => 'Az automatikus frissítés kikapcsolva.', + 'Changes has been saved.' => 'A módosítások sikeresen mentésre kerültek.', + 'Confirmation' => 'Megerősítés', + 'DELETE_USER_CONFIRMATION' => 'Biztos, hogy törölni szeretnéd %s felhasználót?', + 'SUSPEND_USER_CONFIRMATION' => 'Biztos, hogy felfüggeszted %s felhasználót?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni %s felhasználót?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s domaint?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s domaint?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s domaint?', + 'DELETE_RECORD_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s rekordot?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s rekordot?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s rekordot?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s -t?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s -t?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s -t?', + 'DELETE_DATABASE_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s adatbázist?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s adatbázist?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s adatbázist?', + 'DELETE_CRON_CONFIRMATION' => 'Biztos, hogy törlöd a cron job-ot?', + 'SUSPEND_CRON_CONFIRMATION' => 'Biztos, hogy felfüggeszted a cron job-ot?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a cron job-ot?', + 'DELETE_BACKUP_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s mentést?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s kivételt?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s csomagot?', + 'DELETE_IP_CONFIRMATION' => 'Biztos, hogy törlöd a(z) IP címet?', + 'Welcome' => 'Üdvözöljük', + 'LOGGED_IN_AS' => 'Belépve, mint %s', + 'Error' => 'Hiba', + 'Invalid username or password' => 'Hibás felhasználónév vagy jelszó', + 'Invalid username or code' => 'Hibás felhasználónév vagy kód + 'Passwords not match' => 'A jelszavak nem egyeznek meg', + 'Please enter valid email address.' => 'Kérlek valós e-mail címet adj meg!', + 'Field "%s" can not be blank.' => 'A(z) "%s" mező nem lehet üres.', + 'Password is too short.' => 'A jelszó túl rövid.(minimum 6 karakter)', + 'Error code:' => 'Hibakód: %s', + 'SERVICE_ACTION_FAILED' => 'A(z) "%s" "%s" meghiúsult', + 'IP address is in use' => 'Az IP cím használatban van.', + 'BACKUP_SCHEDULED' => 'A feladat végrehajtás alatt. A mentés elkészültéről e-mail értesítést fogunk küldeni.', + 'BACKUP_EXISTS' => 'Egy mentés már folyamatban van. Kérlek várj, míg elkészül.', + 'RESTORE_SCHEDULED' => 'A feladat a végrehajtási sorba került. A mentés elkészültéről e-mail értesítést fogunk küldeni.', + 'RESTORE_EXISTS' => 'Egy visszaállítás már folyamatban van. Kérlek várj, míg elkészül.', + + 'WEB_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes kihagyásához használj "*" -ot. Adott könyvtár kihagyásához használd a következő formátumot: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes kihagyásához használj "*" -ot.", + 'MAIL_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes domain kihagyásához használj "*" -ot. Adott fiók kihagyásához használd a következő formátumot: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Írd be az adatbázis teljes nevét, soronként egyet. Az összes adatbázis kihagyásához használj "*" -ot", + 'CRON_EXCLUSIONS' => "Az összes job kihagyásához használj "*" -ot.", + 'USER_EXCLUSIONS' => "Írd be a könyvtár nevét, soronként egyet. Az összes kihagyásához használj "*" -ot.", + + 'Welcome to Vesta Control Panel' => 'Üdv, a Kezelőfelület!', + 'MAIL_FROM' => 'Kezelőfelület ', + 'GREETINGS_GORDON_FREEMAN' => "Üdv, %s %s,\n", + 'GREETINGS' => "Üdv,\n", + 'ACCOUNT_READY' => "A fiókod létrejött és készen áll a használatra.\n\nhttps://%s/login/\nFelhasználónév: %s\nJelszó: %s\n\n--\nKezelőfelület\n", + + 'FTP login credentials' => 'FTP belépési adatok', + 'FTP_ACCOUNT_READY' => "Az FTP felhasználó létrejött és készen áll a használatra.\n\nKiszolgáló: %s\nFelhasználónév: %s_%s\nJelszó: %s\n\n--\nKezelőfelület\n", + + 'Database Credentials' => 'Adatbázis adatok', + 'DATABASE_READY' => "Az adatbázis létrejött és készen áll a használatra.\n\nAdatbázis: %s\nFelhasználónév: %s\nJelszó: %s\n%s\n\n--\nKezelőfelület\n", + + 'forgot password' => 'elfelejtett jelszó', + 'Confirm' => 'Megerősít', + 'New Password' => 'Új jelszó', + 'Confirm Password' => 'Jelszó megerősítése', + 'Reset' => 'Visszaállít', + 'Reset Code' => 'Kód újragenerálása', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'A jelszó visszaállításhoz szükséges kód elküldésre került az e-mail címedre
', + 'MAIL_RESET_SUBJECT' => 'Jelszó újragenerálás %s -kor', + 'PASSWORD_RESET_REQUEST' => "A panel jelszavad visszaállításához kattints a következő linkre:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, vagy használd a következőt https://%s/reset/?action=code&user=%s és írd be a kódot:\n%s\n\nHa nem Te kérted a visszaállítást, kérlek hagyd figyelmen kívül ezt a levelet.\n\n--\nKezelőfelület\n", +); From 7e2a37771e4d4e6e2f4c145e8f5c5035e423c093 Mon Sep 17 00:00:00 2001 From: Bashar Al-Abdulhadi Date: Mon, 30 Jun 2014 12:30:56 +0300 Subject: [PATCH 16/84] ar.php Arabic Language file --- web/inc/i18n/ar.php | 441 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 web/inc/i18n/ar.php diff --git a/web/inc/i18n/ar.php b/web/inc/i18n/ar.php new file mode 100644 index 000000000..0aba39923 --- /dev/null +++ b/web/inc/i18n/ar.php @@ -0,0 +1,441 @@ + 'الحزم', + 'IP' => 'بروتوكول إنترنت', + 'Graphs' => 'رسوم بيانية', + 'Statistics' => 'إحصائيات', + 'Log' => 'سجل', + 'Services' => 'خدمات', + 'Updates' => 'تحديثات', + 'Log in' => 'تسجيل الدخول', + 'Log out' => 'تسجيل الخروج', + + 'USER' => 'المستخدم', + 'WEB' => 'الشبكة', + 'DNS' => 'نظام أسماء النظاقات', + 'MAIL' => 'البريد', + 'DB' => 'قاعدة بيانات', + 'CRON' => 'مجدول الوظائف', + 'BACKUP' => 'النسخ الإحتياطية', + + 'Add User' => 'إضافة مستخدم', + 'Add Domain' => 'إضافة نطاق', + 'Add Web Domain' => 'إضافة نطاق شبكة', + 'Add DNS Domain' => 'تسجيل نطاق في النظام', + 'Add DNS Record' => 'إضافة سجل للنظام', + 'Add Mail Domain' => 'إضافة نطاق بريدي', + 'Add Mail Account' => 'إضافة حساب بريدي', + 'Add Database' => 'إضافة قاعدة بيانات', + 'Add Cron Job' => 'إضافة وظيفة مجدولة', + 'Create Backup' => 'إنشاء نسخة احتياطية', + 'Configure' => 'تهيئة', + 'Restore All' => 'استرجاع الكل', + 'Add Package' => 'إضافة رزمة', + 'Add IP' => 'إضافة بروتوكول إنترنت', + 'Search' => 'بحث', + 'Overall Statistics' => 'إحصائيات عامة', + 'Daily' => 'يومي', + 'Weekly' => 'أسبوعي', + 'Monthly' => 'شهري', + 'Yearly' => 'سنوي', + 'Add' => 'إضافة', + 'Back' => 'رجوع', + 'Save' => 'حفظ', + 'Submit' => 'تسليم', + + 'toggle all' => 'تبديل الجميع', + 'apply to selected' => 'تطبيق على ما تم اختياره', + 'rebuild' => 'إعادة إنشاء', + 'rebuild web' => 'إعادة إنشاء الشبكة', + 'rebuild dns' => 'إعادة إنشاء نظام أسماء النطاقات', + 'rebuild mail' => 'إعادة إنشاء البريد', + 'rebuild db' => 'إعادة إنشاء قاعدة البيانات', + 'rebuild cron' => 'إعادة إنشاء مجدول الوظائف', + 'update counters' => 'تحديث العدادات', + 'suspend' => 'تعليق', + 'unsuspend' => 'إلغاء التعليق', + 'delete' => 'حذف', + 'show per user' => 'عرض حسب المستخدم', + 'login as' => 'تسجيل الدخول ك', + 'logout' => 'تسجيل الخروج', + 'edit' => 'تعديل', + 'open webstats' => 'فتح احصائيات الشبكة', + 'view logs' => 'عرض السجلات', + 'list records' => 'عرض السجلات', + 'add record' => 'إضافة سجل', + 'list accounts' => 'عرض الحسابات', + 'add account' => 'إضافة حساب', + 'open webmail' => 'فتح شبكة البريد', + 'open %s' => 'فتح %s', + 'download' => 'تحميل', + 'restore' => 'استرجاع', + 'configure restore settings' => 'تهيئة إعدادات الاسترجاع', + 'stop' => 'إيقاف', + 'start' => 'بدء', + 'restart' => 'إعادة تشغيل', + 'update' => 'تحديث', + 'generate' => 'تكوين', + 'Generate CSR' => 'تكوين طلب توقيع شهادة', + 'reread IP' => 'إعادة قراءة بروتوكول الإنترنت', + 'enable autoupdate' => 'تمكين التحديث التلقائي', + 'disable autoupdate' => 'تعطيل التحديث التلقائي', + + 'Adding User' => 'جاري إضافة مستخدم', + 'Editing User' => 'جاري تعديل المستخدم', + 'Adding Domain' => 'جاري إضافة نطاق', + 'Editing Domain' => 'جاري تعديل النطاق', + 'Adding DNS Domain' => 'جاري إضافة نطاق للنظام', + 'Editing DNS Domain' => 'جاري تعديل النطاق بالنظام', + 'Adding DNS Record' => 'جاري إضافة سجل للنظام', + 'Editing DNS Record' => 'جاري تعديل السحجل بالنظام', + 'Adding Mail Domain' => 'جاري إضافة نطاق بريدي', + 'Editing Mail Domain' => 'جاري تعديل النظاق البريدي', + 'Adding Mail Account' => 'جاري إضافة حساب بريدي', + 'Editing Mail Account' => 'جاري تعديل الحساب البريدي', + 'Adding database' => 'جاري إضافة قاعدة بيانات', + 'Editing Cron Job' => 'جاري تعديل وظيفة مجدولة', + 'Adding Cron Job' => 'جاري إضافة وظيفة مجدولة', + 'Editing Database' => 'جاري تعديل قاعدة البيانات', + 'Adding Package' => 'جاري إضافة رزمة', + 'Editing Package' => 'جاري تعديل الرزمة', + 'Adding IP address' => 'جاري إضافة عنوان بروتوكول إنترنت', + 'Editing IP Address' => 'جاري تعديل عنوان بروتوكول إنترنت', + 'Editing Backup Exclusions' => 'جاري تعديل استثناءات النسخة الاحتياطية', + 'Generating CSR' => 'جاري إنشاء طلب توقيع شهادة', + 'Listing' => 'قائمة', + 'Search Results' => 'نتائج البحث', + + 'active' => 'نشط', + 'spnd' => 'معلق', + 'suspended' => 'معلق', + 'running' => 'يعمل', + 'stopped' => 'متوقف', + 'outdated' => 'نسخة قديمة', + 'updated' => 'محدث', + + 'yes' => 'نعم', + 'no' => 'لا', + 'none' => 'لا شيء', + 'pb' => 'pb', + 'tb' => 'tb', + 'gb' => 'gb', + 'mb' => 'mb', + 'minute' => 'دقيقة', + 'hour' => 'ساعة', + 'day' => 'يوم', + 'days' => 'أيام', + 'hours' => 'ساعات', + 'minutes' => 'دقائق', + 'month' => 'شهر', + 'package' => 'رزمة', + 'Bandwidth' => 'عرض النطاق', + 'Disk' => 'إسطوانة', + 'Web' => 'شبكة', + 'Mail' => 'بريد', + 'Databases' => 'قواعد بيانات', + 'User Directories' => 'مجلدات المستخدم', + 'Template' => 'نموذج', + 'Web Template' => 'أباتشي نموذج', + 'Proxy Template' => 'Nginx نموذج', + 'DNS Template' => 'نظام أسماء النطاقات نموذج', + 'Web Domains' => 'نطاقات الشبكة', + 'SSL Domains' => 'نطاقات آمنة', + 'Web Aliases' => 'اختصارات الشبكة', + 'per domain' => 'لكل نطاق', + 'DNS domains' => 'نطاقات النظام', + 'DNS domains' => 'نطاقات النظام', + 'DNS records' => 'سجلات النظام' , + 'Name Servers' => 'خوادم الأسماء', + 'Mail Domains' => 'نطاقات البريد', + 'Mail Accounts' => 'حسابات البريد', + 'Cron Jobs' => 'الوظائق المجدولة', + 'SSH Access' => 'وصول بعيد آمن', + 'IP Addresses' => 'عنوان بروتوكول انترنت', + 'Backups' => 'نسخ احتياطية', + 'Backup System' => 'نظام النسخ الاحتياطي', + 'backup exclusions' => 'استثناءات النسخ الاحتياطي', + 'template' => 'نموذج', + 'SSL Support' => 'دعم طبقة المقبض الآمن', + 'SSL Home Directory' => 'المجلد الرئيسي لطبقة المقبض الآمن', + 'Proxy Support' => 'Nginx دعم', + 'Proxy Extensions' => 'Nginx إمتدادات', + 'Web Statistics' => 'إحصائيات الشبكة', + 'Additional FTP Account' => 'حساب بروتوكول نقل الملفات إضافي', + 'SOA' => 'هيكلية الخدمات الموجهة', + 'TTL' => 'الوقت المتبقي للخروج', + 'Expire' => 'تنقضي', + 'Records' => 'سجلات', + 'Catchall email' => 'حصل كل البريد', + 'AntiVirus Support' => 'دعم مضاد الفيروسات', + 'AntiSpam Support' => 'دعم مضاد البريد المزعج', + 'DKIM Support' => 'دعم مفاتيح النطاقات', + 'Accounts' => 'حسابات', + 'Quota' => 'حصة', + 'Autoreply' => 'الرد الآلي', + 'Forward to' => 'إعادة توجيه ل', + 'Do not store forwarded mail' => 'لا تحتفظ بنسخة من البريد المعاد توجيهه', + 'database' => 'قاعدة بيانات', + 'User' => 'مستخدم', + 'Host' => 'مضيف', + 'Charset' => 'حزمة نص', + 'Min' => 'دقيقة', + 'Hour' => 'ساعة', + 'Day' => 'يوم', + 'Month' => 'شهر', + 'Day of week' => 'اليوم في الإسبوع', + 'local' => 'محلي', + 'Run Time' => 'وقت التشغيل', + 'Backup Size' => 'حجم النسخة الاحتياطية', + 'SYS' => 'نظام', + 'Domains' => 'نطاقات', + 'Status' => 'حالة', + 'shared' => 'مشارك', + 'dedicated' => 'موجه', + 'Owner' => 'مالك', + 'Users' => 'مستخدمين', + 'Load Average' => 'متوسط التحميل', + 'Memory Usage' => 'استخدام الذاكرة', + 'HTTPD Usage' => 'استخدام نظام بروتوكول نقل النص التشعبي', + 'NGINX Usage' => 'NGINX استخدام', + 'MySQL Usage on localhost' => 'استخدام قاعدة بيانات MySql على المضيف المحلي', + 'PostgreSQL Usage on localhost' => 'PostgreSQL استخدام قاعدة بيانات على المضيف المحلي', + 'Bandwidth Usage eth0' => 'eth0 استخدام سعة النطاق على منفذ', + 'FTP Usage' => 'استخدام بروتوكول نقل الملفات', + 'SSH Usage' => 'استخدام الوصول البعيد الآمن', + 'reverse proxy' => 'الوكيل العكسي', + 'web server' => 'خادم الشبكة', + 'dns server' => 'خادم نظام أسماء النطاقات', + 'mail server' => 'خادم البريد', + 'pop/imap server' => 'pop/imap خادم', + 'email antivirus' => 'مضاد فيروسات البريد', + 'email antispam' => 'مضاد البريد المزعج', + 'database server' => 'خادم قاعدة البيانات', + 'ftp server' => 'خادم بروتوكول نقل الملفات', + 'job scheduler' => 'مجدول الوظائف', + 'CPU' => 'وحدة المعالجة المركزية', + 'Memory' => 'الذاكرة', + 'Uptime' => 'وقت التشغيل', + 'core package' => 'الرزمة الأساسية', + 'php interpreter' => 'php مترجم', + 'internal web server' => 'خادم الشبكة الداخلي', + 'Version' => 'إصدار', + 'Release' => 'نسخة', + 'Architecture' => 'هيكلية', + 'Object' => 'عنصر', + 'Owner' => 'مالك', + 'Username' => 'اسم المستخدم', + 'Password' => 'كلمة المرور', + 'Email' => 'بريد', + 'Package' => 'رزمة', + 'Language' => 'لغة', + 'First Name' => 'الإسم الأول', + 'Last Name' => 'الإسم الأخير', + 'Send login credentials to email address' => 'إرسال معلومات الدخول لعنوان البريد', + 'Default Template' => 'نموذج افتراضي', + 'Default Name Servers' => 'أسماء الخوادم الافتراضية', + 'Domain' => 'نطاق', + 'DNS Support' => 'دعم نظام أسماء النطاقات', + 'Mail Support' => 'دعم البريد', + 'Advanced options' => 'خيارات متقدمة', + 'Aliases' => 'اختصارات', + 'SSL Certificate' => 'شهادة طبقة مقبس آمن', + 'SSL Key' => 'مفتاح طبقة المقبس الآمن', + 'SSL Certificate Authority / Intermediate' => 'سلطة / متوسط شهادة طبقة المقبس الآمن ', + 'SSL CSR' => 'طلب توقيع شهادة باستخدام طبقة المقبس الآمن', + 'optional' => 'اختياري', + 'internal' => 'داخلي', + 'Statistics Authorization' => 'احصائيات الصلاحيات', + 'Statistics Auth' => 'إحصائيات الصلاحيات', + 'Account' => 'حساب', + 'Prefix will be automaticaly added to username' => 'سيضاف بشكل آلي لأسم المستخدم %s اختصار', + 'Send FTP credentials to email' => 'إرسال معلومات الاعتماد لبروتوكول نقل الملفات للبريد', + 'Expiration Date' => 'تاريخ الانتهاء', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'خوادم الأسماء', + 'Record' => 'سجل', + 'IP or Value' => 'بروتوكول إنترنت أو قيمة', + 'Priority' => 'أولوية', + 'Record Number' => 'عدد السجلات', + 'in megabytes' => 'ب ميجا بابت', + 'Message' => 'رسالة', + 'use local-part' => 'استخدم جزء محلي', + 'one or more email addresses' => 'عنوان بريدي واحد أو أكثر', + 'Prefix will be automaticaly added to database name and database user' => 'الاختصار سيتم إضافته بشكل آلي لإسم قاعدة البيانات واسم المستخدم %s', + 'Database' => 'قاعدة بيانات', + 'Type' => 'نوع', + 'Minute' => 'دقيقة', + 'Command' => 'أمر', + 'Package Name' => 'إسم الرزمة', + 'Netmask' => 'قناع الشبكة', + 'Interface' => 'واجهة', + 'Shared' => 'مشارك', + 'Assigned user' => 'المستخدم المعين', + 'Assigned domain' => 'النطاق المعين', + 'NAT IP association' => 'جمعية ترجمة عناوين بروتوكول الانترنت', + 'shell' => 'منصب', + 'web domains' => 'نطاقات شبكة', + 'web aliases' => 'اسماء الشبكة المستعارة', + 'dns records' => 'سجلات نظام أسماء النطاقات', + 'mail domains' => 'نطاقات البريد', + 'mail accounts' => 'حسابات البريد', + 'accounts' => 'حسابات', + 'databases' => 'قواعد بيانات', + 'cron jobs' => 'وظائف مجدولة', + 'backups' => 'نسخ احتياطية', + 'quota' => 'حصة', + 'day of week' => 'اليوم من الإسبوع', + 'cmd' => 'أمر', + 'users' => 'مستخدمين', + 'domains' => 'نطاقات', + 'aliases' => 'أسماء مستعارة', + 'records' => 'سجلات', + 'jobs' => 'وظائف', + 'username' => 'اسم المستخدم', + 'password' => 'كلمة المرور', + 'type' => 'نوع', + 'charset' => 'حزمة نص', + 'domain' => 'نطاق', + 'ip' => 'بروتوكول إنترنت', + 'ip address' => 'عنوان بروتوكول إنترنت', + 'IP address' => 'عنوان بروتوكول إنترنت', + 'netmask' => 'قناع شبكة', + 'interface' => 'واجهة', + 'assigned user' => 'المستخدم المعين', + 'ns1' => 'مساحة اسم 1', + 'ns2' => 'مساحة اسم 2', + 'user' => 'مستخدم', + 'email' => 'بريد', + 'first name' => 'الإسم الأول', + 'last name' => 'الاسم الأخير', + 'account' => 'حساب', + 'ssl certificate' => 'شهادة طبقة مقبس آمن', + 'ssl key' => 'مفتاح طبقة مقبس آمن', + 'stats user password' => 'كلمة مرور مستخدم الإحصائيات', + 'stats username' => 'مستخدم الإحصائيات', + 'stats password' => 'كلمة مرور الإحصائيات', + 'ftp user password' => 'كلمة مرور مستخدم بروتوكول نقل الملفات', + 'ftp user' => 'مستخدم بروتوكول نقل الملفات', + 'Last 70 lines of %s.%s.log' => 'آخر 70 سطر في %s.%s.log', + 'Download AccessLog' => 'تحميل سجلات الوصول', + 'Download ErrorLog' => 'تحميل سجلات الأخطاء', + 'Country' => 'البلد', + '2 letter code' => 'كود من رسالتين', + 'State / Province' => 'ولاية / مقاطعة', + 'City / Locality' => 'المدينة / المنطقة', + 'Organization' => 'مؤسسة', + + '1 account' => '1 حساب', + '%s accounts' => 'حسابات %s', + '1 domain' => '1 نطاق', + '%s domains' => 'نطاقات %s', + '1 record' => '1 سجل', + '%s records' => 'سجلات %s', + '1 mail account' => '1 حساب بريد', + '%s mail accounts' => 'حسابات بريد %s', + '1 database' => '1 قاعدة بيانات', + '%s databases' => 'قواعد بيانات %s', + '1 cron job' => '1 وظيفة مجدولة', + '%s cron jobs' => 'وظائف مجدولة %s', + '1 archive' => '1 أرشيف', + '%s archives' => 'أرشيف %s', + '1 package' => '1 رزمة', + '%s packages' => 'رزم %s', + '1 IP address' => '1 عنوان بروتوكول إنترنت', + '%s IP addresses' => 'عناوين بروتوكول إنترنت %s', + '1 month' => '1 شهر', + '%s months' => 'أشهر %s', + '1 log record' => '1 سجل', + '%s log records' => 'سجلات %s', + '1 object' => '1 عنصر', + '%s objects' => 'عناصر %s', + 'no exclusions' => 'لا استثناءات', + + 'USER_CREATED_OK' => 'المستخدم %s تم إنشائه بنجاح', + 'WEB_DOMAIN_CREATED_OK' => 'النطاق %sتم إنشائه بنجاح .', + 'DNS_DOMAIN_CREATED_OK' => 'النطاق %s تم إنشائه بنجاح.', + 'DNS_RECORD_CREATED_OK' => 'السجل %s.%s تم إنشائه بنجاح.', + 'MAIL_DOMAIN_CREATED_OK' => 'نطاق البريد %s تم إنشائه بنجاح.', + 'MAIL_ACCOUNT_CREATED_OK' => 'حساب البريد %s@%s تم إنشائه بنجاح', + 'DATABASE_CREATED_OK' => 'قاعدة البيانات %s تم إنشائها بنجاح', + 'CRON_CREATED_OK' => 'الوظيفة المجدولة تم إنشائها بنجاح.', + 'IP_CREATED_OK' => 'عنوان بروتوكول الإنترنت %s تم إنشائه بنجاح.', + 'PACKAGE_CREATED_OK' => 'الرزمة %s تم إنشائها بنجاح.', + 'SSL_GENERATED_OK' => 'تم إنشاء الشهادة بنجاح.', + 'Autoupdate has been successfully enabled' => 'تم تفيعل التحديث التلقائي بنجاح', + 'Autoupdate has been successfully disabled' => 'تم تعطيل التحديث التلقائي بنجاح', + 'Changes has been saved.' => 'تم حفظ التغييرات بنجاح.', + 'Confirmation' => 'Confirmation', + 'DELETE_USER_CONFIRMATION' => 'هل تريد فعلا حذف المستخدم %s?', + 'SUSPEND_USER_CONFIRMATION' => 'هل تريد فعلا تعليق المستخدم %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق المستخدم %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'هل تريد فعلا حذف النطاق %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'هل تريد فعلا تعليق النطاق %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق النطاق %s?', + 'DELETE_RECORD_CONFIRMATION' => 'هل تريد فعلا حذف السجل %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'هل تريد فعلا تعليق السجل %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق السجل %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا حذف %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا تعليق %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'هل تريد فعلا حذف قاعدة البيانات %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'هل تريد فعلا تعليق قاعدة البيانات %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق قاعدة البيانات %s?', + 'DELETE_CRON_CONFIRMATION' => 'هل تريد فعلا حذف الوظيفة المجدولة?', + 'SUSPEND_CRON_CONFIRMATION' => 'هل تريد فعلا تعليق الوظيفة المجدولة?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق الوظيفة المجدولة?', + 'DELETE_BACKUP_CONFIRMATION' => 'هل تريد فعلا حذف التسخة الاحتياطية %s ?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'هل تريد فعلا حذف الاستثناء %s?', + 'DELETE_PACKAGE_CONFIRMATION' => 'هل تريد فعلا حذف الرزمة %s?', + 'DELETE_IP_CONFIRMATION' => 'هل تريد فعلا حذف عنوان بروتوكول الإنترنت %s?', + 'Welcome' => 'أهلا وسهلا', + 'LOGGED_IN_AS' => 'تم تسجيل الدخول ك %s', + 'Error' => 'خطأ', + 'Invalid username or password' => 'خطأ في اسم المستخدم أو كلمة المرور', + 'Invalid username or code' => 'خطأ في اسم المستخدم أو في الكود', + 'Passwords not match' => 'كلمات المرور غير متطابقة', + 'Please enter valid email address.' => 'برجاء إدخال عنوان بريد إلكتروني صحيح.', + 'Field "%s" can not be blank.' => 'العنصر "%s" لا يمكن أن يبقى فارغا.', + 'Password is too short.' => 'كلمة المرور قصيرة جدا (على الأقل ح حروف)', + 'Error code:' => 'كود الخطأ: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" فشل', + 'IP address is in use' => 'عنوان بروتوكول الإنترنت مستخدم بالفعل', + 'BACKUP_SCHEDULED' =>'تم إضافة الوظيفة لطابور المهام. سيتم إرسال بريد إلكتروني لك عندما تجهز النسخة الاحتياطية للتحميل.', + 'BACKUP_EXISTS' => 'يوجد عملية نسخ احتياطي تعمل حاليا. برجاء الانتظار حتى تنتهي عملية النسخ الاحتياطي.', + 'RESTORE_SCHEDULED' => ' تم إضافة الوظيفة لطابور المهام. سيتم إرسال بريد إلكتروني لك عندما تجهز النسخة الاحتياطية للتحميل.', + 'RESTORE_EXISTS' =>'يوجد عملية استعادة تعمل حاليا. برجاء الانتظار حتى تنتهي عملية الاستعادة قبل البدء بعملية جديدة.', + + 'WEB_EXCLUSIONS' => "اكتب اسم النطاق. واحد في كل سطر. لاستثناء جميع النطاقات استخدم *.. لاستثناء جميع مجالات النطاق استخدم الصيغة التالية: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "اكتب اسم النطاق, واحد في كل سطر. لاستثناء جميع النطاقات استخدم *", + 'MAIL_EXCLUSIONS' => "اكتب اسم النطاق, واحد في كل سطر. لاستثناء جميع النطاقات استخدم *. لاستثناء حسابات معينة استخدم الصيغة: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "اكتب اسم قاعدة البيانات بالكامل, واحدة في كل سطر. لاستثناء جميع قواعد البيانات استخدم *", + 'CRON_EXCLUSIONS' => "لاستثناء جميع الوظائف المجدولة استخدم *", + 'USER_EXCLUSIONS' => "اكتب اسم المجلد, واحد في كل سطر. لاستثناء جميع المجلدات استخدم *", + + 'Welcome to Vesta Control Panel' => 'Vesta أهلا بكم في لوحة تحكم', + 'MAIL_FROM' => 'Vesta لوحة تحكم ', + 'GREETINGS_GORDON_FREEMAN' => "مرحبا, %s %s,\n", + 'GREETINGS' => "مرحبا,\n", + 'ACCOUNT_READY' => "تم انشاء حسابك بنجاح وهو جاهز للاستخدام.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'FTP login credentials' => 'معلومات اعتماد الدخول لبروتوكول نقل الملفات', + 'FTP_ACCOUNT_READY' => "تم إنشاء حساب بروتوكول نقل الملفات وهو جاهز للاستخدام.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'Database Credentials' => 'معلومات اعتماد قاعدة البيانات', + 'DATABASE_READY' => "تم انشاء قاعدة البيانات بنجاح.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", + + 'forgot password' => 'نسيت كلمة المرور', + 'Confirm' => 'تأكيد', + 'New Password' => 'كلمة مرور جديدة', + 'Confirm Password' => 'تأكيد كلمة المرور', + 'Reset' => 'إعادة تعيين', + 'Reset Code' => 'إعادة تعيين الكود', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'لقد تم إرسال كود إعادة تعيين كلمة المرور لعنوان بريدك الإلكتروني
', + 'MAIL_RESET_SUBJECT' => 'تم إعادة تعيين كلمة المرور %s', + 'PASSWORD_RESET_REQUEST' => "لإعادة تعيين كلمة مرور لوحة التحكم , برجاء اتباع الرابط التالي link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, بامكانك أيضا اتباع الرابط التالي https://%s/reset/?action=code&user=%s وادخال كود إعادة التعيين التالي code:\n%s\n\n إذا لم تطلب إعادة تعيين كلمة المرور, برجاء تجاهل هذه الرسالة وتقبل اعتذارنا.\n\n--\nVesta Control Panel\n", +); From a5c47c3576959b284277e61fc874f0b95858c2bc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jul 2014 01:17:04 +0300 Subject: [PATCH 17/84] Added FTP_SHELL controller --- bin/v-add-web-domain-ftp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 129e3939d..72faef347 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -56,10 +56,14 @@ if [ ! -z "$FTP_USER" ]; then /usr/sbin/userdel -f $FTP_USER > /dev/null 2>&1 fi -# Define shell -shell='/sbin/nologin' -if [ -e "/usr/bin/rssh" ]; then - shell='/usr/bin/rssh' +# Define ftp user shell +if [ -z "$FTP_SHELL" ]; then + shell='/sbin/nologin' + if [ -e "/usr/bin/rssh" ]; then + shell='/usr/bin/rssh' + fi +else + shell=$FTP_SHELL fi # Define path From 8d01d5d796284e54031ce2d1ec8ec7fc39dfea63 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jul 2014 16:46:46 +0300 Subject: [PATCH 18/84] multiple ftp accounts --- bin/v-add-web-domain-ftp | 49 +++++++++++++++++++++---------------- bin/v-delete-web-domain-ftp | 36 +++++++++++++++++++-------- bin/v-list-web-domains | 4 +-- 3 files changed, 56 insertions(+), 33 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 72faef347..06dc99cc6 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -1,8 +1,8 @@ #!/bin/bash # info: add ftp account for web domain. -# options: USER DOMAIN FTP_USER FTP_PASSWORD FTP_PATH +# options: USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH] # -# The function creates addutional ftp account for web domain. +# The function creates additional ftp account for web domain. #----------------------------------------------------------# @@ -38,13 +38,6 @@ 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" @@ -52,9 +45,13 @@ if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then exit $E_EXISTS fi -if [ ! -z "$FTP_USER" ]; then - /usr/sbin/userdel -f $FTP_USER > /dev/null 2>&1 -fi + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Get domain values +get_domain_values 'web' # Define ftp user shell if [ -z "$FTP_SHELL" ]; then @@ -70,20 +67,22 @@ fi if [ -z "$ftp_path" ]; then ftp_path="$HOMEDIR/$user/web/$domain" else + # Validating path ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then echo "Error: path $ftp_path is invalid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi + # MKDIR if path doesn't exist + if [ ! -e $ftp_path ]; then + mkdir -p $ftp_path + chown $user:$user $ftp_path + chmod 751 $ftp_path + fi fi -# Create ftp docroot -mkdir -p $ftp_path -chown $user:$user $ftp_path -chmod 751 $ftp_path - -# Adding user +# Adding ftp user /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ @@ -97,15 +96,23 @@ ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" # Vesta # #----------------------------------------------------------# +# Concatenating ftp variables +if [ ! -z "$FTP_USER" ]; then + ftp_user="$FTP_USER:$ftp_user" + ftp_md5="$FTP_MD5:$ftp_md5" + ftp_path="$FTP_PATH:$ftp_path" +fi + +# Adding new key into web.conf +add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' + # Update config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" - -add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "added ftp account $ftp_user for $domain" +log_history "added ftp account ${1}_${3} for $domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-delete-web-domain-ftp b/bin/v-delete-web-domain-ftp index 2b776e304..9b0e83fbd 100755 --- a/bin/v-delete-web-domain-ftp +++ b/bin/v-delete-web-domain-ftp @@ -1,6 +1,6 @@ #!/bin/bash -# info: delete webdomain ftp account. -# options: USER DOMAIN +# info: delete webdomain ftp account +# options: USER DOMAIN FTP_USER # # The function deletes additional ftp account. @@ -13,6 +13,7 @@ user=$1 domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 # Includes source $VESTA/func/main.sh @@ -24,14 +25,19 @@ source $VESTA/conf/vesta.conf # Verifications # #----------------------------------------------------------# -check_args '2' "$#" 'USER DOMAIN' -validate_format 'user' 'domain' +check_args '3' "$#" 'USER DOMAIN FTP_USER' +validate_format 'user' 'domain' 'ftp_user' is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' is_object_valid 'user' 'USER' "$user" is_object_unsuspended 'user' 'USER' "$user" is_object_valid 'web' 'DOMAIN' "$domain" is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_exist 'web' 'DOMAIN' "$domain" '$FTP_USER' +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi #----------------------------------------------------------# @@ -39,20 +45,30 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$FTP_USER' #----------------------------------------------------------# # Deleting ftp user -get_domain_values 'web' -/usr/sbin/userdel -f $FTP_USER >> /dev/null 2>&1 +/usr/sbin/userdel -f $ftp_user >> /dev/null 2>&1 #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# +# Rebuild FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_user=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') +ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') +ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + # Update config -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' '' -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' '' +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "deleted ftp account $FTP_USER for $domain" +log_history "deleted ftp account ${3} for $domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains index d39b7aac8..95f061702 100755 --- a/bin/v-list-web-domains +++ b/bin/v-list-web-domains @@ -34,8 +34,8 @@ is_object_valid 'user' 'USER' "$user" conf=$USER_DATA/web.conf # Defining fileds to select -fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS" -fields="$fields \$STATS \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER" +fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS \$STATS" +fields="$fields \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER \$FTP_PATH" fields="$fields \$PROXY \$PROXY_EXT \$SUSPENDED \$TIME \$DATE" # Listing domains From 003959d6fcb2516af39a036c3eb9be4c3ac0bb01 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:20:42 +0300 Subject: [PATCH 19/84] Cleaned up dev stuff --- bin/v-change-user-language | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bin/v-change-user-language b/bin/v-change-user-language index 3bc437a84..22011151b 100755 --- a/bin/v-change-user-language +++ b/bin/v-change-user-language @@ -49,14 +49,6 @@ else update_user_value "$user" '$LANGUAGE' "$language" fi -exit -# Changing user contact email -old_email=$(get_user_value '$CONTACT') -update_user_value "$user" '$CONTACT' "$email" -pw_str=$(grep -n "^$user:" /etc/passwd) -str=$(echo "$pw_str" | cut -f 1 -d :) -sed -i "$str s/$old_email/$email/g" /etc/passwd - #----------------------------------------------------------# # Vesta # From d16a63056629d03cee7f6e898663df3ae577e367 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:21:40 +0300 Subject: [PATCH 20/84] multiple ftp account support --- bin/v-add-web-domain-ftp | 39 ++++++------ bin/v-change-web-domain-ftp-password | 71 ++++++++++++++++++++++ bin/v-change-web-domain-ftp-path | 89 ++++++++++++++++++++++++++++ bin/v-delete-web-domain | 10 +++- bin/v-delete-web-domain-ftp | 12 ++-- bin/v-list-web-domain | 6 +- 6 files changed, 203 insertions(+), 24 deletions(-) create mode 100755 bin/v-change-web-domain-ftp-password create mode 100755 bin/v-change-web-domain-ftp-path diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 06dc99cc6..be10e90b8 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -53,7 +53,7 @@ fi # Get domain values get_domain_values 'web' -# Define ftp user shell +# Defining ftp user shell if [ -z "$FTP_SHELL" ]; then shell='/sbin/nologin' if [ -e "/usr/bin/rssh" ]; then @@ -63,22 +63,22 @@ else shell=$FTP_SHELL fi -# Define path +# Defining path if [ -z "$ftp_path" ]; then - ftp_path="$HOMEDIR/$user/web/$domain" + ftp_path_a="$HOMEDIR/$user/web/$domain" else - # Validating path - ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") - if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then - echo "Error: path $ftp_path is invalid" + # Validating absolute path + ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") + if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: absolute path $ftp_path_a is invalid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi - # MKDIR if path doesn't exist - if [ ! -e $ftp_path ]; then - mkdir -p $ftp_path - chown $user:$user $ftp_path - chmod 751 $ftp_path + # Creating ftp user home directory + if [ ! -e "$ftp_path_a" ]; then + mkdir -p $ftp_path_a + chown $user:$user "$ftp_path_a" + chmod 751 "$ftp_path_a" fi fi @@ -87,32 +87,37 @@ fi -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$ftp_path" > /dev/null 2>&1 + -M -d "$ftp_path_a" > /dev/null 2>&1 + +# Set ftp user password echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd -ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" +ftp_md5=$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow) #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# +# Transforming absolute path to relative +ftp_path_r=$(echo $ftp_path_a |sed "s%$HOMEDIR/$user/web/$domain%%") + # Concatenating ftp variables if [ ! -z "$FTP_USER" ]; then ftp_user="$FTP_USER:$ftp_user" ftp_md5="$FTP_MD5:$ftp_md5" - ftp_path="$FTP_PATH:$ftp_path" + ftp_path="$FTP_PATH:$ftp_path_r" fi # Adding new key into web.conf add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' -# Update config +# Updating config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "added ftp account ${1}_${3} for $domain" +log_history "added ftp account ${1}_${3}@$domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-change-web-domain-ftp-password b/bin/v-change-web-domain-ftp-password new file mode 100755 index 000000000..c4cd90f98 --- /dev/null +++ b/bin/v-change-web-domain-ftp-password @@ -0,0 +1,71 @@ +#!/bin/bash +# info: change ftp user password. +# options: USER DOMAIN FTP_USER FTP_PASSWORD +# +# The function changes ftp user password. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +user=$1 +domain=$(idn -t --quiet -u "$2" ) +domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 +ftp_password=$4 + +# Includes +source $VESTA/func/main.sh +source $VESTA/func/domain.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' +validate_format 'user' 'domain' 'ftp_user' 'ftp_password' +is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' +is_object_valid 'user' 'USER' "$user" +is_object_unsuspended 'user' 'USER' "$user" +is_object_valid 'web' 'DOMAIN' "$domain" +is_object_unsuspended 'web' 'DOMAIN' "$domain" +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Changing ftp user password +echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd +ftp_md5=$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow) + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Rebuilding FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |\ + sed -e "s%^$position:.*%$position:$ftp_md5%" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + +# Updating config +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" + +# Logging +log_history "changed password for $ftp_user on $domain" +log_event "$OK" "$EVENT" + +exit diff --git a/bin/v-change-web-domain-ftp-path b/bin/v-change-web-domain-ftp-path new file mode 100755 index 000000000..f4489c0a1 --- /dev/null +++ b/bin/v-change-web-domain-ftp-path @@ -0,0 +1,89 @@ +#!/bin/bash +# info: change path for ftp user. +# options: USER DOMAIN FTP_USER FTP_PATH +# +# The function changes ftp user path. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +user=$1 +domain=$(idn -t --quiet -u "$2" ) +domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 +ftp_path=$4 + +# Includes +source $VESTA/func/main.sh +source $VESTA/func/domain.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PATH' +validate_format 'user' 'domain' 'ftp_user' +is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' +is_object_valid 'user' 'USER' "$user" +is_object_unsuspended 'user' 'USER' "$user" +is_object_valid 'web' 'DOMAIN' "$domain" +is_object_unsuspended 'web' 'DOMAIN' "$domain" +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi +ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") +if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: absolute path $ftp_path_a is invalid" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID +fi + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# MKDIR if path doesn't exist +if [ ! -e "$ftp_path_a" ]; then + mkdir -p "$ftp_path_a" + chown $user:$user "$ftp_path_a" + chmod 751 "$ftp_path_a" +fi + +# Chaning ftp user path +pw_str=$(grep -n "^$ftp_user:" /etc/passwd) +str=$(echo "$pw_str" | cut -f 1 -d :) +old_path=$(echo "$pw_str" | cut -f 7 -d :) +sed -i "$str s%$old_path%$ftp_path_a%g" /etc/passwd + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Transforming absolute path to relative +ftp_path_r=$(echo $ftp_path_a |sed "s%$HOMEDIR/$user/web/$domain%%") + +# Rebuilding FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |\ + sed -e "s%^$position:.*%$position:$ftp_path_r%" |\ + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') + +# Updating config +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" + +# Logging +log_history "changed path to $ftp_path_a for $ftp_user@$domain" +log_event "$OK" "$EVENT" + +exit diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain index 68c86d2fc..3ee9121d2 100755 --- a/bin/v-delete-web-domain +++ b/bin/v-delete-web-domain @@ -89,9 +89,15 @@ if [ ! -z "$STATS" ] && [ "$STATS" != 'no' ]; then rm -f /etc/awstats/$STATS.$domain.conf fi -# Deleting ftp account +# Deleting ftp users if [ ! -z "$FTP_USER" ]; then - /usr/sbin/userdel -f $FTP_USER >> /dev/null 2>&1 + for ftp_user in ${FTP_USER//:/ }; do + /usr/sbin/userdel $ftp_user >> /dev/null 2>&1 + if [ "$?" != 0 ]; then + sed -i "/^$ftp_user:/d" /etc/passwd + sed -i "/^$ftp_user:/d" /etc/shadow + fi + done fi # Deleting directory diff --git a/bin/v-delete-web-domain-ftp b/bin/v-delete-web-domain-ftp index 9b0e83fbd..01b8ac479 100755 --- a/bin/v-delete-web-domain-ftp +++ b/bin/v-delete-web-domain-ftp @@ -45,22 +45,26 @@ fi #----------------------------------------------------------# # Deleting ftp user -/usr/sbin/userdel -f $ftp_user >> /dev/null 2>&1 +/usr/sbin/userdel $ftp_user >> /dev/null 2>&1 +if [ "$?" != 0 ]; then + sed -i "/^$ftp_user:/d" /etc/passwd + sed -i "/^$ftp_user:/d" /etc/shadow +fi #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# -# Rebuild FTP variables +# Rebuilding FTP variables position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ cut -f 1 -d:) ftp_user=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ - cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ - cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') # Update config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" diff --git a/bin/v-list-web-domain b/bin/v-list-web-domain index 9a8ea34d7..8a1c794de 100755 --- a/bin/v-list-web-domain +++ b/bin/v-list-web-domain @@ -76,7 +76,11 @@ conf=$USER_DATA/web.conf # Defining fileds to select fields='$DOMAIN $IP $IP6 $U_DISK $U_BANDWIDTH $TPL $ALIAS $STATS $STATS_USER - $SSL $SSL_HOME $FTP_USER $PROXY $PROXY_EXT $SUSPENDED $TIME $DATE' + $SSL $SSL_HOME $FTP_USER $FTP_PATH $PROXY $PROXY_EXT $DOCUMENT_ROOT + $SUSPENDED $TIME $DATE' + +# Defining document root +DOCUMENT_ROOT="$HOMEDIR/$user/web/$domain/public_html" # Listing domains case $format in From 90a75b1aed6edeaa75f55a1c0982af137fb69f49 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:22:24 +0300 Subject: [PATCH 21/84] foricble user deletition --- bin/v-delete-user | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/v-delete-user b/bin/v-delete-user index d05cc7d9d..07efd7496 100755 --- a/bin/v-delete-user +++ b/bin/v-delete-user @@ -89,8 +89,14 @@ fi sed -i "/ $user$/d" $VESTA/data/queue/disk.pipe sed -i "/ $user$/d" $VESTA/data/queue/traffic.pipe -# Removing system user -/usr/sbin/userdel -f $user +# Deleting system user +/usr/sbin/userdel -f $user >> /dev/null 2>&1 +if [ "$?" != 0 ]; then + sed -i "/^$user:/d" /etc/passwd + sed -i "/^$user:/d" /etc/shadow +fi + +# Deleting user directories chattr -i $HOMEDIR/$user/conf rm -rf $HOMEDIR/$user rm -f /var/spool/mail/$user From 6e20e88330beff34b207169f97380a6b1afebd2a Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:23:05 +0300 Subject: [PATCH 22/84] deprecated function --- bin/v-change-web-domain-ftp | 63 ------------------------------------- 1 file changed, 63 deletions(-) delete mode 100755 bin/v-change-web-domain-ftp diff --git a/bin/v-change-web-domain-ftp b/bin/v-change-web-domain-ftp deleted file mode 100755 index a69cf510e..000000000 --- a/bin/v-change-web-domain-ftp +++ /dev/null @@ -1,63 +0,0 @@ -#!/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/func/main.sh -source $VESTA/func/domain.sh -source $VESTA/conf/vesta.conf - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' -validate_format 'user' 'domain' 'ftp_user' 'ftp_password' -is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' -is_object_valid 'user' 'USER' "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_empty 'web' 'DOMAIN' "$domain" '$FTP_USER' - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Adding user -/usr/sbin/adduser $ftp_user -g $user -s /sbin/nologin -M \ - -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 -echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd - -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 From 667ae61355a5c5796cc00f6dd8c4288a22681689 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 14:42:13 +0300 Subject: [PATCH 23/84] Fix webstats analyzer on Ubuntu 14.04 --- bin/v-add-web-domain-stats | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/v-add-web-domain-stats b/bin/v-add-web-domain-stats index 5d6056d18..8ee057618 100755 --- a/bin/v-add-web-domain-stats +++ b/bin/v-add-web-domain-stats @@ -52,20 +52,20 @@ upd_web_domain_values # Adding statistic config cat $WEBTPL/$type/$type.tpl |\ - sed -e "s/%ip%/$ip/g" \ - -e "s/%web_port%/$WEB_PORT/g" \ - -e "s/%web_system%/$WEB_SYSTEM/g" \ - -e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \ - -e "s/%rgroups%/$WEB_RGROUPS/g" \ - -e "s/%proxy_system%/$PROXY_SYSTEM/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" \ + sed -e "s|%ip%|$ip|g" \ + -e "s|%web_port%|$WEB_PORT|g" \ + -e "s|%web_system%|$WEB_SYSTEM|g" \ + -e "s|%web_ssl_port%|$WEB_SSL_PORT|g" \ + -e "s|%rgroups%|$WEB_RGROUPs|g" \ + -e "s|%proxy_system%|$PROXY_SYSTEM|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/$type.$domain.conf if [ "$type" == 'awstats' ]; then From 62c05fb08f368a69f89539ee8399ad5871148a17 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 14:55:29 +0300 Subject: [PATCH 24/84] Fix MySQL autostart issue on Ubuntu 14.04 --- install/vst-install-ubuntu.sh | 4 +++- src/deb/vesta/postinst | 5 +++++ upd/fix_mysql_startup.sh | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 upd/fix_mysql_startup.sh diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index b40d4f8d9..74f4b4cf6 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -601,7 +601,9 @@ fi mpass=$(gen_pass) wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf mysql_install_db -update-rc.d mysql defaults +if [ "$release" != '14.04' ]; then + update-rc.d mysql defaults +fi service mysql stop > /dev/null 2>&1 service mysql start if [ "$?" -ne 0 ]; then diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index 0673f3b6b..7559a345e 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -15,4 +15,9 @@ if [ -x "/usr/local/vesta/upd/fix_vesta_ssl_permissions.sh" ]; then /usr/local/vesta/upd/fix_vesta_ssl_permissions.sh fi +# Run MySQL autostart fixed +if [ -x "/usr/local/vesta/upd/fix_mysql_startup.sh" ]; then + /usr/local/vesta/upd/fix_mysql_startup.sh +fi + exit 0 diff --git a/upd/fix_mysql_startup.sh b/upd/fix_mysql_startup.sh new file mode 100755 index 000000000..33684f134 --- /dev/null +++ b/upd/fix_mysql_startup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Fix MySQL autostart for Ubuntu 14.04 +if [ -e "/etc/issue" ]; then + release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' ) + if [ "$release" = '14.04' ]; then + update-rc.d mysql disable + fi +fi + +exit From f851da5db1815c4a304ae847c00e170ea66b4480 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 16:05:14 +0300 Subject: [PATCH 25/84] Fix backup exclusion for cron --- bin/v-update-user-backup-exclusions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-user-backup-exclusions b/bin/v-update-user-backup-exclusions index 7cb2f6678..898a1d55b 100755 --- a/bin/v-update-user-backup-exclusions +++ b/bin/v-update-user-backup-exclusions @@ -67,7 +67,7 @@ echo "WEB='$WEB'" > $USER_DATA/backup-excludes.conf echo "DNS='$DNS'" >> $USER_DATA/backup-excludes.conf echo "MAIL='$MAIL'" >> $USER_DATA/backup-excludes.conf echo "DB='$DB'" >> $USER_DATA/backup-excludes.conf -echo "CRON='$DB'" >> $USER_DATA/backup-excludes.conf +echo "CRON='$CRON'" >> $USER_DATA/backup-excludes.conf echo "USER='$USER'" >> $USER_DATA/backup-excludes.conf chmod 660 $USER_DATA/backup-excludes.conf From 6d4da8dfe5aad934ea80c79713db2ccc7394980b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 19:02:04 +0300 Subject: [PATCH 26/84] fixed remote port for dns-cluster --- bin/v-add-remote-dns-host | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/v-add-remote-dns-host b/bin/v-add-remote-dns-host index 9562840c3..835f97f36 100755 --- a/bin/v-add-remote-dns-host +++ b/bin/v-add-remote-dns-host @@ -16,8 +16,6 @@ user=$3 password=$4 type=${5-api} dns_user=${6-dns-cluster} - -# fix for variable name in other files DNS_USER=$dns_user # Includes @@ -45,9 +43,10 @@ is_dnshost_alive # Action # #----------------------------------------------------------# -# Concatentating db host string -str="HOST='$host' USER='$user' PASSWORD='$password' DNS_USER='$dns_user'" -str="$str TYPE='$type' SUSPENDED='no' TIME='$TIME' DATE='$DATE'" +# Concatentating dns host string +str="HOST='$host' PORT='$port' USER='$user' PASSWORD='$password'" +str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'" +str="$str TIME='$TIME' DATE='$DATE'" # Adding host to dns-cluster.conf echo "$str" >> $VESTA/conf/dns-cluster.conf From b985c7ad9c86fe733788f96774e82c9ed7b2ea58 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 7 Jul 2014 00:22:27 +0300 Subject: [PATCH 27/84] Fix for tar < 1.24 to preserve directory ownership --- bin/v-restore-user | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/v-restore-user b/bin/v-restore-user index 1615e6ce6..5971ca836 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -363,11 +363,16 @@ if [ "$web" != 'no' ]; then exit $E_PARSING fi + # Fix for tar < 1.24 + find $HOMEDIR/$user/web/$domain -type d \ + -exec chown -h $user:$user {} \; + # ReChown files if uid differs if [ "$old_uid" -ne "$new_uid" ]; then find $HOMEDIR/$user/web/$domain/ -user $old_uid \ -exec chown -h $user:$user {} \; fi + done # Restart WEB From e4dd091f37d4147d46776d73224a7abfc83f7551 Mon Sep 17 00:00:00 2001 From: RJuho Date: Mon, 7 Jul 2014 13:21:22 +0300 Subject: [PATCH 28/84] Create fi.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --English-- This is Vesta Finnish translation. Made by Juho Räsänen juho.rasanen@kotikone.fi --Finnish-- Tämä on Vesta Suomennos. Tehnyt Juho Räsänen juho.rasanen@kotikone.fi License GPLv3 --- web/inc/i18n/fi.php | 441 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 web/inc/i18n/fi.php diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php new file mode 100644 index 000000000..caaf8967d --- /dev/null +++ b/web/inc/i18n/fi.php @@ -0,0 +1,441 @@ + 'Paketit', + 'IP' => 'IP', + 'Graphs' => 'Kaaviot', + 'Statistics' => 'Tilastot', + 'Log' => 'Loki', + 'Services' => 'Palvelut', + 'Updates' => 'Päivitykset', + 'Log in' => 'Kirjaudu sisään', + 'Log out' => 'Kirjaudu ulos', + + 'USER' => 'KAYTTÄJÄ', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'EMAIL', + 'DB' => 'DB', + 'CRON' => 'CRON', + 'BACKUP' => 'VARMUUSKOPIOT', + + 'Add User' => 'Lisää käyttäjä', + 'Add Domain' => 'Lisää domaini', + 'Add Web Domain' => 'Lisää Web domain', + 'Add DNS Domain' => 'Lisää DNS domain', + 'Add DNS Record' => 'Lisää DNS asetus', + 'Add Mail Domain' => 'Lisää email domain', + 'Add Mail Account' => 'Lisää email käyttäjä', + 'Add Database' => 'Lisää tietokanta', + 'Add Cron Job' => 'Lisää Cron ajoitus', + 'Create Backup' => 'Luo varmuuskopio', + 'Configure' => 'Määritä', + 'Restore All' => 'Palauta kaikki', + 'Add Package' => 'Lisää paketti', + 'Add IP' => 'Lisää IP', + 'Search' => 'Haku', + 'Overall Statistics' => 'Yleiset tilastot', + 'Daily' => 'Päivittäin', + 'Weekly' => 'Viikottain', + 'Monthly' => 'Kuukausittain', + 'Yearly' => 'Vuosittain', + 'Add' => 'Lisää', + 'Back' => 'Takaisin', + 'Save' => 'Tallenna', + 'Submit' => 'Lähetä', + + 'toggle all' => 'vaihda kaikki', + 'apply to selected' => 'toteuta valituissa', + 'rebuild' => 'palauta', + 'rebuild web' => 'palauta web', + 'rebuild dns' => 'palauta dns', + 'rebuild mail' => 'palauta email', + 'rebuild db' => 'palauta db', + 'rebuild cron' => 'palauta cron', + 'update counters' => 'päivitä laskurit', + 'suspend' => 'keskeytä', + 'unsuspend' => 'älä keskeytä', + 'delete' => 'poista', + 'show per user' => 'näytä per käyttäjä', + 'login as' => 'kirjautunut', + 'logout' => 'kirjaudu ulos', + 'edit' => 'muokkaa', + 'open webstats' => 'avaa web tilastot', + 'view logs' => 'näytä lokit', + 'list records' => 'list %s records', //think + 'add record' => 'add record', //think + 'list accounts' => 'listaa %s käyttäjää', + 'add account' => 'lisää käyttäjä', + 'open webmail' => 'avaa webmail', + 'open %s' => 'avaa %s', + 'download' => 'lataa', + 'restore' => 'palauta', + 'configure restore settings' => 'määritä palautus asetukset', + 'stop' => 'pysäytä', + 'start' => 'aloita', + 'restart' => 'käynnistä uudelleen', + 'update' => 'päivitä', + 'generate' => 'generoi', + 'Generate CSR' => 'generoi CSR', + 'reread IP' => 'reread IP', //think + 'enable autoupdate' => 'päivitä automaattisesti', + 'disable autoupdate' => 'älä päivitä automaattisesti', + + 'Adding User' => 'Lisätään käyttäjää', + 'Editing User' => 'Muokataan käyttäjää', + 'Adding Domain' => 'Lisätään domainia', + 'Editing Domain' => 'Muokataan domainia', + 'Adding DNS Domain' => 'Lisätään DNS domainia', + 'Editing DNS Domain' => 'Muokataan DNS domainia', + 'Adding DNS Record' => 'Lisätään DNS asetusta', + 'Editing DNS Record' => 'Muokataan DNS asetusta', + 'Adding Mail Domain' => 'Lisätään email domainia', + 'Editing Mail Domain' => 'Muokataan email domainia', + 'Adding Mail Account' => 'Lisätään email käyttäjää', + 'Editing Mail Account' => 'Muokataan email läyttäjää', + 'Adding database' => 'Lisätään tietokantaa', + 'Editing Cron Job' => 'Muokataan Cron tehtävää', + 'Adding Cron Job' => 'Lisätään Cron tehtävää', + 'Editing Database' => 'Muokataan tietokantaa', + 'Adding Package' => 'Lisätään pakettia', + 'Editing Package' => 'Muokataan pakettia', + 'Adding IP address' => 'Lisätään IP osoitetta', + 'Editing IP Address' => 'Muokataan IP osoitetta', + 'Editing Backup Exclusions' => 'Editing Backup Exclusions', //think + 'Generating CSR' => 'Generoidaan CSR', + 'Listing' => 'Listataan', + 'Search Results' => 'Haku tulokset', + + 'active' => 'aktiivinen', + 'spnd' => 'keskeytetty', + 'suspended' => 'keskeytetty', + 'running' => 'käynnissä', + 'stopped' => 'pysäytetty', + 'outdated' => 'vanhentunut', + 'updated' => 'päivitetty', + + 'yes' => 'kyllä', + 'no' => 'ei', + 'none' => 'ei mitään', + 'pb' => 'pb', //? + 'tb' => 'tb', //? + 'gb' => 'gb', //? + 'mb' => 'mb', //? + 'minute' => 'minuutti', + 'hour' => 'tunti', + 'day' => 'päivä', + 'days' => 'päivät', + 'hours' => 'tunnit', + 'minutes' => 'minuutit', + 'month' => 'kuukausi', + 'package' => 'paketti', + 'Bandwidth' => 'Kaistanleveys', + 'Disk' => 'Levy', + 'Web' => 'Web', + 'Mail' => 'EMail', + 'Databases' => 'Tietokannat', + 'User Directories' => 'Käyttäjähakemistot', + 'Template' => 'Teema', + 'Web Template' => 'Apache teema', + 'Proxy Template' => 'Nginx teema', + 'DNS Template' => 'DNS teema', + 'Web Domains' => 'Web domainit', + 'SSL Domains' => 'SSL domainit', + 'Web Aliases' => 'Web aliakset', + 'per domain' => 'per domaini', + 'DNS domains' => 'DNS domainit', + 'DNS domains' => 'DNS domainit', + 'DNS records' => 'DNS records' , //think + 'Name Servers' => 'Nimipalvelimet', + 'Mail Domains' => 'EMail Domainit', + 'Mail Accounts' => 'EMail käyttäjät', + 'Cron Jobs' => 'Cron tehtävät', + 'SSH Access' => 'SSH oikeudet', + 'IP Addresses' => 'IP osoitteet', + 'Backups' => 'Varmuuskopiot', + 'Backup System' => 'Backup järjestelmä', + 'backup exclusions' => 'varmuuskopio poikkeukset', + 'template' => 'teema', + 'SSL Support' => 'SSL tuki', + 'SSL Home Directory' => 'SSL koti', + 'Proxy Support' => 'Nginx tuki', + 'Proxy Extensions' => 'Nginx laajennukset', + 'Web Statistics' => 'Web tilastot', + 'Additional FTP Account' => 'Ylimääräinen FTP', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Päättyy', + 'Records' => 'Merkinnät', //ready + 'Catchall email' => 'Catchall email', + 'AntiVirus Support' => 'AntiVirus Support', + 'AntiSpam Support' => 'AntiSpam Support', + 'DKIM Support' => 'DKIM Support', + 'Accounts' => 'Accounts', + 'Quota' => 'Quota', + 'Autoreply' => 'Autoreply', + 'Forward to' => 'Forward to', + 'Do not store forwarded mail' => 'Do not store forwarded mail', + 'database' => 'database', + 'User' => 'User', + 'Host' => 'Host', + 'Charset' => 'Charset', + 'Min' => 'Min', + 'Hour' => 'Hour', + 'Day' => 'Day', + 'Month' => 'Month', + 'Day of week' => 'Day of week', + 'local' => 'local', + 'Run Time' => 'Run Time', + 'Backup Size' => 'Backup Size', + 'SYS' => 'SYS', + 'Domains' => 'Domains', + 'Status' => 'Status', + 'shared' => 'shared', + 'dedicated' => 'dedicated', + 'Owner' => 'Owner', + 'Users' => 'Users', + 'Load Average' => 'Load Average', + 'Memory Usage' => 'Memory Usage', + 'HTTPD Usage' => 'HTTPD Usage', + 'NGINX Usage' => 'NGINX Usage', + 'MySQL Usage on localhost' => 'MySQL Usage on localhost', + 'PostgreSQL Usage on localhost' => 'PostgreSQL Usage on localhost', + 'Bandwidth Usage eth0' => 'Bandwidth Usage eth0', + 'FTP Usage' => 'FTP Usage', + 'SSH Usage' => 'SSH Usage', + 'reverse proxy' => 'reverse proxy', + 'web server' => 'web server', + 'dns server' => 'dns server', + 'mail server' => 'mail server', + 'pop/imap server' => 'pop/imap server', + 'email antivirus' => 'email antivirus', + 'email antispam' => 'email antispam', + 'database server' => 'database server', + 'ftp server' => 'ftp server', + 'job scheduler' => 'job scheduler', + 'CPU' => 'CPU', + 'Memory' => 'Memory', + 'Uptime' => 'Uptime', + 'core package' => 'core package', + 'php interpreter' => 'php interpreter', + 'internal web server' => 'internal web server', + 'Version' => 'Version', + 'Release' => 'Release', + 'Architecture' => 'Architecture', + 'Object' => 'Object', + 'Owner' => 'Owner', + 'Username' => 'Username', + 'Password' => 'Password', + 'Email' => 'Email', + 'Package' => 'Package', + 'Language' => 'Language', + 'First Name' => 'First Name', + 'Last Name' => 'Last Name', + 'Send login credentials to email address' => 'Send login credentials to email address', + 'Default Template' => 'Default Template', + 'Default Name Servers' => 'Default Name Servers', + 'Domain' => 'Domain', + 'DNS Support' => 'DNS Support', + 'Mail Support' => 'Mail Support', + 'Advanced options' => 'Advanced options', + 'Aliases' => 'Aliases', + 'SSL Certificate' => 'SSL Certificate', + 'SSL Key' => 'SSL Key', + 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', + 'SSL CSR' => 'SSL CSR', + 'optional' => 'optional', + 'internal' => 'internal', + 'Statistics Authorization' => 'Statistics Authorization', + 'Statistics Auth' => 'Statistics Auth', + 'Account' => 'Account', + 'Prefix will be automaticaly added to username' => 'Prefix %s will be automaticaly added to username', + 'Send FTP credentials to email' => 'Send FTP credentials to email', + 'Expiration Date' => 'Expiration Date', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'Name servers', + 'Record' => 'Record', + 'IP or Value' => 'IP or Value', + 'Priority' => 'Priority', + 'Record Number' => 'Record Number', + 'in megabytes' => 'in megabytes', + 'Message' => 'Message', + 'use local-part' => 'use local-part', + 'one or more email addresses' => 'one or more email addresses', + 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user', + 'Database' => 'Database', + 'Type' => 'Type', + 'Minute' => 'Minute', + 'Command' => 'Command', + 'Package Name' => 'Package Name', + 'Netmask' => 'Netmask', + 'Interface' => 'Interface', + 'Shared' => 'Shared', + 'Assigned user' => 'Assigned user', + 'Assigned domain' => 'Assigned domain', + 'NAT IP association' => 'NAT IP association', + 'shell' => 'shell', + 'web domains' => 'web domains', + 'web aliases' => 'web aliases', + 'dns records' => 'dns records', + 'mail domains' => 'mail domains', + 'mail accounts' => 'mail accounts', + 'accounts' => 'accounts', + 'databases' => 'databases', + 'cron jobs' => 'cron jobs', + 'backups' => 'backups', + 'quota' => 'quota', + 'day of week' => 'day of week', + 'cmd' => 'cmd', + 'users' => 'users', + 'domains' => 'domains', + 'aliases' => 'aliases', + 'records' => 'records', + 'jobs' => 'jobs', + 'username' => 'username', + 'password' => 'password', + 'type' => 'type', + 'charset' => 'charset', + 'domain' => 'domain', + 'ip' => 'ip', + 'ip address' => 'ip address', + 'IP address' => 'IP address', + 'netmask' => 'netmask', + 'interface' => 'interface', + 'assigned user' => 'assigned user', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'user', + 'email' => 'email', + 'first name' => 'first name', + 'last name' => 'last name', + 'account' => 'account', + 'ssl certificate' => 'ssl certificate', + 'ssl key' => 'ssl key', + 'stats user password' => 'stats user password', + 'stats username' => 'stats username', + 'stats password' => 'stats password', + 'ftp user password' => 'ftp user password', + 'ftp user' => 'ftp user', + 'Last 70 lines of %s.%s.log' => 'Last 70 lines of %s.%s.log', + 'Download AccessLog' => 'Download AccessLog', + 'Download ErrorLog' => 'Download ErrorLog', + 'Country' => 'Country', + '2 letter code' => '2 letter code', + 'State / Province' => 'State / Province', + 'City / Locality' => 'City / Locality', + 'Organization' => 'Organization', + + '1 account' => '1 account', + '%s accounts' => '%s accounts', + '1 domain' => '1 domain', + '%s domains' => '%s domains', + '1 record' => '1 record', + '%s records' => '%s records', + '1 mail account' => '1 mail account', + '%s mail accounts' => '%s mail accounts', + '1 database' => '1 database', + '%s databases' => '%s databases', + '1 cron job' => '1 cron job', + '%s cron jobs' => '%s cron jobs', + '1 archive' => '1 archive', + '%s archives' => '%s archives', + '1 package' => '1 package', + '%s packages' => '%s packages', + '1 IP address' => '1 IP address', + '%s IP addresses' => '%s IP addresses', + '1 month' => '1 month', + '%s months' => '%s months', + '1 log record' => '1 log record', + '%s log records' => '%s log records', + '1 object' => '1 object', + '%s objects' => '%s objects', + 'no exclusions' => 'no exclusions', + + 'USER_CREATED_OK' => 'User %s has been created successfully', + 'WEB_DOMAIN_CREATED_OK' => 'Domain %s has been created successfully.', + 'DNS_DOMAIN_CREATED_OK' => 'DNS domain %s has been created successfully.', + 'DNS_RECORD_CREATED_OK' => 'Record %s.%s has been created successfully.', + 'MAIL_DOMAIN_CREATED_OK' => 'Mail domain %s has been created successfully.', + 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully', + 'DATABASE_CREATED_OK' => 'Database %s has been created successfully', + 'CRON_CREATED_OK' => 'Cron job has been created successfully.', + 'IP_CREATED_OK' => 'IP address %s has been created successfully.', + 'PACKAGE_CREATED_OK' => 'Package %s has been created successfully.', + 'SSL_GENERATED_OK' => 'Certificate has been generated successfully.', + 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled', + 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled', + 'Changes has been saved.' => 'Changes has been saved.', + 'Confirmation' => 'Confirmation', + 'DELETE_USER_CONFIRMATION' => 'Are you sure to delete user %s?', + 'SUSPEND_USER_CONFIRMATION' => 'Are you sure to suspend user %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure to unsuspend user %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure to delete domain %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to suspend domain %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to unsuspend domain %s?', + 'DELETE_RECORD_CONFIRMATION' => 'Are you sure to delete record %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure to suspend record %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure to unsuspend record %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to delete %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to suspend %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to unsuspend %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure to delete database %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to suspend database %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to unsuspend database %s?', + 'DELETE_CRON_CONFIRMATION' => 'Are you sure to delete cron job?', + 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure to suspend cron job?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure to unsuspend cron job?', + 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure to delete %s backup?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure to delete %s exclusion?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure to delete package %s?', + 'DELETE_IP_CONFIRMATION' => 'Are you sure to delere IP address %s?', + 'Welcome' => 'Welcome', + 'LOGGED_IN_AS' => 'Logged in as user %s', + 'Error' => 'Error', + 'Invalid username or password' => 'Invalid username or password', + 'Invalid username or code' => 'Invalid username or code', + 'Passwords not match' => 'Passwords not match', + 'Please enter valid email address.' => 'Please enter valid email address.', + 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', + 'Password is too short.' => 'Password is too short (minimum is 6 characters)', + 'Error code:' => 'Error code: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" failed', + 'IP address is in use' => 'IP address is in use', + 'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', + 'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.', + 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', + 'RESTORE_EXISTS' => 'An existing restoration task is already running. Please wait for it to finish before launching it again.', + + 'WEB_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific dirs use following format: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *", + 'MAIL_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific accounts use following format: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Type full database name, one per line. To exclude all databases use *", + 'CRON_EXCLUSIONS' => "To exclude all jobs use *", + 'USER_EXCLUSIONS' => "Type directory name, one per line. To exlude all dirs use *", + + 'Welcome to Vesta Control Panel' => 'Welcome to Vesta Control Panel', + 'MAIL_FROM' => 'Vesta Control Panel ', + 'GREETINGS_GORDON_FREEMAN' => "Hello, %s %s,\n", + 'GREETINGS' => "Hello,\n", + 'ACCOUNT_READY' => "Your account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'FTP login credentials' => 'FTP login credentials', + 'FTP_ACCOUNT_READY' => "FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'Database Credentials' => 'Database Credentials', + 'DATABASE_READY' => "Database has been created successfully.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", + + 'forgot password' => 'forgot password', + 'Confirm' => 'Confirm', + 'New Password' => 'New Password', + 'Confirm Password' => 'Confirm Password', + 'Reset' => 'Reset', + 'Reset Code' => 'Reset Code', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'Password reset code has been sent to your email address
', + 'MAIL_RESET_SUBJECT' => 'Password Reset at %s', + 'PASSWORD_RESET_REQUEST' => "To reset your control panel password, please follow this link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, you may go to https://%s/reset/?action=code&user=%s and enter the following reset code:\n%s\n\nIf you did not request password reset, please ignore this message and accept our apologies.\n\n--\nVesta Control Panel\n", +); From 2b40f8422c29b0ac3f5635da728efbd5f70e4a47 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Jul 2014 14:34:49 +0300 Subject: [PATCH 29/84] removed debug info on quota set --- bin/v-add-user | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/v-add-user b/bin/v-add-user index 732fde24e..9fb122319 100755 --- a/bin/v-add-user +++ b/bin/v-add-user @@ -207,7 +207,6 @@ chmod 660 $USER_DATA/user.conf # Updating quota if [ "$DISK_QUOTA" = 'yes' ]; then - echo "Setting quota" $BIN/v-update-user-quota "$user" fi From d083b12153a26a2f8b78ba606ac1bde1ac31fa6c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Jul 2014 14:35:11 +0300 Subject: [PATCH 30/84] Urlencoder for DNS Cluster API --- func/remote.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/func/remote.sh b/func/remote.sh index 8f386594a..61b050065 100644 --- a/func/remote.sh +++ b/func/remote.sh @@ -6,11 +6,21 @@ send_api_cmd() { USER=admin fi - auth="user=$USER&password=$PASSWORD&returncode=yes" - cmd="cmd=$1" - args="arg1=$2&arg2=$3&arg3=$4&arg4=$5&arg5=$6&arg6=$7&arg7=$8&arg8=$9" - args=$(echo "$args" |sed -e "s/+/%2B/g") - answer=$(curl -s -k --data "$auth&$cmd&$args" https://$HOST:$PORT/api/) + answer=$(curl -s -k \ + --data-urlencode "user=$USER" \ + --data-urlencode "password=$PASSWORD" \ + --data-urlencode "returncode=yes" \ + --data-urlencode "cmd=$1" \ + --data-urlencode "arg1=$2" \ + --data-urlencode "arg2=$3" \ + --data-urlencode "arg3=$4" \ + --data-urlencode "arg4=$5" \ + --data-urlencode "arg5=$6" \ + --data-urlencode "arg6=$7" \ + --data-urlencode "arg7=$8" \ + --data-urlencode "arg8=$9" \ + https://$HOST:$PORT/api/) + if [ "$answer" != '0' ]; then return 1 else @@ -90,7 +100,7 @@ is_dnshost_alive() { $send_cmd v-list-sys-config if [ $? -ne 0 ]; then echo "Error: $type connection to $HOST failed" - log_event "$E_CONNECT $EVENT" + log_event "$E_CONNECT" "$EVENT" exit $E_CONNECT fi @@ -104,7 +114,7 @@ is_dnshost_alive() { $send_cmd v-list-user $DNS_USER if [ $? -ne 0 ]; then echo "Error: dns user $DNS_USER doesn't exist" - log_event "$E_NOTEXIST $EVENT" + log_event "$E_NOTEXIST" "$EVENT" exit $E_NOTEXIST fi } @@ -146,7 +156,7 @@ remote_dns_health_check() { echo -e "\n\n--\nVesta Control Panel\n$(hostname)" >> $tmpfile cat $tmpfile | $send_mail -s "$subj" $email - log_event "$E_CONNECT $EVENT" + log_event "$E_CONNECT" "$EVENT" dconf="../../../conf/dns-cluster" update_object_value "$dconf" 'HOST' "$HOST" '$SUSPENDED' 'yes' fi From 00ac4d2e533f0bc02f45d4e64a4c1a0521fab51a Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 8 Jul 2014 14:27:16 +0200 Subject: [PATCH 31/84] Traduzione Italiano 1a Parte --- web/inc/i18n/it.php | 441 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 web/inc/i18n/it.php diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php new file mode 100644 index 000000000..25da698dd --- /dev/null +++ b/web/inc/i18n/it.php @@ -0,0 +1,441 @@ + 'Pacchetti', + 'IP' => 'IP', + 'Graphs' => 'Grafici', + 'Statistics' => 'Statistiche', + 'Log' => 'Log', + 'Services' => 'Servizi', + 'Updates' => 'Aggiornamenti', + 'Log in' => 'Log in', + 'Log out' => 'Log out', + + 'USER' => 'USER', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'MAIL', + 'DB' => 'DB', + 'CRON' => 'CRON', + 'BACKUP' => 'BACKUP', + + 'Add User' => 'Aggiungi User', + 'Add Domain' => 'Aggiungi Dominio', + 'Add Web Domain' => 'Aggiungio Dominio Web', + 'Add DNS Domain' => 'Aggiungi Dominio DNS', + 'Add DNS Record' => 'Aggiungi Record DNS', + 'Add Mail Domain' => 'Aggiungi Dominio Mail', + 'Add Mail Account' => 'Aggiungi Account Mail', + 'Add Database' => 'Addiungi Database', + 'Add Cron Job' => 'Aggiungi Cron Job', + 'Create Backup' => 'Crea Backup', + 'Configure' => 'Configura', + 'Restore All' => 'Ripristina Tutto', + 'Add Package' => 'Aggiungi Pacchetto', + 'Add IP' => 'Aggiungi IP', + 'Search' => 'Cerca', + 'Overall Statistics' => 'Statistiche Generali', + 'Daily' => 'Giornaliere', + 'Weekly' => 'Settimanali', + 'Monthly' => 'Mensili', + 'Yearly' => 'Annuali', + 'Add' => 'Aggiungi', + 'Back' => 'Indietro', + 'Save' => 'Salva', + 'Submit' => 'Invia', + + 'toggle all' => 'inverti tutti', + 'apply to selected' => 'applica ai selezionati', + 'rebuild' => 'ricostruisci', + 'rebuild web' => 'ricostruisci web', + 'rebuild dns' => 'ricostruisci dns', + 'rebuild mail' => 'ricostruisci mail', + 'rebuild db' => 'ricostruisci db', + 'rebuild cron' => 'ricostruisci cron', + 'update counters' => 'aggiorna contatori', + 'suspend' => 'sospendi', + 'unsuspend' => 'riabilita', + 'delete' => 'cancella', + 'show per user' => 'mostra per utente', + 'login as' => 'accedi come', + 'logout' => 'logout', + 'edit' => 'modifica', + 'open webstats' => 'apri webstats', + 'view logs' => 'visualizza logs', + 'list records' => 'list %s records', + 'add record' => 'add record', + 'list accounts' => 'mostra %s accounts', + 'add account' => 'aggiungi account', + 'open webmail' => 'apri webmail', + 'open %s' => 'apri %s', + 'download' => 'download', + 'restore' => 'ripristina', + 'configure restore settings' => 'configure restore settings', + 'stop' => 'ferma', + 'start' => 'avvia', + 'restart' => 'riavvia', + 'update' => 'aggiorna', + 'generate' => 'genera', + 'Generate CSR' => 'Generate CSR', + 'reread IP' => 'reread IP', + 'enable autoupdate' => 'abilita aggiornamenti automatici', + 'disable autoupdate' => 'disabilita aggiornamenti automatici', + + 'Adding User' => 'Adding User', + 'Editing User' => 'Editing User', + 'Adding Domain' => 'Adding Domain', + 'Editing Domain' => 'Editing Domain', + 'Adding DNS Domain' => 'Adding DNS Domain', + 'Editing DNS Domain' => 'Editing DNS Domain', + 'Adding DNS Record' => 'Adding DNS Record', + 'Editing DNS Record' => 'Editing DNS Record', + 'Adding Mail Domain' => 'Adding Mail Domain', + 'Editing Mail Domain' => 'Editing Mail Domain', + 'Adding Mail Account' => 'Adding Mail Account', + 'Editing Mail Account' => 'Editing Mail Account', + 'Adding database' => 'Adding database', + 'Editing Cron Job' => 'Editing Cron Job', + 'Adding Cron Job' => 'Adding Cron Job', + 'Editing Database' => 'Editing Database', + 'Adding Package' => 'Adding Package', + 'Editing Package' => 'Editing Package', + 'Adding IP address' => 'Adding IP address', + 'Editing IP Address' => 'Editing IP Address', + 'Editing Backup Exclusions' => 'Editing Backup Exclusions', + 'Generating CSR' => 'Generating CSR', + 'Listing' => 'Listing', + 'Search Results' => 'Search Results', + + 'active' => 'active', + 'spnd' => 'suspended', + 'suspended' => 'suspended', + 'running' => 'running', + 'stopped' => 'stopped', + 'outdated' => 'outdated', + 'updated' => 'updated', + + 'yes' => 'yes', + 'no' => 'no', + 'none' => 'none', + 'pb' => 'pb', + 'tb' => 'tb', + 'gb' => 'gb', + 'mb' => 'mb', + 'minute' => 'minute', + 'hour' => 'hour', + 'day' => 'day', + 'days' => 'days', + 'hours' => 'hours', + 'minutes' => 'minutes', + 'month' => 'month', + 'package' => 'package', + 'Bandwidth' => 'Bandwidth', + 'Disk' => 'Disk', + 'Web' => 'Web', + 'Mail' => 'Mail', + 'Databases' => 'Databases', + 'User Directories' => 'User Directories', + 'Template' => 'Template', + 'Web Template' => 'Apache Template', + 'Proxy Template' => 'Nginx Template', + 'DNS Template' => 'DNS Template', + 'Web Domains' => 'Web Domains', + 'SSL Domains' => 'SSL Domains', + 'Web Aliases' => 'Web Aliases', + 'per domain' => 'per domain', + 'DNS domains' => 'DNS Domains', + 'DNS domains' => 'DNS domains', + 'DNS records' => 'DNS records' , + 'Name Servers' => 'Name Servers', + 'Mail Domains' => 'Mail Domains', + 'Mail Accounts' => 'Mail Accounts', + 'Cron Jobs' => 'Cron Jobs', + 'SSH Access' => 'SSH Access', + 'IP Addresses' => 'IP Addresses', + 'Backups' => 'Backups', + 'Backup System' => 'Backup System', + 'backup exclusions' => 'backup exclusions', + 'template' => 'template', + 'SSL Support' => 'SSL Support', + 'SSL Home Directory' => 'SSL Home', + 'Proxy Support' => 'Nginx Support', + 'Proxy Extensions' => 'Nginx Extensions', + 'Web Statistics' => 'Web Statistics', + 'Additional FTP Account' => 'Additional FTP', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Expire', + 'Records' => 'Records', + 'Catchall email' => 'Catchall email', + 'AntiVirus Support' => 'AntiVirus Support', + 'AntiSpam Support' => 'AntiSpam Support', + 'DKIM Support' => 'DKIM Support', + 'Accounts' => 'Accounts', + 'Quota' => 'Quota', + 'Autoreply' => 'Autoreply', + 'Forward to' => 'Forward to', + 'Do not store forwarded mail' => 'Do not store forwarded mail', + 'database' => 'database', + 'User' => 'User', + 'Host' => 'Host', + 'Charset' => 'Charset', + 'Min' => 'Min', + 'Hour' => 'Hour', + 'Day' => 'Day', + 'Month' => 'Month', + 'Day of week' => 'Day of week', + 'local' => 'local', + 'Run Time' => 'Run Time', + 'Backup Size' => 'Backup Size', + 'SYS' => 'SYS', + 'Domains' => 'Domains', + 'Status' => 'Status', + 'shared' => 'shared', + 'dedicated' => 'dedicated', + 'Owner' => 'Owner', + 'Users' => 'Users', + 'Load Average' => 'Load Average', + 'Memory Usage' => 'Memory Usage', + 'HTTPD Usage' => 'HTTPD Usage', + 'NGINX Usage' => 'NGINX Usage', + 'MySQL Usage on localhost' => 'MySQL Usage on localhost', + 'PostgreSQL Usage on localhost' => 'PostgreSQL Usage on localhost', + 'Bandwidth Usage eth0' => 'Bandwidth Usage eth0', + 'FTP Usage' => 'FTP Usage', + 'SSH Usage' => 'SSH Usage', + 'reverse proxy' => 'reverse proxy', + 'web server' => 'web server', + 'dns server' => 'dns server', + 'mail server' => 'mail server', + 'pop/imap server' => 'pop/imap server', + 'email antivirus' => 'email antivirus', + 'email antispam' => 'email antispam', + 'database server' => 'database server', + 'ftp server' => 'ftp server', + 'job scheduler' => 'job scheduler', + 'CPU' => 'CPU', + 'Memory' => 'Memory', + 'Uptime' => 'Uptime', + 'core package' => 'core package', + 'php interpreter' => 'php interpreter', + 'internal web server' => 'internal web server', + 'Version' => 'Version', + 'Release' => 'Release', + 'Architecture' => 'Architecture', + 'Object' => 'Object', + 'Owner' => 'Owner', + 'Username' => 'Username', + 'Password' => 'Password', + 'Email' => 'Email', + 'Package' => 'Package', + 'Language' => 'Language', + 'First Name' => 'First Name', + 'Last Name' => 'Last Name', + 'Send login credentials to email address' => 'Send login credentials to email address', + 'Default Template' => 'Default Template', + 'Default Name Servers' => 'Default Name Servers', + 'Domain' => 'Domain', + 'DNS Support' => 'DNS Support', + 'Mail Support' => 'Mail Support', + 'Advanced options' => 'Advanced options', + 'Aliases' => 'Aliases', + 'SSL Certificate' => 'SSL Certificate', + 'SSL Key' => 'SSL Key', + 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', + 'SSL CSR' => 'SSL CSR', + 'optional' => 'optional', + 'internal' => 'internal', + 'Statistics Authorization' => 'Statistics Authorization', + 'Statistics Auth' => 'Statistics Auth', + 'Account' => 'Account', + 'Prefix will be automaticaly added to username' => 'Prefix %s will be automaticaly added to username', + 'Send FTP credentials to email' => 'Send FTP credentials to email', + 'Expiration Date' => 'Expiration Date', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'Name servers', + 'Record' => 'Record', + 'IP or Value' => 'IP or Value', + 'Priority' => 'Priority', + 'Record Number' => 'Record Number', + 'in megabytes' => 'in megabytes', + 'Message' => 'Message', + 'use local-part' => 'use local-part', + 'one or more email addresses' => 'one or more email addresses', + 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user', + 'Database' => 'Database', + 'Type' => 'Type', + 'Minute' => 'Minute', + 'Command' => 'Command', + 'Package Name' => 'Package Name', + 'Netmask' => 'Netmask', + 'Interface' => 'Interface', + 'Shared' => 'Shared', + 'Assigned user' => 'Assigned user', + 'Assigned domain' => 'Assigned domain', + 'NAT IP association' => 'NAT IP association', + 'shell' => 'shell', + 'web domains' => 'web domains', + 'web aliases' => 'web aliases', + 'dns records' => 'dns records', + 'mail domains' => 'mail domains', + 'mail accounts' => 'mail accounts', + 'accounts' => 'accounts', + 'databases' => 'databases', + 'cron jobs' => 'cron jobs', + 'backups' => 'backups', + 'quota' => 'quota', + 'day of week' => 'day of week', + 'cmd' => 'cmd', + 'users' => 'users', + 'domains' => 'domains', + 'aliases' => 'aliases', + 'records' => 'records', + 'jobs' => 'jobs', + 'username' => 'username', + 'password' => 'password', + 'type' => 'type', + 'charset' => 'charset', + 'domain' => 'domain', + 'ip' => 'ip', + 'ip address' => 'ip address', + 'IP address' => 'IP address', + 'netmask' => 'netmask', + 'interface' => 'interface', + 'assigned user' => 'assigned user', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'user', + 'email' => 'email', + 'first name' => 'first name', + 'last name' => 'last name', + 'account' => 'account', + 'ssl certificate' => 'ssl certificate', + 'ssl key' => 'ssl key', + 'stats user password' => 'stats user password', + 'stats username' => 'stats username', + 'stats password' => 'stats password', + 'ftp user password' => 'ftp user password', + 'ftp user' => 'ftp user', + 'Last 70 lines of %s.%s.log' => 'Last 70 lines of %s.%s.log', + 'Download AccessLog' => 'Download AccessLog', + 'Download ErrorLog' => 'Download ErrorLog', + 'Country' => 'Country', + '2 letter code' => '2 letter code', + 'State / Province' => 'State / Province', + 'City / Locality' => 'City / Locality', + 'Organization' => 'Organization', + + '1 account' => '1 account', + '%s accounts' => '%s accounts', + '1 domain' => '1 domain', + '%s domains' => '%s domains', + '1 record' => '1 record', + '%s records' => '%s records', + '1 mail account' => '1 mail account', + '%s mail accounts' => '%s mail accounts', + '1 database' => '1 database', + '%s databases' => '%s databases', + '1 cron job' => '1 cron job', + '%s cron jobs' => '%s cron jobs', + '1 archive' => '1 archive', + '%s archives' => '%s archives', + '1 package' => '1 package', + '%s packages' => '%s packages', + '1 IP address' => '1 IP address', + '%s IP addresses' => '%s IP addresses', + '1 month' => '1 month', + '%s months' => '%s months', + '1 log record' => '1 log record', + '%s log records' => '%s log records', + '1 object' => '1 object', + '%s objects' => '%s objects', + 'no exclusions' => 'no exclusions', + + 'USER_CREATED_OK' => 'User %s has been created successfully', + 'WEB_DOMAIN_CREATED_OK' => 'Domain %s has been created successfully.', + 'DNS_DOMAIN_CREATED_OK' => 'DNS domain %s has been created successfully.', + 'DNS_RECORD_CREATED_OK' => 'Record %s.%s has been created successfully.', + 'MAIL_DOMAIN_CREATED_OK' => 'Mail domain %s has been created successfully.', + 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully', + 'DATABASE_CREATED_OK' => 'Database %s has been created successfully', + 'CRON_CREATED_OK' => 'Cron job has been created successfully.', + 'IP_CREATED_OK' => 'IP address %s has been created successfully.', + 'PACKAGE_CREATED_OK' => 'Package %s has been created successfully.', + 'SSL_GENERATED_OK' => 'Certificate has been generated successfully.', + 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled', + 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled', + 'Changes has been saved.' => 'Changes has been saved.', + 'Confirmation' => 'Confirmation', + 'DELETE_USER_CONFIRMATION' => 'Are you sure to delete user %s?', + 'SUSPEND_USER_CONFIRMATION' => 'Are you sure to suspend user %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure to unsuspend user %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure to delete domain %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to suspend domain %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to unsuspend domain %s?', + 'DELETE_RECORD_CONFIRMATION' => 'Are you sure to delete record %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure to suspend record %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure to unsuspend record %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to delete %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to suspend %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to unsuspend %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure to delete database %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to suspend database %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to unsuspend database %s?', + 'DELETE_CRON_CONFIRMATION' => 'Are you sure to delete cron job?', + 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure to suspend cron job?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure to unsuspend cron job?', + 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure to delete %s backup?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure to delete %s exclusion?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure to delete package %s?', + 'DELETE_IP_CONFIRMATION' => 'Are you sure to delere IP address %s?', + 'Welcome' => 'Welcome', + 'LOGGED_IN_AS' => 'Logged in as user %s', + 'Error' => 'Error', + 'Invalid username or password' => 'Invalid username or password', + 'Invalid username or code' => 'Invalid username or code', + 'Passwords not match' => 'Passwords not match', + 'Please enter valid email address.' => 'Please enter valid email address.', + 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', + 'Password is too short.' => 'Password is too short (minimum is 6 characters)', + 'Error code:' => 'Error code: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" failed', + 'IP address is in use' => 'IP address is in use', + 'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', + 'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.', + 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', + 'RESTORE_EXISTS' => 'An existing restoration task is already running. Please wait for it to finish before launching it again.', + + 'WEB_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific dirs use following format: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *", + 'MAIL_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific accounts use following format: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Type full database name, one per line. To exclude all databases use *", + 'CRON_EXCLUSIONS' => "To exclude all jobs use *", + 'USER_EXCLUSIONS' => "Type directory name, one per line. To exlude all dirs use *", + + 'Welcome to Vesta Control Panel' => 'Welcome to Vesta Control Panel', + 'MAIL_FROM' => 'Vesta Control Panel ', + 'GREETINGS_GORDON_FREEMAN' => "Hello, %s %s,\n", + 'GREETINGS' => "Hello,\n", + 'ACCOUNT_READY' => "Your account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'FTP login credentials' => 'FTP login credentials', + 'FTP_ACCOUNT_READY' => "FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'Database Credentials' => 'Database Credentials', + 'DATABASE_READY' => "Database has been created successfully.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", + + 'forgot password' => 'forgot password', + 'Confirm' => 'Confirm', + 'New Password' => 'New Password', + 'Confirm Password' => 'Confirm Password', + 'Reset' => 'Reset', + 'Reset Code' => 'Reset Code', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'Password reset code has been sent to your email address
', + 'MAIL_RESET_SUBJECT' => 'Password Reset at %s', + 'PASSWORD_RESET_REQUEST' => "To reset your control panel password, please follow this link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, you may go to https://%s/reset/?action=code&user=%s and enter the following reset code:\n%s\n\nIf you did not request password reset, please ignore this message and accept our apologies.\n\n--\nVesta Control Panel\n", +); From 252fcea434d2a8a1bf57911862379dff5e01b065 Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 8 Jul 2014 14:43:22 +0200 Subject: [PATCH 32/84] Traduzione Italiano 2a parte --- web/inc/i18n/it.php | 182 ++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index 25da698dd..53d40eb41 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -85,128 +85,128 @@ $LANG['it'] = array( 'enable autoupdate' => 'abilita aggiornamenti automatici', 'disable autoupdate' => 'disabilita aggiornamenti automatici', - 'Adding User' => 'Adding User', - 'Editing User' => 'Editing User', - 'Adding Domain' => 'Adding Domain', - 'Editing Domain' => 'Editing Domain', - 'Adding DNS Domain' => 'Adding DNS Domain', - 'Editing DNS Domain' => 'Editing DNS Domain', - 'Adding DNS Record' => 'Adding DNS Record', - 'Editing DNS Record' => 'Editing DNS Record', - 'Adding Mail Domain' => 'Adding Mail Domain', - 'Editing Mail Domain' => 'Editing Mail Domain', - 'Adding Mail Account' => 'Adding Mail Account', - 'Editing Mail Account' => 'Editing Mail Account', - 'Adding database' => 'Adding database', - 'Editing Cron Job' => 'Editing Cron Job', - 'Adding Cron Job' => 'Adding Cron Job', - 'Editing Database' => 'Editing Database', - 'Adding Package' => 'Adding Package', - 'Editing Package' => 'Editing Package', - 'Adding IP address' => 'Adding IP address', - 'Editing IP Address' => 'Editing IP Address', - 'Editing Backup Exclusions' => 'Editing Backup Exclusions', - 'Generating CSR' => 'Generating CSR', - 'Listing' => 'Listing', - 'Search Results' => 'Search Results', + 'Adding User' => 'Aggiunta Utente', + 'Editing User' => 'Modifica Utente', + 'Adding Domain' => 'Aggiunta Dominio', + 'Editing Domain' => 'Modifica Dominio', + 'Adding DNS Domain' => 'Aggiunta Dominio DNS', + 'Editing DNS Domain' => 'Modifica Dominio DNS', + 'Adding DNS Record' => 'Aggiunta Record DNS', + 'Editing DNS Record' => 'Modifica Record DNS', + 'Adding Mail Domain' => 'Aggiunta Dominio Mail', + 'Editing Mail Domain' => 'Modifica Dominio Mail', + 'Adding Mail Account' => 'Aggiunta Account Mail', + 'Editing Mail Account' => 'Modifica Account Mail', + 'Adding database' => 'Aggiunta database', + 'Editing Cron Job' => 'Modifica Cron Job', + 'Adding Cron Job' => 'Aggiunta Cron Job', + 'Editing Database' => 'Modifica Database', + 'Adding Package' => 'Aggiunta Pacchetto', + 'Editing Package' => 'Modifica Pacchetto', + 'Adding IP address' => 'Aggiunta Indirizzo IP', + 'Editing IP Address' => 'Modifica Indirizzo IP', + 'Editing Backup Exclusions' => 'Modifica Esclusioni Backup', + 'Generating CSR' => 'Generazione CSR in corso', + 'Listing' => 'Lista', + 'Search Results' => 'Risultati Ricerca', - 'active' => 'active', - 'spnd' => 'suspended', - 'suspended' => 'suspended', - 'running' => 'running', - 'stopped' => 'stopped', - 'outdated' => 'outdated', - 'updated' => 'updated', + 'active' => 'attivo', + 'spnd' => 'sospeso', + 'suspended' => 'sospeso', + 'running' => 'in esecuzione', + 'stopped' => 'fermato', + 'outdated' => 'obsoleto', + 'updated' => 'aggiornato', - 'yes' => 'yes', + 'yes' => 'si', 'no' => 'no', - 'none' => 'none', + 'none' => 'nessuno', 'pb' => 'pb', 'tb' => 'tb', 'gb' => 'gb', 'mb' => 'mb', - 'minute' => 'minute', - 'hour' => 'hour', - 'day' => 'day', - 'days' => 'days', - 'hours' => 'hours', - 'minutes' => 'minutes', - 'month' => 'month', - 'package' => 'package', - 'Bandwidth' => 'Bandwidth', - 'Disk' => 'Disk', + 'minute' => 'minuto', + 'hour' => 'ora', + 'day' => 'giorno', + 'days' => 'giorni', + 'hours' => 'ore', + 'minutes' => 'minuti', + 'month' => 'mese', + 'package' => 'pacchetto', + 'Bandwidth' => 'Banda', + 'Disk' => 'Disco', 'Web' => 'Web', 'Mail' => 'Mail', 'Databases' => 'Databases', - 'User Directories' => 'User Directories', + 'User Directories' => 'Directories Utente', 'Template' => 'Template', 'Web Template' => 'Apache Template', 'Proxy Template' => 'Nginx Template', 'DNS Template' => 'DNS Template', - 'Web Domains' => 'Web Domains', - 'SSL Domains' => 'SSL Domains', + 'Web Domains' => 'Domini Web', + 'SSL Domains' => 'Domini SSL', 'Web Aliases' => 'Web Aliases', - 'per domain' => 'per domain', - 'DNS domains' => 'DNS Domains', - 'DNS domains' => 'DNS domains', - 'DNS records' => 'DNS records' , + 'per domain' => 'per dominio', + 'DNS domains' => 'Domini DNS', + 'DNS domains' => 'domini DNS', + 'DNS records' => 'records DNS' , 'Name Servers' => 'Name Servers', - 'Mail Domains' => 'Mail Domains', - 'Mail Accounts' => 'Mail Accounts', + 'Mail Domains' => 'Domini Mail', + 'Mail Accounts' => 'Accounts Mail', 'Cron Jobs' => 'Cron Jobs', - 'SSH Access' => 'SSH Access', - 'IP Addresses' => 'IP Addresses', + 'SSH Access' => 'Accesso SSH', + 'IP Addresses' => 'Indirizzi IP', 'Backups' => 'Backups', - 'Backup System' => 'Backup System', - 'backup exclusions' => 'backup exclusions', + 'Backup System' => 'Sistema Backup', + 'backup exclusions' => 'esclusioni backup', 'template' => 'template', - 'SSL Support' => 'SSL Support', + 'SSL Support' => 'Supporto SSL', 'SSL Home Directory' => 'SSL Home', - 'Proxy Support' => 'Nginx Support', - 'Proxy Extensions' => 'Nginx Extensions', - 'Web Statistics' => 'Web Statistics', - 'Additional FTP Account' => 'Additional FTP', + 'Proxy Support' => 'Supporto Nginx', + 'Proxy Extensions' => 'Estensioni Nginx', + 'Web Statistics' => 'Statistiche Web', + 'Additional FTP Account' => 'FTP Addizionali', 'SOA' => 'SOA', 'TTL' => 'TTL', - 'Expire' => 'Expire', + 'Expire' => 'Scadenza', 'Records' => 'Records', 'Catchall email' => 'Catchall email', - 'AntiVirus Support' => 'AntiVirus Support', - 'AntiSpam Support' => 'AntiSpam Support', - 'DKIM Support' => 'DKIM Support', + 'AntiVirus Support' => 'Supporto AntiVirus', + 'AntiSpam Support' => 'Supporto AntiSpam', + 'DKIM Support' => 'Supporto DKIM', 'Accounts' => 'Accounts', 'Quota' => 'Quota', - 'Autoreply' => 'Autoreply', - 'Forward to' => 'Forward to', - 'Do not store forwarded mail' => 'Do not store forwarded mail', + 'Autoreply' => 'Autorisposta', + 'Forward to' => 'Inoltra a', + 'Do not store forwarded mail' => 'Non salvare le email inoltrate', 'database' => 'database', - 'User' => 'User', + 'User' => 'Utente', 'Host' => 'Host', 'Charset' => 'Charset', 'Min' => 'Min', - 'Hour' => 'Hour', - 'Day' => 'Day', - 'Month' => 'Month', - 'Day of week' => 'Day of week', + 'Hour' => 'Ora', + 'Day' => 'Giorno', + 'Month' => 'Mese', + 'Day of week' => 'Giorno della settimana', 'local' => 'local', - 'Run Time' => 'Run Time', - 'Backup Size' => 'Backup Size', + 'Run Time' => 'Tempo di Esecuzione', + 'Backup Size' => 'Dimensioni Backup', 'SYS' => 'SYS', - 'Domains' => 'Domains', - 'Status' => 'Status', - 'shared' => 'shared', - 'dedicated' => 'dedicated', - 'Owner' => 'Owner', - 'Users' => 'Users', - 'Load Average' => 'Load Average', - 'Memory Usage' => 'Memory Usage', - 'HTTPD Usage' => 'HTTPD Usage', - 'NGINX Usage' => 'NGINX Usage', - 'MySQL Usage on localhost' => 'MySQL Usage on localhost', - 'PostgreSQL Usage on localhost' => 'PostgreSQL Usage on localhost', - 'Bandwidth Usage eth0' => 'Bandwidth Usage eth0', - 'FTP Usage' => 'FTP Usage', - 'SSH Usage' => 'SSH Usage', + 'Domains' => 'Domini', + 'Status' => 'Stati', + 'shared' => 'condiviso', + 'dedicated' => 'dedicato', + 'Owner' => 'Proprietario', + 'Users' => 'Utenti', + 'Load Average' => 'Carico Medio', + 'Memory Usage' => 'Uso Memoria', + 'HTTPD Usage' => 'Utilizzo HTTPD', + 'NGINX Usage' => 'Utilizzo NGINX', + 'MySQL Usage on localhost' => 'Utilizzo MySQL su localhost', + 'PostgreSQL Usage on localhost' => 'Utilizzo PostgreSQL su localhost', + 'Bandwidth Usage eth0' => 'Utilizzo banda su eth0', + 'FTP Usage' => 'Utilizzo FTP', + 'SSH Usage' => 'Utilizzo SSH', 'reverse proxy' => 'reverse proxy', 'web server' => 'web server', 'dns server' => 'dns server', @@ -218,7 +218,7 @@ $LANG['it'] = array( 'ftp server' => 'ftp server', 'job scheduler' => 'job scheduler', 'CPU' => 'CPU', - 'Memory' => 'Memory', + 'Memory' => 'Memoria', 'Uptime' => 'Uptime', 'core package' => 'core package', 'php interpreter' => 'php interpreter', From 38d9c58dc0624d03538139b9d8ab7a7d8bb27523 Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 8 Jul 2014 15:48:12 +0200 Subject: [PATCH 33/84] Fine traduzione italiana --- web/inc/i18n/it.php | 306 ++++++++++++++++++++++---------------------- 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index 53d40eb41..e4d47f165 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -220,222 +220,222 @@ $LANG['it'] = array( 'CPU' => 'CPU', 'Memory' => 'Memoria', 'Uptime' => 'Uptime', - 'core package' => 'core package', - 'php interpreter' => 'php interpreter', - 'internal web server' => 'internal web server', - 'Version' => 'Version', + 'core package' => 'pacchetto di sistema', + 'php interpreter' => 'interprete php', + 'internal web server' => 'web server interno', + 'Version' => 'Versione', 'Release' => 'Release', - 'Architecture' => 'Architecture', - 'Object' => 'Object', - 'Owner' => 'Owner', + 'Architecture' => 'Architettura', + 'Object' => 'Oggetto', + 'Owner' => 'Proprietario', 'Username' => 'Username', 'Password' => 'Password', 'Email' => 'Email', - 'Package' => 'Package', - 'Language' => 'Language', - 'First Name' => 'First Name', - 'Last Name' => 'Last Name', - 'Send login credentials to email address' => 'Send login credentials to email address', + 'Package' => 'Pacchetto', + 'Language' => 'Lingua', + 'First Name' => 'Nome', + 'Last Name' => 'Cognome', + 'Send login credentials to email address' => 'Invia le credenziali di login per email', 'Default Template' => 'Default Template', 'Default Name Servers' => 'Default Name Servers', - 'Domain' => 'Domain', - 'DNS Support' => 'DNS Support', - 'Mail Support' => 'Mail Support', - 'Advanced options' => 'Advanced options', + 'Domain' => 'Dominio', + 'DNS Support' => 'Supporto DNS', + 'Mail Support' => 'Supporto Mail', + 'Advanced options' => 'Opzioni Avanzate', 'Aliases' => 'Aliases', - 'SSL Certificate' => 'SSL Certificate', + 'SSL Certificate' => 'Certificato SSL', 'SSL Key' => 'SSL Key', 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', 'SSL CSR' => 'SSL CSR', - 'optional' => 'optional', - 'internal' => 'internal', - 'Statistics Authorization' => 'Statistics Authorization', - 'Statistics Auth' => 'Statistics Auth', + 'optional' => 'opzionale', + 'internal' => 'interno', + 'Statistics Authorization' => 'Autorizzazione Statistiche', + 'Statistics Auth' => 'Statistiche Auth', 'Account' => 'Account', - 'Prefix will be automaticaly added to username' => 'Prefix %s will be automaticaly added to username', - 'Send FTP credentials to email' => 'Send FTP credentials to email', - 'Expiration Date' => 'Expiration Date', + 'Prefix will be automaticaly added to username' => 'Il prefisso %s verrà automatiamente aggiunto all\'username', + 'Send FTP credentials to email' => 'Invia le credenziali FTP per email', + 'Expiration Date' => 'Data di scadenza', 'YYYY-MM-DD' => 'YYYY-MM-DD', 'Name servers' => 'Name servers', 'Record' => 'Record', - 'IP or Value' => 'IP or Value', - 'Priority' => 'Priority', - 'Record Number' => 'Record Number', + 'IP or Value' => 'IP o Valore', + 'Priority' => 'Priorità', + 'Record Number' => 'Numero Record', 'in megabytes' => 'in megabytes', - 'Message' => 'Message', - 'use local-part' => 'use local-part', - 'one or more email addresses' => 'one or more email addresses', - 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user', + 'Message' => 'Messaggio', + 'use local-part' => 'usa local-part', + 'one or more email addresses' => 'uno o più indirizzi email', + 'Prefix will be automaticaly added to database name and database user' => 'Il prefisso %s verrà automatiamente aggiunto al nome e all\'utente del database', 'Database' => 'Database', - 'Type' => 'Type', - 'Minute' => 'Minute', - 'Command' => 'Command', - 'Package Name' => 'Package Name', + 'Type' => 'Tipo', + 'Minute' => 'Minuto', + 'Command' => 'Comando', + 'Package Name' => 'Nome Pacchetto', 'Netmask' => 'Netmask', - 'Interface' => 'Interface', - 'Shared' => 'Shared', - 'Assigned user' => 'Assigned user', - 'Assigned domain' => 'Assigned domain', - 'NAT IP association' => 'NAT IP association', + 'Interface' => 'Interfaccia', + 'Shared' => 'Condiviso', + 'Assigned user' => 'Utente Assegnato', + 'Assigned domain' => 'Dominio Assegnato', + 'NAT IP association' => 'Associazione IP NAT', 'shell' => 'shell', - 'web domains' => 'web domains', - 'web aliases' => 'web aliases', - 'dns records' => 'dns records', - 'mail domains' => 'mail domains', - 'mail accounts' => 'mail accounts', + 'web domains' => 'domini web', + 'web aliases' => 'aliases web', + 'dns records' => 'records dns', + 'mail domains' => 'domini mail', + 'mail accounts' => 'accounts mail', 'accounts' => 'accounts', 'databases' => 'databases', 'cron jobs' => 'cron jobs', 'backups' => 'backups', 'quota' => 'quota', - 'day of week' => 'day of week', + 'day of week' => 'giorno della settimanta', 'cmd' => 'cmd', 'users' => 'users', - 'domains' => 'domains', + 'domains' => 'domini', 'aliases' => 'aliases', 'records' => 'records', 'jobs' => 'jobs', 'username' => 'username', 'password' => 'password', - 'type' => 'type', + 'type' => 'tipo', 'charset' => 'charset', - 'domain' => 'domain', + 'domain' => 'dominio', 'ip' => 'ip', - 'ip address' => 'ip address', - 'IP address' => 'IP address', + 'ip address' => 'indirizzo ip', + 'IP address' => 'indirizzo IP', 'netmask' => 'netmask', - 'interface' => 'interface', - 'assigned user' => 'assigned user', + 'interface' => 'interfaccia', + 'assigned user' => 'utente assegnato', 'ns1' => 'ns1', 'ns2' => 'ns2', 'user' => 'user', 'email' => 'email', - 'first name' => 'first name', - 'last name' => 'last name', + 'first name' => 'nome', + 'last name' => 'cognome', 'account' => 'account', - 'ssl certificate' => 'ssl certificate', - 'ssl key' => 'ssl key', + 'ssl certificate' => 'certificato ssl', + 'ssl key' => 'key ssl', 'stats user password' => 'stats user password', 'stats username' => 'stats username', 'stats password' => 'stats password', 'ftp user password' => 'ftp user password', 'ftp user' => 'ftp user', - 'Last 70 lines of %s.%s.log' => 'Last 70 lines of %s.%s.log', + 'Last 70 lines of %s.%s.log' => 'Ultime 70 righe di %s.%s.log', 'Download AccessLog' => 'Download AccessLog', 'Download ErrorLog' => 'Download ErrorLog', - 'Country' => 'Country', - '2 letter code' => '2 letter code', - 'State / Province' => 'State / Province', - 'City / Locality' => 'City / Locality', - 'Organization' => 'Organization', + 'Country' => 'Paese', + '2 letter code' => 'codice di 2 lettere', + 'State / Province' => 'Stato / Provincia', + 'City / Locality' => 'Città / Località', + 'Organization' => 'Organizzazione', '1 account' => '1 account', '%s accounts' => '%s accounts', - '1 domain' => '1 domain', - '%s domains' => '%s domains', + '1 domain' => '1 dominio', + '%s domains' => '%s domini', '1 record' => '1 record', '%s records' => '%s records', - '1 mail account' => '1 mail account', - '%s mail accounts' => '%s mail accounts', + '1 mail account' => '1 account mail', + '%s mail accounts' => '%s accounts mail', '1 database' => '1 database', '%s databases' => '%s databases', '1 cron job' => '1 cron job', '%s cron jobs' => '%s cron jobs', - '1 archive' => '1 archive', - '%s archives' => '%s archives', - '1 package' => '1 package', - '%s packages' => '%s packages', - '1 IP address' => '1 IP address', - '%s IP addresses' => '%s IP addresses', - '1 month' => '1 month', - '%s months' => '%s months', + '1 archive' => '1 archivio', + '%s archives' => '%s archivi', + '1 package' => '1 pacchetto', + '%s packages' => '%s pacchetti', + '1 IP address' => '1 indirizzo IP', + '%s IP addresses' => '%s indirizzi IP', + '1 month' => '1 mese', + '%s months' => '%s mesi', '1 log record' => '1 log record', '%s log records' => '%s log records', - '1 object' => '1 object', - '%s objects' => '%s objects', - 'no exclusions' => 'no exclusions', + '1 object' => '1 oggetto', + '%s objects' => '%s oggetti', + 'no exclusions' => 'senza esclusioni', - 'USER_CREATED_OK' => 'User %s has been created successfully', - 'WEB_DOMAIN_CREATED_OK' => 'Domain %s has been created successfully.', - 'DNS_DOMAIN_CREATED_OK' => 'DNS domain %s has been created successfully.', - 'DNS_RECORD_CREATED_OK' => 'Record %s.%s has been created successfully.', - 'MAIL_DOMAIN_CREATED_OK' => 'Mail domain %s has been created successfully.', - 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully', - 'DATABASE_CREATED_OK' => 'Database %s has been created successfully', - 'CRON_CREATED_OK' => 'Cron job has been created successfully.', - 'IP_CREATED_OK' => 'IP address %s has been created successfully.', - 'PACKAGE_CREATED_OK' => 'Package %s has been created successfully.', - 'SSL_GENERATED_OK' => 'Certificate has been generated successfully.', - 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled', - 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled', - 'Changes has been saved.' => 'Changes has been saved.', - 'Confirmation' => 'Confirmation', - 'DELETE_USER_CONFIRMATION' => 'Are you sure to delete user %s?', - 'SUSPEND_USER_CONFIRMATION' => 'Are you sure to suspend user %s?', - 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure to unsuspend user %s?', - 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure to delete domain %s?', - 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to suspend domain %s?', - 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to unsuspend domain %s?', - 'DELETE_RECORD_CONFIRMATION' => 'Are you sure to delete record %s?', - 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure to suspend record %s?', - 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure to unsuspend record %s?', - 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to delete %s?', - 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to suspend %s?', - 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to unsuspend %s?', - 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure to delete database %s?', - 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to suspend database %s?', - 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to unsuspend database %s?', - 'DELETE_CRON_CONFIRMATION' => 'Are you sure to delete cron job?', - 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure to suspend cron job?', - 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure to unsuspend cron job?', - 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure to delete %s backup?', - 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure to delete %s exclusion?', - 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure to delete package %s?', - 'DELETE_IP_CONFIRMATION' => 'Are you sure to delere IP address %s?', - 'Welcome' => 'Welcome', - 'LOGGED_IN_AS' => 'Logged in as user %s', - 'Error' => 'Error', - 'Invalid username or password' => 'Invalid username or password', - 'Invalid username or code' => 'Invalid username or code', - 'Passwords not match' => 'Passwords not match', - 'Please enter valid email address.' => 'Please enter valid email address.', - 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', - 'Password is too short.' => 'Password is too short (minimum is 6 characters)', - 'Error code:' => 'Error code: %s', - 'SERVICE_ACTION_FAILED' => '"%s" "%s" failed', - 'IP address is in use' => 'IP address is in use', - 'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', - 'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.', - 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', - 'RESTORE_EXISTS' => 'An existing restoration task is already running. Please wait for it to finish before launching it again.', + 'USER_CREATED_OK' => 'L\'utente %s è stato creato con successo.', + 'WEB_DOMAIN_CREATED_OK' => 'Il dominio %s è stato creato con successo.', + 'DNS_DOMAIN_CREATED_OK' => 'Il dominio DNS %s è stato creato con successo.', + 'DNS_RECORD_CREATED_OK' => 'Il record %s.%s è stato creato con successo.', + 'MAIL_DOMAIN_CREATED_OK' => 'Dominio Mail %s è stato creato con successo.', + 'MAIL_ACCOUNT_CREATED_OK' => 'L\'account mail %s@%s è stato creato con successo.', + 'DATABASE_CREATED_OK' => 'Il database %s è stato creato con successo.', + 'CRON_CREATED_OK' => 'Il cron job è stato creato con successo.', + 'IP_CREATED_OK' => 'L\'indirizzo IP %s è stato creato con successo.', + 'PACKAGE_CREATED_OK' => 'Il pacchetto %s è stato creato con successo.', + 'SSL_GENERATED_OK' => 'Il certificato è stato generato con successo.', + 'Autoupdate has been successfully enabled' => 'L\'aggiornamento automatico è stato abilitato', + 'Autoupdate has been successfully disabled' => 'L\'aggiornamento automatico è stato disabilitato', + 'Changes has been saved.' => 'I cambiamenti sono stati salvati.', + 'Confirmation' => 'Conferma', + 'DELETE_USER_CONFIRMATION' => 'Sei sicuro di voler cancellare l\'utente %s?', + 'SUSPEND_USER_CONFIRMATION' => 'Sei sicuro di voler disabilitare l\'utente %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Sei sicuro di voler riabilitare l\'utente %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Sei sicuro di voler cancellare il dominio %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Sei sicuro di voler disabilitare il dominio %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Sei sicuro di voler riabilitare il dominio %s?', + 'DELETE_RECORD_CONFIRMATION' => 'Sei sicuro di voler cancellare il record %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Sei sicuro di voler disabilitare il record %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Sei sicuro di voler riabilitare il record %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Sei sicuro di voler cancellare %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Sei sicuro di voler disabilitare %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Sei sicuro di voler riabilitare %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'Sei sicuro di voler cancellare il database %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Sei sicuro di voler disabilitare il database %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Sei sicuro di voler riabilitare il database %s?', + 'DELETE_CRON_CONFIRMATION' => 'Sei sicuro di voler cancellare il cron job?', + 'SUSPEND_CRON_CONFIRMATION' => 'Sei sicuro di voler disabilitare il cron job?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Sei sicuro di voler riabilitare il cron job?', + 'DELETE_BACKUP_CONFIRMATION' => 'Sei sicuro di voler cancellare il backup %s?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Sei sicuro di voler cancellare l\'esclusione %s?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Sei sicuro di voler cancellare il pacchetto %s?', + 'DELETE_IP_CONFIRMATION' => 'Sei sicuro di voler l\'indirizoz IP %s?', + 'Welcome' => 'Benvenuto', + 'LOGGED_IN_AS' => 'Connesso come l\'utente %s', + 'Error' => 'Errore', + 'Invalid username or password' => 'Username o password non validi', + 'Invalid username or code' => 'Esername o codice non validi', + 'Passwords not match' => 'Le passwords non coincidono', + 'Please enter valid email address.' => 'Inserisci un\'indirizzo email valido.', + 'Field "%s" can not be blank.' => 'Il campo "%s" non può essere lasciato vuoto.', + 'Password is too short.' => 'La password è troppo corta (minimo 6 caratteri)', + 'Error code:' => 'Codice errore: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" fallita', + 'IP address is in use' => 'L\'indirizzo IP è già in uso', + 'BACKUP_SCHEDULED' => 'L\'operazione è stata aggiunta alla coda. Riceverai una notifica via email quando il tuo backup sarà pronto per il download.', + 'BACKUP_EXISTS' => 'È già in corso la creazione di un backup. Perfavore attendi che il backup finisca.', + 'RESTORE_SCHEDULED' => 'L\'operazione è stata aggiunta alla coda. Riceverai una notifica via email quando il tuo backup sarà pronto per il download.', + 'RESTORE_EXISTS' => 'È già in corso un\'oprazione di ripristino. Attendi che finisca prima di rilanciarla nuovamento.', - 'WEB_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific dirs use following format: domain.com:public_html/cache:public_html/tmp", - 'DNS_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *", - 'MAIL_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific accounts use following format: domain.com:info:support:postmaster", - 'DB_EXCLUSIONS' => "Type full database name, one per line. To exclude all databases use *", - 'CRON_EXCLUSIONS' => "To exclude all jobs use *", - 'USER_EXCLUSIONS' => "Type directory name, one per line. To exlude all dirs use *", + 'WEB_EXCLUSIONS' => "Scrivi un nome di dominio per riga. Per escludere tutti i domini usa *. Per escludere directory specifiche usa il formato: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Scrivi un nome di dominio per riga. Per escludere tutti i domini usa *", + 'MAIL_EXCLUSIONS' => "Scrivi un nome di dominio per riga. Per escludere tutti i domini usa *. Per escludere account specifici usare il formato: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Scrivi un nome completo di database per riga. Per escludere tutti i database usa *", + 'CRON_EXCLUSIONS' => "Per escludere tutti i cron job usa *", + 'USER_EXCLUSIONS' => "Scrivi un nome di directory per riga. Per escludere tutte le directory usa *", - 'Welcome to Vesta Control Panel' => 'Welcome to Vesta Control Panel', + 'Welcome to Vesta Control Panel' => 'Benvenuto nel Vesta Control Panel', 'MAIL_FROM' => 'Vesta Control Panel ', - 'GREETINGS_GORDON_FREEMAN' => "Hello, %s %s,\n", - 'GREETINGS' => "Hello,\n", - 'ACCOUNT_READY' => "Your account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + 'GREETINGS_GORDON_FREEMAN' => "Ciao, %s %s,\n", + 'GREETINGS' => "Ciao,\n", + 'ACCOUNT_READY' => "Il tuo account è stato creato ed è pronto per l\'utilizzo.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", - 'FTP login credentials' => 'FTP login credentials', - 'FTP_ACCOUNT_READY' => "FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + 'FTP login credentials' => 'Credenziali login FTP', + 'FTP_ACCOUNT_READY' => "L\'account FTP è stato creato ed è pronto per l\'uso.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", - 'Database Credentials' => 'Database Credentials', - 'DATABASE_READY' => "Database has been created successfully.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", + 'Database Credentials' => 'Credenziali Database', + 'DATABASE_READY' => "Il database è stato creato con successo.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", - 'forgot password' => 'forgot password', - 'Confirm' => 'Confirm', - 'New Password' => 'New Password', - 'Confirm Password' => 'Confirm Password', + 'forgot password' => 'password dimenticata', + 'Confirm' => 'Conferma', + 'New Password' => 'Nuova Password', + 'Confirm Password' => 'Conferma Password', 'Reset' => 'Reset', - 'Reset Code' => 'Reset Code', + 'Reset Code' => 'Codice Reset', 'RESET_NOTICE' => '', - 'RESET_CODE_SENT' => 'Password reset code has been sent to your email address
', - 'MAIL_RESET_SUBJECT' => 'Password Reset at %s', - 'PASSWORD_RESET_REQUEST' => "To reset your control panel password, please follow this link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, you may go to https://%s/reset/?action=code&user=%s and enter the following reset code:\n%s\n\nIf you did not request password reset, please ignore this message and accept our apologies.\n\n--\nVesta Control Panel\n", + 'RESET_CODE_SENT' => 'Il codice di reset per la tua password ti è stato inviato per email
', + 'MAIL_RESET_SUBJECT' => 'Password Reset per %s', + 'PASSWORD_RESET_REQUEST' => "Per fare il reset della password per il pannello di controllo clicca sul link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternativamente puoi andare su https://%s/reset/?action=code&user=%s e inserire questo codice di reset:\n%s\n\nSe non hai richiesto il reset della tua password, ignora questa email.\n\n--\nVesta Control Panel\n", ); From 179cca9566c7ec0c44dc2a8ccfceb31dbf63a99c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 9 Jul 2014 00:57:19 +0300 Subject: [PATCH 34/84] multiftp support --- bin/v-list-user | 3 ++- func/rebuild.sh | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/bin/v-list-user b/bin/v-list-user index ea818ac1f..817fb8422 100755 --- a/bin/v-list-user +++ b/bin/v-list-user @@ -70,6 +70,7 @@ is_object_valid 'user' 'USER' "$user" # Defining config conf=$USER_DATA/user.conf +HOME=$HOMEDIR/$user # Defining fileds to select fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE @@ -81,7 +82,7 @@ fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE $U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB $U_BANDWIDTH $U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS $U_DNS_RECORDS $U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES $U_CRON_JOBS - $U_BACKUPS $LANGUAGE $TIME $DATE' + $U_BACKUPS $LANGUAGE $HOME $TIME $DATE' # Listing user case $format in diff --git a/func/rebuild.sh b/func/rebuild.sh index de3cc4fec..22ca03106 100644 --- a/func/rebuild.sh +++ b/func/rebuild.sh @@ -318,21 +318,36 @@ rebuild_web_domain_conf() { $WEBTPL/$PROXY_SYSTEM/$PROXY.sh $user $domain $ip $HOMEDIR $docroot fi - # Checking ftp - if [ ! -z "$FTP_USER" ]; then - if [ -z "$(grep ^$FTP_USER: /etc/passwd)" ]; then - shell='/sbin/nologin' - if [ -e "/usr/bin/rssh" ]; then - shell='/usr/bin/rssh' - fi - /usr/sbin/useradd $FTP_USER \ + # Defining ftp user shell + if [ -z "$FTP_SHELL" ]; then + shell='/sbin/nologin' + if [ -e "/usr/bin/rssh" ]; then + shell='/usr/bin/rssh' + fi + else + shell=$FTP_SHELL + fi + + # Checking ftp users + for ftp_user in ${FTP_USER//:/ }; do + if [ -z "$(grep ^$ftp_user: /etc/passwd)" ]; then + # Parsing ftp user variables + position=$(echo $FTP_USER | tr ':' '\n' | grep -n '' |\ + grep ":$ftp_user$" | cut -f 1 -d:) + ftp_path=$(echo $FTP_PATH | tr ':' '\n' | grep -n '' |\ + grep "^$position:" | cut -f 2 -d :) + ftp_md5=$(echo $FTP_MD5 | tr ':' '\n' | grep -n '' |\ + grep "^$position:" | cut -f 2 -d :) + + # Adding ftp user + /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 + -M -d "$HOMEDIR/$user/web/$domain${ftp_path}" >/dev/null 2>&1 - # Update password - shadow=$(grep "^$FTP_USER:" /etc/shadow) + # Updating ftp user password + shadow=$(grep "^$ftp_user:" /etc/shadow) shdw3=$(echo "$shadow" | cut -f3 -d :) shdw4=$(echo "$shadow" | cut -f4 -d :) shdw5=$(echo "$shadow" | cut -f5 -d :) @@ -340,15 +355,14 @@ rebuild_web_domain_conf() { shdw7=$(echo "$shadow" | cut -f7 -d :) shdw8=$(echo "$shadow" | cut -f8 -d :) shdw9=$(echo "$shadow" | cut -f9 -d :) - shadow_str="$FTP_USER:$FTP_MD5:$shdw3:$shdw4:$shdw5:$shdw6" + shadow_str="$ftp_user:$ftp_md5:$shdw3:$shdw4:$shdw5:$shdw6" shadow_str="$shadow_str:$shdw7:$shdw8:$shdw9" - chmod u+w /etc/shadow - sed -i "/^$FTP_USER:*/d" /etc/shadow + sed -i "/^$ftp_user:*/d" /etc/shadow echo "$shadow_str" >> /etc/shadow chmod u-w /etc/shadow fi - fi + done } # DNS domain rebuild From 332064326a1f3c72837fe6db1ba8260e62191a82 Mon Sep 17 00:00:00 2001 From: Onni Hakala Date: Fri, 11 Jul 2014 01:03:27 +0300 Subject: [PATCH 35/84] extended translations started by @RJuho, proofreaded and added lots of my own translations for finnish languages --- web/inc/i18n/fi.php | 442 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 web/inc/i18n/fi.php diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php new file mode 100644 index 000000000..ee1adeedd --- /dev/null +++ b/web/inc/i18n/fi.php @@ -0,0 +1,442 @@ + 'Paketit', + 'IP' => 'IP', + 'Graphs' => 'Kuvaajat', + 'Statistics' => 'Tilastot', + 'Log' => 'Loki', + 'Services' => 'Palvelut', + 'Updates' => 'Päivitykset', + 'Log in' => 'Kirjaudu sisään', + 'Log out' => 'Kirjaudu ulos', + + 'USER' => 'KÄYTTÄJÄ', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'EMAIL', + 'DB' => 'DB', + 'CRON' => 'CRON', + 'BACKUP' => 'VARMUUSKOPIOT', + + 'Add User' => 'Lisää käyttäjä', + 'Add Domain' => 'Lisää domaini', + 'Add Web Domain' => 'Lisää Web domain', + 'Add DNS Domain' => 'Lisää DNS domain', + 'Add DNS Record' => 'Lisää DNS asetus', + 'Add Mail Domain' => 'Lisää email domain', + 'Add Mail Account' => 'Lisää email käyttäjä', + 'Add Database' => 'Lisää tietokanta', + 'Add Cron Job' => 'Lisää Cron-tehtävä', + 'Create Backup' => 'Luo varmuuskopio', + 'Configure' => 'Määritä', + 'Restore All' => 'Palauta kaikki', + 'Add Package' => 'Lisää paketti', + 'Add IP' => 'Lisää IP', + 'Search' => 'Haku', + 'Overall Statistics' => 'Kokonaistilastot', + 'Daily' => 'Päivittäin', + 'Weekly' => 'Viikottain', + 'Monthly' => 'Kuukausittain', + 'Yearly' => 'Vuosittain', + 'Add' => 'Lisää', + 'Back' => 'Takaisin', + 'Save' => 'Tallenna', + 'Submit' => 'Lähetä', + + 'toggle all' => 'vaihda kaikki', + 'apply to selected' => 'toteuta valituissa', + 'rebuild' => 'palauta', + 'rebuild web' => 'palauta web', + 'rebuild dns' => 'palauta dns', + 'rebuild mail' => 'palauta sähköposti', + 'rebuild db' => 'palauta tietokanta', + 'rebuild cron' => 'palauta cron', + 'update counters' => 'päivitä laskurit', + 'suspend' => 'keskeytä', + 'unsuspend' => 'palauta', + 'delete' => 'poista', + 'show per user' => 'näytä per käyttäjä', + 'login as' => 'kirjautunut', + 'logout' => 'kirjaudu ulos', + 'edit' => 'muokkaa', + 'open webstats' => 'avaa webtilastot', + 'view logs' => 'näytä lokit', + 'list records' => 'listaa %s tietuetta', + 'add record' => 'lisää tietue', + 'list accounts' => 'listaa %s käyttäjää', + 'add account' => 'lisää käyttäjä', + 'open webmail' => 'avaa webmail', + 'open %s' => 'avaa %s', + 'download' => 'lataa', + 'restore' => 'palauta', + 'configure restore settings' => 'määritä palautusasetukset', + 'stop' => 'pysäytä', + 'start' => 'käynnistä', + 'restart' => 'käynnistä uudelleen', + 'update' => 'päivitä', + 'generate' => 'generoi', + 'Generate CSR' => 'generoi CSR', + 'reread IP' => 'lue IP uudelleen', + 'enable autoupdate' => 'päivitä automaattisesti', + 'disable autoupdate' => 'älä päivitä automaattisesti', + + 'Adding User' => 'Lisätään käyttäjää', + 'Editing User' => 'Muokataan käyttäjää', + 'Adding Domain' => 'Lisätään domainia', + 'Editing Domain' => 'Muokataan domainia', + 'Adding DNS Domain' => 'Lisätään DNS-domainia', + 'Editing DNS Domain' => 'Muokataan DNS-domainia', + 'Adding DNS Record' => 'Lisätään DNS-tietuetta', + 'Editing DNS Record' => 'Muokataan DNS-tietuetta', + 'Adding Mail Domain' => 'Lisätään sähköpostidomainia', + 'Editing Mail Domain' => 'Muokataan sähköpostidomainia', + 'Adding Mail Account' => 'Lisätään sähköpostitiliä', + 'Editing Mail Account' => 'Muokataan sähköpostitiliä', + 'Adding database' => 'Lisätään tietokantaa', + 'Editing Cron Job' => 'Muokataan Cron-tehtävää', + 'Adding Cron Job' => 'Lisätään Cron-tehtävää', + 'Editing Database' => 'Muokataan tietokantaa', + 'Adding Package' => 'Lisätään pakettia', + 'Editing Package' => 'Muokataan pakettia', + 'Adding IP address' => 'Lisätään IP-osoitetta', + 'Editing IP Address' => 'Muokataan IP-osoitetta', + 'Editing Backup Exclusions' => 'Muokataan Varmuuskopioiden poikkeuksia', + 'Generating CSR' => 'Generoidaan CSR', + 'Listing' => 'Listataan', + 'Search Results' => 'Hakutulokset', + + 'active' => 'aktiivinen', + 'spnd' => 'keskeytetty', + 'suspended' => 'keskeytetty', + 'running' => 'käynnissä', + 'stopped' => 'pysäytetty', + 'outdated' => 'vanhentunut', + 'updated' => 'päivitetty', + + 'yes' => 'kyllä', + 'no' => 'ei', + 'none' => 'ei mitään', + 'pb' => 'pb', //petatavu + 'tb' => 'tb', //teratavu + 'gb' => 'gb', //gigatavu + 'mb' => 'mb', //megatavu + 'minute' => 'minuutti', + 'hour' => 'tunti', + 'day' => 'päivä', + 'days' => 'päivät', + 'hours' => 'tunnit', + 'minutes' => 'minuutit', + 'month' => 'kuukausi', + 'package' => 'paketti', + 'Bandwidth' => 'Kaistanleveys', + 'Disk' => 'Levy', + 'Web' => 'Web', + 'Mail' => 'Sähköposti', + 'Databases' => 'Tietokannat', + 'User Directories' => 'Käyttäjähakemistot', + 'Template' => 'Pohja', + 'Web Template' => 'Apache-pohja', + 'Proxy Template' => 'Nginx-pohja', + 'DNS Template' => 'DNS-pohja', + 'Web Domains' => 'Web-domainit', + 'SSL Domains' => 'SSL-domainit', + 'Web Aliases' => 'Web-aliakset', + 'per domain' => 'per domaini', + 'DNS domains' => 'DNS-domainit', + 'DNS records' => 'DNS-tietueet', + 'Name Servers' => 'Nimipalvelimet', + 'Mail Domains' => 'Sähköpostidomainit', + 'Mail Accounts' => 'Sähköpostikäyttäjät', + 'Cron Jobs' => 'Cron-tehtävät', + 'SSH Access' => 'SSH oikeudet', + 'IP Addresses' => 'IP-osoitteet', + 'Backups' => 'Varmuuskopiot', + 'Backup System' => 'Varmuuskopioi järjestelmä', + 'backup exclusions' => 'varmuuskopioinnin poikkeukset', + 'template' => 'pohjat', + 'SSL Support' => 'SSL-tuki', + 'SSL Home Directory' => 'SSL-kotihakemisto', + 'Proxy Support' => 'Nginx tuki', + 'Proxy Extensions' => 'Nginx laajennukset', + 'Web Statistics' => 'Webtilastot', + 'Additional FTP Account' => 'Ylimääräinen FTP-tili', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Päättyy', + 'Records' => 'Tietueet', + 'Catchall email' => 'Catchall-sähköposti', + 'AntiVirus Support' => 'AntiVirus-tuki', + 'AntiSpam Support' => 'AntiSpam-tuki', + 'DKIM Support' => 'DKIM-tuki', + 'Accounts' => 'Tilit', + 'Quota' => 'Kiintiö', + 'Autoreply' => 'Automaattinen vastaus', + 'Forward to' => 'Uudelleenohjaa', + 'Do not store forwarded mail' => 'Älä säilytä uudelleenohjattuja viestejä', + 'database' => 'tietokanta', + 'User' => 'Käyttäjä', + 'Host' => 'Host', + 'Charset' => 'Merkistö', + 'Min' => 'Min', + 'Hour' => 'Tunti', + 'Day' => 'Päivä', + 'Month' => 'Kuukausi', + 'Day of week' => 'Viikonpäivä', + 'local' => 'paikallinen', + 'Run Time' => 'Run Time', + 'Backup Size' => 'Varmuuskopion koko', + 'SYS' => 'SYS', + 'Domains' => 'Domainit', + 'Status' => 'Tila', + 'shared' => 'jaetut', + 'dedicated' => 'dedicated', + 'Owner' => 'Omistaja', + 'Users' => 'Käyttäjät', + 'Load Average' => 'Keskimääräinen Käyttöaste', + 'Memory Usage' => 'Muistinkäyttö', + 'HTTPD Usage' => 'HTTPD-käyttö', + 'NGINX Usage' => 'NGINX-käyttö', + 'MySQL Usage on localhost' => 'MySQL-käyttö @ localhost', + 'PostgreSQL Usage on localhost' => 'PostgreSQL-käyttö @ localhost', + 'Bandwidth Usage eth0' => 'Kaistan käyttö eth0', + 'FTP Usage' => 'FTP-käyttö', + 'SSH Usage' => 'SSH-käyttö', + 'reverse proxy' => 'reverse proxy', + 'web server' => 'web-palvelin', + 'dns server' => 'dns-palvelin', + 'mail server' => 'sähköpostipalvelin', + 'pop/imap server' => 'pop/imap-palvelin', + 'email antivirus' => 'sähköpostin antivirus', + 'email antispam' => 'sähköpostin antispam', + 'database server' => 'tietokantapalvelin', + 'ftp server' => 'ftp-palvelin', + 'job scheduler' => 'job scheduler', //no-idea + 'CPU' => 'Prosessori', + 'Memory' => 'Muisti', + 'Uptime' => 'Käyttöaika', + 'core package' => 'core-paketti', + 'php interpreter' => 'php-tulkki', + 'internal web server' => 'sisäinen web-palvelin', + 'Version' => 'Versio', + 'Release' => 'Julkaisu', + 'Architecture' => 'Arkkitehtuuri', + 'Object' => 'Objekti', + 'Owner' => 'Omistaja', + 'Username' => 'Käyttäjä', + 'Password' => 'Salasana', + 'Email' => 'Sähköposti', + 'Package' => 'Paketti', + 'Language' => 'Kieli', + 'First Name' => 'Etunimi', + 'Last Name' => 'Sukunimi', + 'Send login credentials to email address' => 'Lähetä kirjautumistiedot sähköpostilla.', + 'Default Template' => 'Oletuspohja', + 'Default Name Servers' => 'Oletusnimipalvelimet', + 'Domain' => 'Domain', + 'DNS Support' => 'Tarvitsee DNS:n', + 'Mail Support' => 'Tarvitsee Sähköpostin', + 'Advanced options' => 'Lisäasetukset', + 'Aliases' => 'Aliakset', + 'SSL Certificate' => 'SSL-sertifikaatti', + 'SSL Key' => 'SSL-avain', + 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', //no-idea + 'SSL CSR' => 'SSL CSR', + 'optional' => 'valinnainen', + 'internal' => 'sisäinen', + 'Statistics Authorization' => 'Tilastoinnin valtuutus', + 'Statistics Auth' => 'Tilastoinnin Auth', + 'Account' => 'Tili', + 'Prefix will be automaticaly added to username' => 'Etuliite %s lisätään automaattisesti käyttäjänimeen.', + 'Send FTP credentials to email' => 'Lähetä FTP-kirjautumistiedot sähköpostilla', + 'Expiration Date' => 'Viimeinen käyttöpäivä', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'Nimipalvelimet', + 'Record' => 'Tietue', + 'IP or Value' => 'IP or Value', //no-idea + 'Priority' => 'Prioriteetti', + 'Record Number' => 'Tietueen numero', + 'in megabytes' => 'megatavuissa', + 'Message' => 'Viesti', + 'use local-part' => 'use local-part', //no-idea + 'one or more email addresses' => 'yksi tai useampia sähköposteja', + 'Prefix will be automaticaly added to database name and database user' => 'Etuliite %s lisätään automaattisesti tietokannan nimeen ja käyttäjään', + 'Database' => 'Tietokanta', + 'Type' => 'Tyyppi', + 'Minute' => 'Minuutti', + 'Command' => 'Käsky', + 'Package Name' => 'Paketin nimi', + 'Netmask' => 'Netmask', //no-idea + 'Interface' => 'Interface', //no-idea + 'Shared' => 'Jaettu', + 'Assigned user' => 'Assigned user', + 'Assigned domain' => 'Assigned domain', + 'NAT IP association' => 'NAT IP association', //no-idea + 'shell' => 'shell', + 'web domains' => 'web-domainit', + 'web aliases' => 'web-aliakset', + 'dns records' => 'dns-tietueet', + 'mail domains' => 'sähköpostidomainit', + 'mail accounts' => 'sähköpostitilit', + 'accounts' => 'tilit', + 'databases' => 'tietokannat', + 'cron jobs' => 'cron-tehtävät', + 'backups' => 'varmuuskopiot', + 'quota' => 'kiintiö', + 'day of week' => 'viikonpäivä', + 'cmd' => 'cmd', + 'users' => 'käyttäjät', + 'domains' => 'domainit', + 'aliases' => 'aliakset', + 'records' => 'tietueet', + 'jobs' => 'tehtävät', + 'username' => 'käyttäjänimi', + 'password' => 'salasana', + 'type' => 'tyyppi', + 'charset' => 'charset', + 'domain' => 'domain', + 'ip' => 'ip', + 'ip address' => 'ip-osoite', + 'IP address' => 'IP-osoite', + 'netmask' => 'netmask', + 'interface' => 'interface', + 'assigned user' => 'omistaja', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'käyttäjä', + 'email' => 'sähköposti', + 'first name' => 'etunimi', + 'last name' => 'sukunimi', + 'account' => 'tili', + 'ssl certificate' => 'ssl-sertifikaatti', + 'ssl key' => 'ssl-avain', + 'stats user password' => 'tilastoinnin käyttäjän salasana', + 'stats username' => 'tilastoinnin käyttäjä', + 'stats password' => 'tilastoinnin salasana', + 'ftp user password' => 'ftp-käyttäjän salasana', + 'ftp user' => 'ftp-käyttäjä', + 'Last 70 lines of %s.%s.log' => '%s 70 viimeistä lokimerkintää.%s.log', + 'Download AccessLog' => 'Lataa AccessLog', + 'Download ErrorLog' => 'Lataa Virheloki', + 'Country' => 'Maa', + '2 letter code' => '2 kirjaimen lyhenne', + 'State / Province' => 'Osavaltio / Maakunta', + 'City / Locality' => 'Kaupunki / Paikkakunta', + 'Organization' => 'Organisaatio', + + '1 account' => '1 tili', + '%s accounts' => '%s tiliä', + '1 domain' => '1 domain', + '%s domains' => '%s domainia', + '1 record' => '1 tietue', + '%s records' => '%s tietuetta', + '1 mail account' => '1 sähköpostitili', + '%s mail accounts' => '%s sähköpostitiliä', + '1 database' => '1 tietokanta', + '%s databases' => '%s tietokantaa', + '1 cron job' => '1 cron-tehtävä', + '%s cron jobs' => '%s cron-tehtävää', + '1 archive' => '1 archive', + '%s archives' => '%s archives', + '1 package' => '1 paketti', + '%s packages' => '%s pakettia', + '1 IP address' => '1 IP-osoite', + '%s IP addresses' => '%s IP-osoitetta', + '1 month' => '1 kuukausi', + '%s months' => '%s kuukautta', + '1 log record' => '1 lokimerkintä', + '%s log records' => '%s lokimerkintää', + '1 object' => '1 objekti', + '%s objects' => '%s objektia', + 'no exclusions' => 'ei poikkeuksia', + + 'USER_CREATED_OK' => 'Käyttäjä %s lisättiin onnistuneesti', + 'WEB_DOMAIN_CREATED_OK' => 'Domain %s lisättiin onnistuneesti.', + 'DNS_DOMAIN_CREATED_OK' => 'DNS-domain %s lisättiin onnistuneesti.', + 'DNS_RECORD_CREATED_OK' => 'Tietue %s.%s lisättiin onnistuneesti.', + 'MAIL_DOMAIN_CREATED_OK' => 'Sähköpostidomain %s lisättiin onnistuneesti.', + 'MAIL_ACCOUNT_CREATED_OK' => 'Sähköpostitili %s@%s lisättiin onnistuneesti.', + 'DATABASE_CREATED_OK' => 'Tietokanta %s lisättiin onnistuneesti.', + 'CRON_CREATED_OK' => 'Cron-tehtävä lisättiin onnistuneesti.', + 'IP_CREATED_OK' => 'IP-osoite %s lisättiin onnistuneesti.', + 'PACKAGE_CREATED_OK' => 'Paketti %s lisättiin onnistuneesti.', + 'SSL_GENERATED_OK' => 'Sertifikaatti lisättiin onnistuneesti.', + 'Autoupdate has been successfully enabled' => 'Automaattinen päivitys otettu käyttöön', + 'Autoupdate has been successfully disabled' => 'Automaattinen päivitys poistettu käytöstä', + 'Changes has been saved.' => 'Muutokset tallennettu.', + 'Confirmation' => 'Hyväksyntä', + 'DELETE_USER_CONFIRMATION' => 'Haluatko varmasti poistaa käyttäjän %s?', + 'SUSPEND_USER_CONFIRMATION' => 'Haluatko varmasti keskeyttää käyttäjän %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön käyttäjän %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Haluatko varmasti poistaa domainin %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Haluatko varmasti keskeyttää domainin %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön domainin %s?', + 'DELETE_RECORD_CONFIRMATION' => 'Haluatko varmasti poistaa tietueen %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Haluatko varmasti keskeyttää tietueen %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön tietueen %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Haluatko varmasti poistaa %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Haluatko varmasti keskeyttää %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'Haluatko varmasti poistaa tietokannan %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Haluatko varmasti keskeyttää tietokannan %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön tietokannan %s?', + 'DELETE_CRON_CONFIRMATION' => 'Haluatko varmasti poistaa cron-tehtävän?', + 'SUSPEND_CRON_CONFIRMATION' => 'Haluatko varmasti keskeyttää cron-tehtävän?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Haluatko varmasti ottaa käyttöön cron-tehtävän?', + 'DELETE_BACKUP_CONFIRMATION' => 'Haluatko varmasti poistaa %s varmuuskopion?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Haluatko varmasti poistaa %s poikkeuksen?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Haluatko varmasti poistaa paketin %s?', + 'DELETE_IP_CONFIRMATION' => 'Haluatko varmasti poistaa IP-osoitteen %s?', + 'Welcome' => 'Tervetuloa', + 'LOGGED_IN_AS' => 'Kirjautunut käyttäjänä %s', + 'Error' => 'Virhe', + 'Invalid username or password' => 'Väärä käyttäjänimi tai salasana', + 'Invalid username or code' => 'Väärä käyttäjänimi tai koodi', + 'Passwords not match' => 'Salasanat eivät täsmää', + 'Please enter valid email address.' => 'Syötä toimiva sähköpostiosoite.', + 'Field "%s" can not be blank.' => 'Kenttä "%s" ei voi olla tyhjä.', + 'Password is too short.' => 'Salasana on liian lyhyt (min. 6 merkkiä)', + 'Error code:' => 'Virhekoodi: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" epäonnistui', + 'IP address is in use' => 'IP-osoite on käytössä', + 'BACKUP_SCHEDULED' => 'Tehtävä on lisätty jonoon. Saat sähköpostin kun varmuuskopiosi on valmis ladattavaksi.', + 'BACKUP_EXISTS' => 'Aikaisempi varmuuskopiointi on vielä käynnissä, odota kunnes se päättyy.', + 'RESTORE_SCHEDULED' => 'Tehtävä on lisätty jonoon. Saat sähköpostin kun varmuuskopiosi on valmis ladattavaksi.', + 'RESTORE_EXISTS' => 'Aikaisempi palautus on vielä käynnissä, odota kunnes se päättyy.', + + 'WEB_EXCLUSIONS' => "Syötä domainin nimi, yksi per rivi. Syötä '*', jos haluat ohittaa kaikki domainit. Ohittaksesi pois tiettyjä hakemistoja käytä seuraavaa rakennetta: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Syötä domainin nimi, yksi per rivi. Syötä '*', jos haluat ohittaa kaikki domainit.", + 'MAIL_EXCLUSIONS' => "Syötä domainin nimi, yksi per rivi. Syötä '*', jos haluat ohittaa kaikki domainit. Ohittaksesi pois tiettyjä hakemistoja käytä seuraavaa rakennetta: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Syötä koko tietokannan nimi, yksi per rivi. Syötä '*', jos haluat ohittaa kaikki tietokannat.", + 'CRON_EXCLUSIONS' => "Ohittaaksesi kaikki tehtävät käytä '*'", + 'USER_EXCLUSIONS' => "Syötä kansion nimi, yksi per rivi. Ohittaaksesi kaikki tietokannat syötä '*'", + + 'Welcome to Vesta Control Panel' => 'Tervetuloa Vesta Hallintapaneeliin', + 'MAIL_FROM' => 'Vesta Hallintapaneeli ', + 'GREETINGS_GORDON_FREEMAN' => "Morjens, %s %s,\n", + 'GREETINGS' => "Morjens,\n", + 'ACCOUNT_READY' => "Käyttätilisi on luotu ja odottaa innokkaasti ensimmäistä kirjautumista.\n\nhttps://%s/login/\nKäyttäjä: %s\nSalasana: %s\n\n--\nVesta Hallintapaneeli\n", + + 'FTP login credentials' => 'FTP-tilitiedot', + 'FTP_ACCOUNT_READY' => "FTP-tili on luotu ja odottaa innokkaasti ensimmäistä kirjautumista.\n\nHostname: %s\nKäyttäjä: %s_%s\nSalasana: %s\n\n--\nVesta Hallintapaneeli\n", + + 'Database Credentials' => 'Tietokannan-tilitiedot', + 'DATABASE_READY' => "Tietokanta on luotu onnistuneesti.\n\nTietokanta: %s\nKäyttäjä: %s\nSalasana: %s\n%s\n\n--\nVesta Hallintapaneeli\n", + + 'forgot password' => 'unohditko salasanan?', + 'Confirm' => 'Hyväksy', + 'New Password' => 'Uusi salasana', + 'Confirm Password' => 'Hyväksy salasana', + 'Reset' => 'Nollaa', + 'Reset Code' => 'Nollauskoodi', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'Salasanan nollauskoodi on lähetetty sähköpostiisi
', + 'MAIL_RESET_SUBJECT' => 'Salana vaihdettiin %s', + 'PASSWORD_RESET_REQUEST' => "Nollataksesi hallintapaneelin salasanan, seuraa tätä linkkiä:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nVaihtoehtoisesti voit mennä https://%s/reset/?action=code&user=%s ja syöttää nollauskoodin:\n%s\n\nJos et varta vasten pyytänyt tätä salasananvaihtoa, mene paniikkiin ja ota yhteyttä ylläpitoon.\n\n--\nVesta Hallintapaneeli\n", +); \ No newline at end of file From 955fbd3863d2a25dbfcfd5a43b5293c98d362859 Mon Sep 17 00:00:00 2001 From: Onni Hakala Date: Fri, 11 Jul 2014 12:27:16 +0300 Subject: [PATCH 36/84] fixed translations to fit and be more relevant --- web/inc/i18n/fi.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php index ee1adeedd..dfab20349 100644 --- a/web/inc/i18n/fi.php +++ b/web/inc/i18n/fi.php @@ -17,13 +17,13 @@ $LANG['fi'] = array( 'Log in' => 'Kirjaudu sisään', 'Log out' => 'Kirjaudu ulos', - 'USER' => 'KÄYTTÄJÄ', + 'USER' => 'TILIT', 'WEB' => 'WEB', 'DNS' => 'DNS', - 'MAIL' => 'EMAIL', + 'MAIL' => 'MAIL', 'DB' => 'DB', 'CRON' => 'CRON', - 'BACKUP' => 'VARMUUSKOPIOT', + 'BACKUP' => 'BACKUP', 'Add User' => 'Lisää käyttäjä', 'Add Domain' => 'Lisää domaini', @@ -41,10 +41,10 @@ $LANG['fi'] = array( 'Add IP' => 'Lisää IP', 'Search' => 'Haku', 'Overall Statistics' => 'Kokonaistilastot', - 'Daily' => 'Päivittäin', - 'Weekly' => 'Viikottain', - 'Monthly' => 'Kuukausittain', - 'Yearly' => 'Vuosittain', + 'Daily' => 'Päivä', + 'Weekly' => 'Viikko', + 'Monthly' => 'Kuukausi', + 'Yearly' => 'Vuosi', 'Add' => 'Lisää', 'Back' => 'Takaisin', 'Save' => 'Tallenna', @@ -63,7 +63,7 @@ $LANG['fi'] = array( 'unsuspend' => 'palauta', 'delete' => 'poista', 'show per user' => 'näytä per käyttäjä', - 'login as' => 'kirjautunut', + 'login as' => 'kirjaudu sisään käyttäjänä', 'logout' => 'kirjaudu ulos', 'edit' => 'muokkaa', 'open webstats' => 'avaa webtilastot', @@ -130,11 +130,13 @@ $LANG['fi'] = array( 'minute' => 'minuutti', 'hour' => 'tunti', 'day' => 'päivä', - 'days' => 'päivät', - 'hours' => 'tunnit', - 'minutes' => 'minuutit', - 'month' => 'kuukausi', + 'days' => 'päivää', + 'hours' => 'tuntia', + 'minutes' => 'minuuttia', + 'month' => 'kuukautta', 'package' => 'paketti', + 'traffic' => 'tiedonsiirto', + 'disk' => 'levytila', 'Bandwidth' => 'Kaistanleveys', 'Disk' => 'Levy', 'Web' => 'Web', @@ -155,7 +157,7 @@ $LANG['fi'] = array( 'Mail Domains' => 'Sähköpostidomainit', 'Mail Accounts' => 'Sähköpostikäyttäjät', 'Cron Jobs' => 'Cron-tehtävät', - 'SSH Access' => 'SSH oikeudet', + 'SSH Access' => 'SSH-oikeudet', 'IP Addresses' => 'IP-osoitteet', 'Backups' => 'Varmuuskopiot', 'Backup System' => 'Varmuuskopioi järjestelmä', @@ -203,9 +205,11 @@ $LANG['fi'] = array( 'Memory Usage' => 'Muistinkäyttö', 'HTTPD Usage' => 'HTTPD-käyttö', 'NGINX Usage' => 'NGINX-käyttö', + 'APACHE2 Usage' => 'APACHE2-käyttö', 'MySQL Usage on localhost' => 'MySQL-käyttö @ localhost', 'PostgreSQL Usage on localhost' => 'PostgreSQL-käyttö @ localhost', - 'Bandwidth Usage eth0' => 'Kaistan käyttö eth0', + 'Bandwidth Usage eth0' => 'Kaistankäyttö eth0', + 'Bandwidth Usage eth1' => 'Kaistankäyttö eth1', 'FTP Usage' => 'FTP-käyttö', 'SSH Usage' => 'SSH-käyttö', 'reverse proxy' => 'reverse proxy', From d2e973e54b22c385d0c365d400330a52d84a165c Mon Sep 17 00:00:00 2001 From: Onni Hakala Date: Mon, 14 Jul 2014 23:33:21 +0300 Subject: [PATCH 37/84] log in text was too long --- web/inc/i18n/fi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php index dfab20349..a61e2d26f 100644 --- a/web/inc/i18n/fi.php +++ b/web/inc/i18n/fi.php @@ -14,7 +14,7 @@ $LANG['fi'] = array( 'Log' => 'Loki', 'Services' => 'Palvelut', 'Updates' => 'Päivitykset', - 'Log in' => 'Kirjaudu sisään', + 'Log in' => 'Kirjaudu', 'Log out' => 'Kirjaudu ulos', 'USER' => 'TILIT', From 95d520f50a08511d7bc9a05c77929ffb7c3bcf47 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sat, 19 Jul 2014 18:29:05 +0200 Subject: [PATCH 38/84] exim: act correctly on dnsbl+authentication When an (possibly) authenticated user tried to send mail from an address listed on any DNSBL, he was rejected without any chance to authenticate, thus proving he is not a spammer. This commit rearranges the order of checks so that authentication is possible even from DNSBL'd IP. --- install/debian/exim4.conf.template | 6 ++++-- install/rhel/exim-smarthost.conf | 6 ++++-- install/rhel/exim.conf | 6 ++++-- install/ubuntu/exim4.conf.template | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/install/debian/exim4.conf.template b/install/debian/exim4.conf.template index a5d353a33..30c13d4af 100644 --- a/install/debian/exim4.conf.template +++ b/install/debian/exim4.conf.template @@ -51,8 +51,6 @@ acl_check_spammers: drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} accept acl_check_mail: @@ -102,6 +100,10 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= + deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text + hosts = !+whitelist + dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} + require message = relay not permitted domains = +local_domains : +relay_to_domains diff --git a/install/rhel/exim-smarthost.conf b/install/rhel/exim-smarthost.conf index 99b1c90c7..1f649a9e7 100644 --- a/install/rhel/exim-smarthost.conf +++ b/install/rhel/exim-smarthost.conf @@ -51,8 +51,6 @@ acl_check_spammers: drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} accept acl_check_mail: @@ -102,6 +100,10 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= + deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text + hosts = !+whitelist + dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} + require message = relay not permitted domains = +local_domains : +relay_to_domains diff --git a/install/rhel/exim.conf b/install/rhel/exim.conf index 8567cb181..25d99fbd5 100644 --- a/install/rhel/exim.conf +++ b/install/rhel/exim.conf @@ -51,8 +51,6 @@ acl_check_spammers: drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} accept acl_check_mail: @@ -102,6 +100,10 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= + deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text + hosts = !+whitelist + dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} + require message = relay not permitted domains = +local_domains : +relay_to_domains diff --git a/install/ubuntu/exim4.conf.template b/install/ubuntu/exim4.conf.template index a5d353a33..30c13d4af 100644 --- a/install/ubuntu/exim4.conf.template +++ b/install/ubuntu/exim4.conf.template @@ -51,8 +51,6 @@ acl_check_spammers: drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} accept acl_check_mail: @@ -102,6 +100,10 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= + deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text + hosts = !+whitelist + dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} + require message = relay not permitted domains = +local_domains : +relay_to_domains From 26f0c6595348bd2b6c9cc3b30736d350afb782c7 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Jul 2014 00:17:41 +0300 Subject: [PATCH 39/84] SSL CA validation improvements --- func/domain.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index fc10c38da..65d62f73d 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -327,15 +327,9 @@ is_web_domain_cert_valid() { fi if [ -e "$ssl_dir/$domain.ca" ]; then - ca_vrf=$(openssl verify $ssl_dir/$domain.ca 2>/dev/null |grep 'OK') - if [ -z "$ca_vrf" ]; then - echo "Error: ssl certificate authority is not valid" - log_event "$E_INVALID" "$EVENT" - exit $E_INVALID - fi - - crt_vrf=$(openssl verify -untrusted $ssl_dir/$domain.ca \ - $ssl_dir/$domain.crt 2>/dev/null |grep 'OK') + crt_vrf=$(openssl verify -purpose sslserver \ + -CAfile $ssl_dir/$domain.ca $ssl_dir/$domain.crt 2>/dev/null |\ + grep 'OK') if [ -z "$crt_vrf" ]; then echo "Error: root or/and intermediate cerificate not found" log_event "$E_NOTEXIST" "$EVENT" From 668a436f8a309f7fc018eb4627c77bd1805a35f8 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Jul 2014 17:09:59 +0300 Subject: [PATCH 40/84] manually merged finish translation --- web/inc/i18n/fi.php | 405 -------------------------------------------- 1 file changed, 405 deletions(-) diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php index 0b9f74462..c0b4b0b35 100644 --- a/web/inc/i18n/fi.php +++ b/web/inc/i18n/fi.php @@ -1,38 +1,18 @@ >>>>>> d2e973e54b22c385d0c365d400330a52d84a165c * RJuho (juho.rasanen@kotikone.fi) */ $LANG['fi'] = array( 'Packages' => 'Paketit', 'IP' => 'IP', -<<<<<<< HEAD - 'Graphs' => 'Kaaviot', -======= 'Graphs' => 'Kuvaajat', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'Statistics' => 'Tilastot', 'Log' => 'Loki', 'Services' => 'Palvelut', 'Updates' => 'Päivitykset', -<<<<<<< HEAD - 'Log in' => 'Kirjaudu sisään', - 'Log out' => 'Kirjaudu ulos', - - 'USER' => 'KAYTTÄJÄ', - 'WEB' => 'WEB', - 'DNS' => 'DNS', - 'MAIL' => 'EMAIL', - 'DB' => 'DB', - 'CRON' => 'CRON', - 'BACKUP' => 'VARMUUSKOPIOT', -======= 'Log in' => 'Kirjaudu', 'Log out' => 'Kirjaudu ulos', @@ -43,7 +23,6 @@ $LANG['fi'] = array( 'DB' => 'DB', 'CRON' => 'CRON', 'BACKUP' => 'BACKUP', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'Add User' => 'Lisää käyttäjä', 'Add Domain' => 'Lisää domaini', @@ -53,30 +32,18 @@ $LANG['fi'] = array( 'Add Mail Domain' => 'Lisää email domain', 'Add Mail Account' => 'Lisää email käyttäjä', 'Add Database' => 'Lisää tietokanta', -<<<<<<< HEAD - 'Add Cron Job' => 'Lisää Cron ajoitus', -======= 'Add Cron Job' => 'Lisää Cron-tehtävä', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'Create Backup' => 'Luo varmuuskopio', 'Configure' => 'Määritä', 'Restore All' => 'Palauta kaikki', 'Add Package' => 'Lisää paketti', 'Add IP' => 'Lisää IP', 'Search' => 'Haku', -<<<<<<< HEAD - 'Overall Statistics' => 'Yleiset tilastot', - 'Daily' => 'Päivittäin', - 'Weekly' => 'Viikottain', - 'Monthly' => 'Kuukausittain', - 'Yearly' => 'Vuosittain', -======= 'Overall Statistics' => 'Kokonaistilastot', 'Daily' => 'Päivä', 'Weekly' => 'Viikko', 'Monthly' => 'Kuukausi', 'Yearly' => 'Vuosi', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'Add' => 'Lisää', 'Back' => 'Takaisin', 'Save' => 'Tallenna', @@ -87,23 +54,6 @@ $LANG['fi'] = array( 'rebuild' => 'palauta', 'rebuild web' => 'palauta web', 'rebuild dns' => 'palauta dns', -<<<<<<< HEAD - 'rebuild mail' => 'palauta email', - 'rebuild db' => 'palauta db', - 'rebuild cron' => 'palauta cron', - 'update counters' => 'päivitä laskurit', - 'suspend' => 'keskeytä', - 'unsuspend' => 'älä keskeytä', - 'delete' => 'poista', - 'show per user' => 'näytä per käyttäjä', - 'login as' => 'kirjautunut', - 'logout' => 'kirjaudu ulos', - 'edit' => 'muokkaa', - 'open webstats' => 'avaa web tilastot', - 'view logs' => 'näytä lokit', - 'list records' => 'list %s records', //think - 'add record' => 'add record', //think -======= 'rebuild mail' => 'palauta sähköposti', 'rebuild db' => 'palauta tietokanta', 'rebuild cron' => 'palauta cron', @@ -119,31 +69,20 @@ $LANG['fi'] = array( 'view logs' => 'näytä lokit', 'list records' => 'listaa %s tietuetta', 'add record' => 'lisää tietue', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'list accounts' => 'listaa %s käyttäjää', 'add account' => 'lisää käyttäjä', 'open webmail' => 'avaa webmail', 'open %s' => 'avaa %s', 'download' => 'lataa', 'restore' => 'palauta', -<<<<<<< HEAD - 'configure restore settings' => 'määritä palautus asetukset', - 'stop' => 'pysäytä', - 'start' => 'aloita', -======= 'configure restore settings' => 'määritä palautusasetukset', 'stop' => 'pysäytä', 'start' => 'käynnistä', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'restart' => 'käynnistä uudelleen', 'update' => 'päivitä', 'generate' => 'generoi', 'Generate CSR' => 'generoi CSR', -<<<<<<< HEAD - 'reread IP' => 'reread IP', //think -======= 'reread IP' => 'lue IP uudelleen', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'enable autoupdate' => 'päivitä automaattisesti', 'disable autoupdate' => 'älä päivitä automaattisesti', @@ -151,28 +90,6 @@ $LANG['fi'] = array( 'Editing User' => 'Muokataan käyttäjää', 'Adding Domain' => 'Lisätään domainia', 'Editing Domain' => 'Muokataan domainia', -<<<<<<< HEAD - 'Adding DNS Domain' => 'Lisätään DNS domainia', - 'Editing DNS Domain' => 'Muokataan DNS domainia', - 'Adding DNS Record' => 'Lisätään DNS asetusta', - 'Editing DNS Record' => 'Muokataan DNS asetusta', - 'Adding Mail Domain' => 'Lisätään email domainia', - 'Editing Mail Domain' => 'Muokataan email domainia', - 'Adding Mail Account' => 'Lisätään email käyttäjää', - 'Editing Mail Account' => 'Muokataan email läyttäjää', - 'Adding database' => 'Lisätään tietokantaa', - 'Editing Cron Job' => 'Muokataan Cron tehtävää', - 'Adding Cron Job' => 'Lisätään Cron tehtävää', - 'Editing Database' => 'Muokataan tietokantaa', - 'Adding Package' => 'Lisätään pakettia', - 'Editing Package' => 'Muokataan pakettia', - 'Adding IP address' => 'Lisätään IP osoitetta', - 'Editing IP Address' => 'Muokataan IP osoitetta', - 'Editing Backup Exclusions' => 'Editing Backup Exclusions', //think - 'Generating CSR' => 'Generoidaan CSR', - 'Listing' => 'Listataan', - 'Search Results' => 'Haku tulokset', -======= 'Adding DNS Domain' => 'Lisätään DNS-domainia', 'Editing DNS Domain' => 'Muokataan DNS-domainia', 'Adding DNS Record' => 'Lisätään DNS-tietuetta', @@ -193,7 +110,6 @@ $LANG['fi'] = array( 'Generating CSR' => 'Generoidaan CSR', 'Listing' => 'Listataan', 'Search Results' => 'Hakutulokset', ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c 'active' => 'aktiivinen', 'spnd' => 'keskeytetty', @@ -206,326 +122,6 @@ $LANG['fi'] = array( 'yes' => 'kyllä', 'no' => 'ei', 'none' => 'ei mitään', -<<<<<<< HEAD - 'pb' => 'pb', //? - 'tb' => 'tb', //? - 'gb' => 'gb', //? - 'mb' => 'mb', //? - 'minute' => 'minuutti', - 'hour' => 'tunti', - 'day' => 'päivä', - 'days' => 'päivät', - 'hours' => 'tunnit', - 'minutes' => 'minuutit', - 'month' => 'kuukausi', - 'package' => 'paketti', - 'Bandwidth' => 'Kaistanleveys', - 'Disk' => 'Levy', - 'Web' => 'Web', - 'Mail' => 'EMail', - 'Databases' => 'Tietokannat', - 'User Directories' => 'Käyttäjähakemistot', - 'Template' => 'Teema', - 'Web Template' => 'Apache teema', - 'Proxy Template' => 'Nginx teema', - 'DNS Template' => 'DNS teema', - 'Web Domains' => 'Web domainit', - 'SSL Domains' => 'SSL domainit', - 'Web Aliases' => 'Web aliakset', - 'per domain' => 'per domaini', - 'DNS domains' => 'DNS domainit', - 'DNS domains' => 'DNS domainit', - 'DNS records' => 'DNS records' , //think - 'Name Servers' => 'Nimipalvelimet', - 'Mail Domains' => 'EMail Domainit', - 'Mail Accounts' => 'EMail käyttäjät', - 'Cron Jobs' => 'Cron tehtävät', - 'SSH Access' => 'SSH oikeudet', - 'IP Addresses' => 'IP osoitteet', - 'Backups' => 'Varmuuskopiot', - 'Backup System' => 'Backup järjestelmä', - 'backup exclusions' => 'varmuuskopio poikkeukset', - 'template' => 'teema', - 'SSL Support' => 'SSL tuki', - 'SSL Home Directory' => 'SSL koti', - 'Proxy Support' => 'Nginx tuki', - 'Proxy Extensions' => 'Nginx laajennukset', - 'Web Statistics' => 'Web tilastot', - 'Additional FTP Account' => 'Ylimääräinen FTP', - 'SOA' => 'SOA', - 'TTL' => 'TTL', - 'Expire' => 'Päättyy', - 'Records' => 'Merkinnät', //ready - 'Catchall email' => 'Catchall email', - 'AntiVirus Support' => 'AntiVirus Support', - 'AntiSpam Support' => 'AntiSpam Support', - 'DKIM Support' => 'DKIM Support', - 'Accounts' => 'Accounts', - 'Quota' => 'Quota', - 'Autoreply' => 'Autoreply', - 'Forward to' => 'Forward to', - 'Do not store forwarded mail' => 'Do not store forwarded mail', - 'database' => 'database', - 'User' => 'User', - 'Host' => 'Host', - 'Charset' => 'Charset', - 'Min' => 'Min', - 'Hour' => 'Hour', - 'Day' => 'Day', - 'Month' => 'Month', - 'Day of week' => 'Day of week', - 'local' => 'local', - 'Run Time' => 'Run Time', - 'Backup Size' => 'Backup Size', - 'SYS' => 'SYS', - 'Domains' => 'Domains', - 'Status' => 'Status', - 'shared' => 'shared', - 'dedicated' => 'dedicated', - 'Owner' => 'Owner', - 'Users' => 'Users', - 'Load Average' => 'Load Average', - 'Memory Usage' => 'Memory Usage', - 'HTTPD Usage' => 'HTTPD Usage', - 'NGINX Usage' => 'NGINX Usage', - 'MySQL Usage on localhost' => 'MySQL Usage on localhost', - 'PostgreSQL Usage on localhost' => 'PostgreSQL Usage on localhost', - 'Bandwidth Usage eth0' => 'Bandwidth Usage eth0', - 'FTP Usage' => 'FTP Usage', - 'SSH Usage' => 'SSH Usage', - 'reverse proxy' => 'reverse proxy', - 'web server' => 'web server', - 'dns server' => 'dns server', - 'mail server' => 'mail server', - 'pop/imap server' => 'pop/imap server', - 'email antivirus' => 'email antivirus', - 'email antispam' => 'email antispam', - 'database server' => 'database server', - 'ftp server' => 'ftp server', - 'job scheduler' => 'job scheduler', - 'CPU' => 'CPU', - 'Memory' => 'Memory', - 'Uptime' => 'Uptime', - 'core package' => 'core package', - 'php interpreter' => 'php interpreter', - 'internal web server' => 'internal web server', - 'Version' => 'Version', - 'Release' => 'Release', - 'Architecture' => 'Architecture', - 'Object' => 'Object', - 'Owner' => 'Owner', - 'Username' => 'Username', - 'Password' => 'Password', - 'Email' => 'Email', - 'Package' => 'Package', - 'Language' => 'Language', - 'First Name' => 'First Name', - 'Last Name' => 'Last Name', - 'Send login credentials to email address' => 'Send login credentials to email address', - 'Default Template' => 'Default Template', - 'Default Name Servers' => 'Default Name Servers', - 'Domain' => 'Domain', - 'DNS Support' => 'DNS Support', - 'Mail Support' => 'Mail Support', - 'Advanced options' => 'Advanced options', - 'Aliases' => 'Aliases', - 'SSL Certificate' => 'SSL Certificate', - 'SSL Key' => 'SSL Key', - 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', - 'SSL CSR' => 'SSL CSR', - 'optional' => 'optional', - 'internal' => 'internal', - 'Statistics Authorization' => 'Statistics Authorization', - 'Statistics Auth' => 'Statistics Auth', - 'Account' => 'Account', - 'Prefix will be automaticaly added to username' => 'Prefix %s will be automaticaly added to username', - 'Send FTP credentials to email' => 'Send FTP credentials to email', - 'Expiration Date' => 'Expiration Date', - 'YYYY-MM-DD' => 'YYYY-MM-DD', - 'Name servers' => 'Name servers', - 'Record' => 'Record', - 'IP or Value' => 'IP or Value', - 'Priority' => 'Priority', - 'Record Number' => 'Record Number', - 'in megabytes' => 'in megabytes', - 'Message' => 'Message', - 'use local-part' => 'use local-part', - 'one or more email addresses' => 'one or more email addresses', - 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user', - 'Database' => 'Database', - 'Type' => 'Type', - 'Minute' => 'Minute', - 'Command' => 'Command', - 'Package Name' => 'Package Name', - 'Netmask' => 'Netmask', - 'Interface' => 'Interface', - 'Shared' => 'Shared', - 'Assigned user' => 'Assigned user', - 'Assigned domain' => 'Assigned domain', - 'NAT IP association' => 'NAT IP association', - 'shell' => 'shell', - 'web domains' => 'web domains', - 'web aliases' => 'web aliases', - 'dns records' => 'dns records', - 'mail domains' => 'mail domains', - 'mail accounts' => 'mail accounts', - 'accounts' => 'accounts', - 'databases' => 'databases', - 'cron jobs' => 'cron jobs', - 'backups' => 'backups', - 'quota' => 'quota', - 'day of week' => 'day of week', - 'cmd' => 'cmd', - 'users' => 'users', - 'domains' => 'domains', - 'aliases' => 'aliases', - 'records' => 'records', - 'jobs' => 'jobs', - 'username' => 'username', - 'password' => 'password', - 'type' => 'type', - 'charset' => 'charset', - 'domain' => 'domain', - 'ip' => 'ip', - 'ip address' => 'ip address', - 'IP address' => 'IP address', - 'netmask' => 'netmask', - 'interface' => 'interface', - 'assigned user' => 'assigned user', - 'ns1' => 'ns1', - 'ns2' => 'ns2', - 'user' => 'user', - 'email' => 'email', - 'first name' => 'first name', - 'last name' => 'last name', - 'account' => 'account', - 'ssl certificate' => 'ssl certificate', - 'ssl key' => 'ssl key', - 'stats user password' => 'stats user password', - 'stats username' => 'stats username', - 'stats password' => 'stats password', - 'ftp user password' => 'ftp user password', - 'ftp user' => 'ftp user', - 'Last 70 lines of %s.%s.log' => 'Last 70 lines of %s.%s.log', - 'Download AccessLog' => 'Download AccessLog', - 'Download ErrorLog' => 'Download ErrorLog', - 'Country' => 'Country', - '2 letter code' => '2 letter code', - 'State / Province' => 'State / Province', - 'City / Locality' => 'City / Locality', - 'Organization' => 'Organization', - - '1 account' => '1 account', - '%s accounts' => '%s accounts', - '1 domain' => '1 domain', - '%s domains' => '%s domains', - '1 record' => '1 record', - '%s records' => '%s records', - '1 mail account' => '1 mail account', - '%s mail accounts' => '%s mail accounts', - '1 database' => '1 database', - '%s databases' => '%s databases', - '1 cron job' => '1 cron job', - '%s cron jobs' => '%s cron jobs', - '1 archive' => '1 archive', - '%s archives' => '%s archives', - '1 package' => '1 package', - '%s packages' => '%s packages', - '1 IP address' => '1 IP address', - '%s IP addresses' => '%s IP addresses', - '1 month' => '1 month', - '%s months' => '%s months', - '1 log record' => '1 log record', - '%s log records' => '%s log records', - '1 object' => '1 object', - '%s objects' => '%s objects', - 'no exclusions' => 'no exclusions', - - 'USER_CREATED_OK' => 'User %s has been created successfully', - 'WEB_DOMAIN_CREATED_OK' => 'Domain %s has been created successfully.', - 'DNS_DOMAIN_CREATED_OK' => 'DNS domain %s has been created successfully.', - 'DNS_RECORD_CREATED_OK' => 'Record %s.%s has been created successfully.', - 'MAIL_DOMAIN_CREATED_OK' => 'Mail domain %s has been created successfully.', - 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully', - 'DATABASE_CREATED_OK' => 'Database %s has been created successfully', - 'CRON_CREATED_OK' => 'Cron job has been created successfully.', - 'IP_CREATED_OK' => 'IP address %s has been created successfully.', - 'PACKAGE_CREATED_OK' => 'Package %s has been created successfully.', - 'SSL_GENERATED_OK' => 'Certificate has been generated successfully.', - 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled', - 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled', - 'Changes has been saved.' => 'Changes has been saved.', - 'Confirmation' => 'Confirmation', - 'DELETE_USER_CONFIRMATION' => 'Are you sure to delete user %s?', - 'SUSPEND_USER_CONFIRMATION' => 'Are you sure to suspend user %s?', - 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure to unsuspend user %s?', - 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure to delete domain %s?', - 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to suspend domain %s?', - 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to unsuspend domain %s?', - 'DELETE_RECORD_CONFIRMATION' => 'Are you sure to delete record %s?', - 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure to suspend record %s?', - 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure to unsuspend record %s?', - 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to delete %s?', - 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to suspend %s?', - 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to unsuspend %s?', - 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure to delete database %s?', - 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to suspend database %s?', - 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to unsuspend database %s?', - 'DELETE_CRON_CONFIRMATION' => 'Are you sure to delete cron job?', - 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure to suspend cron job?', - 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure to unsuspend cron job?', - 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure to delete %s backup?', - 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure to delete %s exclusion?', - 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure to delete package %s?', - 'DELETE_IP_CONFIRMATION' => 'Are you sure to delere IP address %s?', - 'Welcome' => 'Welcome', - 'LOGGED_IN_AS' => 'Logged in as user %s', - 'Error' => 'Error', - 'Invalid username or password' => 'Invalid username or password', - 'Invalid username or code' => 'Invalid username or code', - 'Passwords not match' => 'Passwords not match', - 'Please enter valid email address.' => 'Please enter valid email address.', - 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', - 'Password is too short.' => 'Password is too short (minimum is 6 characters)', - 'Error code:' => 'Error code: %s', - 'SERVICE_ACTION_FAILED' => '"%s" "%s" failed', - 'IP address is in use' => 'IP address is in use', - 'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', - 'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.', - 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', - 'RESTORE_EXISTS' => 'An existing restoration task is already running. Please wait for it to finish before launching it again.', - - 'WEB_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific dirs use following format: domain.com:public_html/cache:public_html/tmp", - 'DNS_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *", - 'MAIL_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific accounts use following format: domain.com:info:support:postmaster", - 'DB_EXCLUSIONS' => "Type full database name, one per line. To exclude all databases use *", - 'CRON_EXCLUSIONS' => "To exclude all jobs use *", - 'USER_EXCLUSIONS' => "Type directory name, one per line. To exlude all dirs use *", - - 'Welcome to Vesta Control Panel' => 'Welcome to Vesta Control Panel', - 'MAIL_FROM' => 'Vesta Control Panel ', - 'GREETINGS_GORDON_FREEMAN' => "Hello, %s %s,\n", - 'GREETINGS' => "Hello,\n", - 'ACCOUNT_READY' => "Your account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", - - 'FTP login credentials' => 'FTP login credentials', - 'FTP_ACCOUNT_READY' => "FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", - - 'Database Credentials' => 'Database Credentials', - 'DATABASE_READY' => "Database has been created successfully.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", - - 'forgot password' => 'forgot password', - 'Confirm' => 'Confirm', - 'New Password' => 'New Password', - 'Confirm Password' => 'Confirm Password', - 'Reset' => 'Reset', - 'Reset Code' => 'Reset Code', - 'RESET_NOTICE' => '', - 'RESET_CODE_SENT' => 'Password reset code has been sent to your email address
', - 'MAIL_RESET_SUBJECT' => 'Password Reset at %s', - 'PASSWORD_RESET_REQUEST' => "To reset your control panel password, please follow this link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, you may go to https://%s/reset/?action=code&user=%s and enter the following reset code:\n%s\n\nIf you did not request password reset, please ignore this message and accept our apologies.\n\n--\nVesta Control Panel\n", -); -======= 'pb' => 'pb', //petatavu 'tb' => 'tb', //teratavu 'gb' => 'gb', //gigatavu @@ -847,4 +443,3 @@ $LANG['fi'] = array( 'MAIL_RESET_SUBJECT' => 'Salana vaihdettiin %s', 'PASSWORD_RESET_REQUEST' => "Nollataksesi hallintapaneelin salasanan, seuraa tätä linkkiä:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nVaihtoehtoisesti voit mennä https://%s/reset/?action=code&user=%s ja syöttää nollauskoodin:\n%s\n\nJos et varta vasten pyytänyt tätä salasananvaihtoa, mene paniikkiin ja ota yhteyttä ylläpitoon.\n\n--\nVesta Hallintapaneeli\n", ); ->>>>>>> d2e973e54b22c385d0c365d400330a52d84a165c From 8272f0b21ab25601ad9370240db518b1616ba5e3 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Jul 2014 17:10:21 +0300 Subject: [PATCH 41/84] shortened button labels --- web/inc/i18n/it.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index e4d47f165..020b5a852 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -25,11 +25,11 @@ $LANG['it'] = array( 'Add User' => 'Aggiungi User', 'Add Domain' => 'Aggiungi Dominio', - 'Add Web Domain' => 'Aggiungio Dominio Web', - 'Add DNS Domain' => 'Aggiungi Dominio DNS', - 'Add DNS Record' => 'Aggiungi Record DNS', - 'Add Mail Domain' => 'Aggiungi Dominio Mail', - 'Add Mail Account' => 'Aggiungi Account Mail', + 'Add Web Domain' => 'Aggiungio Dominio', + 'Add DNS Domain' => 'Aggiungi Dominio', + 'Add DNS Record' => 'Aggiungi Record', + 'Add Mail Domain' => 'Aggiungi Dominio', + 'Add Mail Account' => 'Aggiungi Account', 'Add Database' => 'Addiungi Database', 'Add Cron Job' => 'Aggiungi Cron Job', 'Create Backup' => 'Crea Backup', From de007537ed059544f86130823d049d8db26135a6 Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 22 Jul 2014 17:30:50 +0200 Subject: [PATCH 42/84] Removed duplicate line --- web/inc/i18n/en.php | 1 - 1 file changed, 1 deletion(-) diff --git a/web/inc/i18n/en.php b/web/inc/i18n/en.php index f4a8613f2..cb3ebd07d 100644 --- a/web/inc/i18n/en.php +++ b/web/inc/i18n/en.php @@ -148,7 +148,6 @@ $LANG['en'] = array( 'Web Aliases' => 'Web Aliases', 'per domain' => 'per domain', 'DNS domains' => 'DNS Domains', - 'DNS domains' => 'DNS domains', 'DNS records' => 'DNS records' , 'Name Servers' => 'Name Servers', 'Mail Domains' => 'Mail Domains', From dd227a09bd36a08539245f289ccd0a101026c96e Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 22 Jul 2014 18:31:02 +0200 Subject: [PATCH 43/84] Fix message on automatic update --- web/add/cron/autoupdate/index.php | 2 +- web/delete/cron/autoupdate/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/add/cron/autoupdate/index.php b/web/add/cron/autoupdate/index.php index c3866579d..53d50c059 100644 --- a/web/add/cron/autoupdate/index.php +++ b/web/add/cron/autoupdate/index.php @@ -7,7 +7,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); if ($_SESSION['user'] == 'admin') { exec (VESTA_CMD."v-add-cron-vesta-autoupdate", $output, $return_var); - $_SESSION['error_msg'] = __('Autoupdate has been susscessfully enabled'); + $_SESSION['error_msg'] = __('Autoupdate has been successfully enabled'); unset($output); } diff --git a/web/delete/cron/autoupdate/index.php b/web/delete/cron/autoupdate/index.php index 14d297854..ad670ef03 100644 --- a/web/delete/cron/autoupdate/index.php +++ b/web/delete/cron/autoupdate/index.php @@ -7,7 +7,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); if ($_SESSION['user'] == 'admin') { exec (VESTA_CMD."v-delete-cron-vesta-autoupdate", $output, $return_var); - $_SESSION['error_msg'] = __('Autoupdate has been susscessfully disabled'); + $_SESSION['error_msg'] = __('Autoupdate has been successfully disabled'); unset($output); } From aa042e06373372ba2285b24f20777fd405e4acf4 Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 22 Jul 2014 18:40:43 +0200 Subject: [PATCH 44/84] Update italian translation --- web/inc/i18n/it.php | 86 ++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index 020b5a852..617482bb1 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -1,7 +1,8 @@ 'CRON', 'BACKUP' => 'BACKUP', - 'Add User' => 'Aggiungi User', - 'Add Domain' => 'Aggiungi Dominio', - 'Add Web Domain' => 'Aggiungio Dominio', - 'Add DNS Domain' => 'Aggiungi Dominio', - 'Add DNS Record' => 'Aggiungi Record', - 'Add Mail Domain' => 'Aggiungi Dominio', - 'Add Mail Account' => 'Aggiungi Account', - 'Add Database' => 'Addiungi Database', - 'Add Cron Job' => 'Aggiungi Cron Job', + 'Add User' => 'Nuovo Utente', + 'Add Domain' => 'Nuovo Dominio', + 'Add Web Domain' => 'Nuovo Dominio', + 'Add DNS Domain' => 'Nuova Zona DNS', + 'Add DNS Record' => 'Nuovo Record', + 'Add Mail Domain' => 'Nuovo Dominio', + 'Add Mail Account' => 'Nuovo Account', + 'Add Database' => 'Nuovo Database', + 'Add Cron Job' => 'Nuovo Cron Job', 'Create Backup' => 'Crea Backup', 'Configure' => 'Configura', 'Restore All' => 'Ripristina Tutto', - 'Add Package' => 'Aggiungi Pacchetto', + 'Add Package' => 'Nuovo Pacchetto', 'Add IP' => 'Aggiungi IP', 'Search' => 'Cerca', 'Overall Statistics' => 'Statistiche Generali', - 'Daily' => 'Giornaliere', - 'Weekly' => 'Settimanali', - 'Monthly' => 'Mensili', - 'Yearly' => 'Annuali', + 'Daily' => 'Giornaliero', + 'Weekly' => 'Settimanale', + 'Monthly' => 'Mensile', + 'Yearly' => 'Annuale', 'Add' => 'Aggiungi', 'Back' => 'Indietro', 'Save' => 'Salva', @@ -66,9 +67,9 @@ $LANG['it'] = array( 'edit' => 'modifica', 'open webstats' => 'apri webstats', 'view logs' => 'visualizza logs', - 'list records' => 'list %s records', - 'add record' => 'add record', - 'list accounts' => 'mostra %s accounts', + 'list records' => 'mostra %s record', + 'add record' => 'nuovo record', + 'list accounts' => 'mostra %s account', 'add account' => 'aggiungi account', 'open webmail' => 'apri webmail', 'open %s' => 'apri %s', @@ -80,8 +81,8 @@ $LANG['it'] = array( 'restart' => 'riavvia', 'update' => 'aggiorna', 'generate' => 'genera', - 'Generate CSR' => 'Generate CSR', - 'reread IP' => 'reread IP', + 'Generate CSR' => 'Genera CSR', + 'reread IP' => 'rileggi IP', 'enable autoupdate' => 'abilita aggiornamenti automatici', 'disable autoupdate' => 'disabilita aggiornamenti automatici', @@ -106,7 +107,7 @@ $LANG['it'] = array( 'Adding IP address' => 'Aggiunta Indirizzo IP', 'Editing IP Address' => 'Modifica Indirizzo IP', 'Editing Backup Exclusions' => 'Modifica Esclusioni Backup', - 'Generating CSR' => 'Generazione CSR in corso', + 'Generating CSR' => 'Genera CSR', 'Listing' => 'Lista', 'Search Results' => 'Risultati Ricerca', @@ -145,14 +146,13 @@ $LANG['it'] = array( 'DNS Template' => 'DNS Template', 'Web Domains' => 'Domini Web', 'SSL Domains' => 'Domini SSL', - 'Web Aliases' => 'Web Aliases', + 'Web Aliases' => 'Alias Web', 'per domain' => 'per dominio', - 'DNS domains' => 'Domini DNS', - 'DNS domains' => 'domini DNS', - 'DNS records' => 'records DNS' , + 'DNS domains' => 'Zone DNS', + 'DNS records' => 'Record DNS', 'Name Servers' => 'Name Servers', 'Mail Domains' => 'Domini Mail', - 'Mail Accounts' => 'Accounts Mail', + 'Mail Accounts' => 'Account Mail', 'Cron Jobs' => 'Cron Jobs', 'SSH Access' => 'Accesso SSH', 'IP Addresses' => 'Indirizzi IP', @@ -169,12 +169,12 @@ $LANG['it'] = array( 'SOA' => 'SOA', 'TTL' => 'TTL', 'Expire' => 'Scadenza', - 'Records' => 'Records', + 'Records' => 'Record', 'Catchall email' => 'Catchall email', 'AntiVirus Support' => 'Supporto AntiVirus', 'AntiSpam Support' => 'Supporto AntiSpam', 'DKIM Support' => 'Supporto DKIM', - 'Accounts' => 'Accounts', + 'Accounts' => 'Account', 'Quota' => 'Quota', 'Autoreply' => 'Autorisposta', 'Forward to' => 'Inoltra a', @@ -183,7 +183,7 @@ $LANG['it'] = array( 'User' => 'Utente', 'Host' => 'Host', 'Charset' => 'Charset', - 'Min' => 'Min', + 'Min' => 'Minuto', 'Hour' => 'Ora', 'Day' => 'Giorno', 'Month' => 'Mese', @@ -193,7 +193,7 @@ $LANG['it'] = array( 'Backup Size' => 'Dimensioni Backup', 'SYS' => 'SYS', 'Domains' => 'Domini', - 'Status' => 'Stati', + 'Status' => 'Stato', 'shared' => 'condiviso', 'dedicated' => 'dedicato', 'Owner' => 'Proprietario', @@ -242,7 +242,7 @@ $LANG['it'] = array( 'DNS Support' => 'Supporto DNS', 'Mail Support' => 'Supporto Mail', 'Advanced options' => 'Opzioni Avanzate', - 'Aliases' => 'Aliases', + 'Aliases' => 'Alias Dominio', 'SSL Certificate' => 'Certificato SSL', 'SSL Key' => 'SSL Key', 'SSL Certificate Authority / Intermediate' => 'SSL Certificate Authority / Intermediate', @@ -280,11 +280,11 @@ $LANG['it'] = array( 'shell' => 'shell', 'web domains' => 'domini web', 'web aliases' => 'aliases web', - 'dns records' => 'records dns', + 'dns records' => 'record dns', 'mail domains' => 'domini mail', - 'mail accounts' => 'accounts mail', - 'accounts' => 'accounts', - 'databases' => 'databases', + 'mail accounts' => 'account mail', + 'accounts' => 'account', + 'databases' => 'database', 'cron jobs' => 'cron jobs', 'backups' => 'backups', 'quota' => 'quota', @@ -292,8 +292,8 @@ $LANG['it'] = array( 'cmd' => 'cmd', 'users' => 'users', 'domains' => 'domini', - 'aliases' => 'aliases', - 'records' => 'records', + 'aliases' => 'alias', + 'records' => 'record', 'jobs' => 'jobs', 'username' => 'username', 'password' => 'password', @@ -330,13 +330,13 @@ $LANG['it'] = array( 'Organization' => 'Organizzazione', '1 account' => '1 account', - '%s accounts' => '%s accounts', + '%s accounts' => '%s account', '1 domain' => '1 dominio', '%s domains' => '%s domini', '1 record' => '1 record', - '%s records' => '%s records', + '%s records' => '%s record', '1 mail account' => '1 account mail', - '%s mail accounts' => '%s accounts mail', + '%s mail accounts' => '%s account mail', '1 database' => '1 database', '%s databases' => '%s databases', '1 cron job' => '1 cron job', @@ -350,7 +350,7 @@ $LANG['it'] = array( '1 month' => '1 mese', '%s months' => '%s mesi', '1 log record' => '1 log record', - '%s log records' => '%s log records', + '%s log records' => '%s log record', '1 object' => '1 oggetto', '%s objects' => '%s oggetti', 'no exclusions' => 'senza esclusioni', @@ -366,8 +366,8 @@ $LANG['it'] = array( 'IP_CREATED_OK' => 'L\'indirizzo IP %s è stato creato con successo.', 'PACKAGE_CREATED_OK' => 'Il pacchetto %s è stato creato con successo.', 'SSL_GENERATED_OK' => 'Il certificato è stato generato con successo.', - 'Autoupdate has been successfully enabled' => 'L\'aggiornamento automatico è stato abilitato', - 'Autoupdate has been successfully disabled' => 'L\'aggiornamento automatico è stato disabilitato', + 'Autoupdate has been successfully enabled' => 'Gli aggiornamenti automatici sono stati abilitati', + 'Autoupdate has been successfully disabled' => 'Gli aggiornamenti automatici sono stati disabilitati', 'Changes has been saved.' => 'I cambiamenti sono stati salvati.', 'Confirmation' => 'Conferma', 'DELETE_USER_CONFIRMATION' => 'Sei sicuro di voler cancellare l\'utente %s?', From aeebb627e3e74b00625b415f215657b2a2a28533 Mon Sep 17 00:00:00 2001 From: Fabio Cagliero Date: Tue, 22 Jul 2014 18:48:46 +0200 Subject: [PATCH 45/84] Restore wrong correction --- web/inc/i18n/en.php | 1 + web/inc/i18n/it.php | 1 + 2 files changed, 2 insertions(+) diff --git a/web/inc/i18n/en.php b/web/inc/i18n/en.php index cb3ebd07d..f4a8613f2 100644 --- a/web/inc/i18n/en.php +++ b/web/inc/i18n/en.php @@ -148,6 +148,7 @@ $LANG['en'] = array( 'Web Aliases' => 'Web Aliases', 'per domain' => 'per domain', 'DNS domains' => 'DNS Domains', + 'DNS domains' => 'DNS domains', 'DNS records' => 'DNS records' , 'Name Servers' => 'Name Servers', 'Mail Domains' => 'Mail Domains', diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index 617482bb1..002eca97b 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -148,6 +148,7 @@ $LANG['it'] = array( 'SSL Domains' => 'Domini SSL', 'Web Aliases' => 'Alias Web', 'per domain' => 'per dominio', + 'DNS Domains' => 'Zone DNS', 'DNS domains' => 'Zone DNS', 'DNS records' => 'Record DNS', 'Name Servers' => 'Name Servers', From 4950088eec1e27ddd94ed85972458b586e83c1c9 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 22 Jul 2014 23:44:02 +0300 Subject: [PATCH 46/84] fixed typo --- bin/v-add-user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-add-user b/bin/v-add-user index 9fb122319..99de6ea7d 100755 --- a/bin/v-add-user +++ b/bin/v-add-user @@ -28,7 +28,7 @@ EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9" is_user_free() { check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" ) if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then - echo "Error: user $user exist" + echo "Error: user $user exists" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi From e06c6d18313c1215a7686e5b4440a6b0737b793e Mon Sep 17 00:00:00 2001 From: nhoway Date: Wed, 23 Jul 2014 19:46:09 +0200 Subject: [PATCH 47/84] Create fr.php French translation of VESTA CP. Not tested yet. Encoding problems could occur. --- web/inc/i18n/fr.php | 441 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 web/inc/i18n/fr.php diff --git a/web/inc/i18n/fr.php b/web/inc/i18n/fr.php new file mode 100644 index 000000000..45f997cc0 --- /dev/null +++ b/web/inc/i18n/fr.php @@ -0,0 +1,441 @@ + 'Paquets', + 'IP' => 'IP', + 'Graphs' => 'Graphs', + 'Statistics' => 'Statistiques', + 'Log' => 'Log', + 'Services' => 'Services', + 'Updates' => 'Mises-à-jour', + 'Log in' => 'Connexion', + 'Log out' => 'Déconnexion', + + 'USER' => 'USER', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'MAIL', + 'DB' => 'DB', + 'CRON' => 'CRON', + 'BACKUP' => 'BACKUP', + + 'Add User' => 'Ajouter un Utilisateur', + 'Add Domain' => 'Ajouter un Domaine', + 'Add Web Domain' => 'Ajouter un Domaine Web', + 'Add DNS Domain' => 'Ajouter un Domaine DNS', + 'Add DNS Record' => 'Ajouter un Enregistrement DNS', + 'Add Mail Domain' => 'Ajouter un Domaine Mail', + 'Add Mail Account' => 'Ajouter un Compte Mail', + 'Add Database' => 'Ajouter une Base de Données', + 'Add Cron Job' => 'Ajouter une Tâche Cron', + 'Create Backup' => 'Créer un Backup', + 'Configure' => 'Configurer', + 'Restore All' => 'Restaurer Tout', + 'Add Package' => 'Ajouter un Paquet', + 'Add IP' => 'Ajouter une IP', + 'Search' => 'Rechercher', + 'Overall Statistics' => 'Statistiques Générales', + 'Daily' => 'Quotidien', + 'Weekly' => 'Hebdomadaire', + 'Monthly' => 'Mensuel', + 'Yearly' => 'Annuel', + 'Add' => 'Ajouter', + 'Back' => 'Retour', + 'Save' => 'Sauvegarder', + 'Submit' => 'Envoyer', + + 'toggle all' => 'selectionner tout', + 'apply to selected' => 'appliquer à la sélection', + 'rebuild' => 'recréer', + 'rebuild web' => 'recréer web', + 'rebuild dns' => 'recréer dns', + 'rebuild mail' => 'recréer mail', + 'rebuild db' => 'recréer db', + 'rebuild cron' => 'recréer cron', + 'update counters' => 'mettre-à-jour les totaux', + 'suspend' => 'suspendre', + 'unsuspend' => 'réactiver', + 'delete' => 'supprimer', + 'show per user' => 'voir par utilisateur', + 'login as' => 'connexion en tant que', + 'logout' => 'déconnexion', + 'edit' => 'éditer', + 'open webstats' => 'ouvrir les statistiques web', + 'view logs' => 'voir les logs', + 'list records' => '%s enregistrements listés', + 'add record' => 'ajouter un enregistrement', + 'list accounts' => '%s comptes listés', + 'add account' => 'ajouter un compte', + 'open webmail' => 'ouvrir le webmail', + 'open %s' => 'ouvrir %s', + 'download' => 'télécharger', + 'restore' => 'restaurer', + 'configure restore settings' => 'configurer les paramètres de restauration', + 'stop' => 'stop', + 'start' => 'démarrer', + 'restart' => 'redémarrer', + 'update' => 'mettre-à-jour', + 'generate' => 'générer', + 'Generate CSR' => 'Générer un CSR', + 'reread IP' => 'actualiser l\'IP', + 'enable autoupdate' => 'activer la mise-à-jour automatique', + 'disable autoupdate' => 'desactiver la mise-à-jour automatique', + + 'Adding User' => 'Ajout d\'un Utilisateur', + 'Editing User' => 'Edition d\'un Utilisateur', + 'Adding Domain' => 'Ajout d\'un Domaine', + 'Editing Domain' => 'Edition d\'un Domaine', + 'Adding DNS Domain' => 'Ajout d\'un Domaine DNS', + 'Editing DNS Domain' => 'Edition d\'un Domaine DNS', + 'Adding DNS Record' => 'Ajout d\'un Record DNS', + 'Editing DNS Record' => 'Edition d\'un Record DNS', + 'Adding Mail Domain' => 'Ajout d\'un Domaine Mail', + 'Editing Mail Domain' => 'Edition d\'un Domaine Mail', + 'Adding Mail Account' => 'Ajout d\'un Compte Mail', + 'Editing Mail Account' => 'Edition d\'un Compte Mail', + 'Adding database' => 'Ajout d\'une base de données', + 'Editing Cron Job' => 'Edition d\'une tâche Cron', + 'Adding Cron Job' => 'Ajout d\'une tâche Cron', + 'Editing Database' => 'Edition d\'une base de données', + 'Adding Package' => 'Ajout d\'un Paquet', + 'Editing Package' => 'Edition d\'un Paquet', + 'Adding IP address' => 'Ajout d\'une adresse IP', + 'Editing IP Address' => 'Edition d\'une adresse IP', + 'Editing Backup Exclusions' => 'Edition des exclusions de Backup', + 'Generating CSR' => 'Génération d\'un jeton CSR', + 'Listing' => 'Listage', + 'Search Results' => 'Résultats de Recherche', + + 'active' => 'actif', + 'spnd' => 'suspendu', + 'suspended' => 'suspendu', + 'running' => 'lancé', + 'stopped' => 'arrêté', + 'outdated' => 'périmé', + 'updated' => 'mis-à-jour', + + 'yes' => 'oui', + 'no' => 'non', + 'none' => 'aucun', + 'pb' => 'po', + 'tb' => 'to', + 'gb' => 'go', + 'mb' => 'mo', + 'minute' => 'minute', + 'hour' => 'heure', + 'day' => 'jour', + 'days' => 'jours', + 'hours' => 'heures', + 'minutes' => 'minutes', + 'month' => 'mois', + 'package' => 'paquet', + 'Bandwidth' => 'Bande Passante', + 'Disk' => 'Disque', + 'Web' => 'Web', + 'Mail' => 'Mail', + 'Databases' => 'Bases de Données', + 'User Directories' => 'Répertoires Utilisateurs', + 'Template' => 'Template', + 'Web Template' => 'Template Apache', + 'Proxy Template' => 'Template Nginx', + 'DNS Template' => 'Template DNS', + 'Web Domains' => 'Domaines Web', + 'SSL Domains' => 'Domaines SSL', + 'Web Aliases' => 'Alias Web', + 'per domain' => 'par domaine', + 'DNS domains' => 'Domaines DNS', + 'DNS domains' => 'Domaines DNS', + 'DNS records' => 'Enregistrements DNS' , + 'Name Servers' => 'Nom des Serveurs', + 'Mail Domains' => 'Domaines Mail', + 'Mail Accounts' => 'Comptes Mail', + 'Cron Jobs' => 'Tâches Cron', + 'SSH Access' => 'Accès SSH', + 'IP Addresses' => 'Adresses IP', + 'Backups' => 'Backups', + 'Backup System' => 'Système de Backup', + 'backup exclusions' => 'exclusions du backup', + 'template' => 'template', + 'SSL Support' => 'Support SSL', + 'SSL Home Directory' => 'Racine SSL', + 'Proxy Support' => 'Support Nginx', + 'Proxy Extensions' => 'Extensions Nginx', + 'Web Statistics' => 'Statistiques Web', + 'Additional FTP Account' => 'FTP Additionnel', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Expiration', + 'Records' => 'Enregistrements', + 'Catchall email' => 'Email de Récupération', + 'AntiVirus Support' => 'Support de l\'AntiVirus', + 'AntiSpam Support' => 'Support de l\'AntiSpam', + 'DKIM Support' => 'Support DKIM', + 'Accounts' => 'Comptes', + 'Quota' => 'Quota', + 'Autoreply' => 'Réponse Automatique', + 'Forward to' => 'Transférer à', + 'Do not store forwarded mail' => 'Ne pas conserver le mail transféré', + 'database' => 'base de données', + 'User' => 'Utilisateur', + 'Host' => 'Host', + 'Charset' => 'Charset', + 'Min' => 'Mn', + 'Hour' => 'Heure', + 'Day' => 'Jour', + 'Month' => 'Mois', + 'Day of week' => 'Jour de la semaine', + 'local' => 'local', + 'Run Time' => 'Temps d\'Exécution', + 'Backup Size' => 'Taille de la sauvegarde', + 'SYS' => 'SYS', + 'Domains' => 'Domaines', + 'Status' => 'Statuts', + 'shared' => 'partagé', + 'dedicated' => 'dédié', + 'Owner' => 'Propriétaire', + 'Users' => 'Utilisateurs', + 'Load Average' => 'Charge Moyenne', + 'Memory Usage' => 'Utilisation de la Mémoire', + 'HTTPD Usage' => 'Utilisation HTTPD', + 'NGINX Usage' => 'Utilisation NGINX', + 'MySQL Usage on localhost' => 'Utilisation de MySQL sur localhost', + 'PostgreSQL Usage on localhost' => 'Utilisation de PostgreSQL sur localhost', + 'Bandwidth Usage eth0' => 'Utilisation de la Bande Passante sur eth0', + 'FTP Usage' => 'Utilisation du FTP', + 'SSH Usage' => 'Utilisation SSH', + 'reverse proxy' => 'reverse proxy', + 'web server' => 'serveur web', + 'dns server' => 'serveur dns', + 'mail server' => 'serveur mail', + 'pop/imap server' => 'serveur pop/imap', + 'email antivirus' => 'email antivirus', + 'email antispam' => 'email antispam', + 'database server' => 'serveur de base de données', + 'ftp server' => 'serveur ftp', + 'job scheduler' => 'programmation de tâches', + 'CPU' => 'CPU', + 'Memory' => 'Mémoire', + 'Uptime' => 'Temps de Fonctionnement', + 'core package' => 'paquet de base', + 'php interpreter' => 'interpréteur php', + 'internal web server' => 'serveur web interne', + 'Version' => 'Version', + 'Release' => 'Release', + 'Architecture' => 'Architecture', + 'Object' => 'Objet', + 'Owner' => 'Propriétaire', + 'Username' => 'Nom d\'Utilisateur', + 'Password' => 'Mot de Passe', + 'Email' => 'Email', + 'Package' => 'Paquet', + 'Language' => 'Langue', + 'First Name' => 'Prénom', + 'Last Name' => 'Nom', + 'Send login credentials to email address' => 'Envoyer les identifiants à l\'adresse email', + 'Default Template' => 'Template par défaut', + 'Default Name Servers' => 'Nom de Serveurs par Défaut', + 'Domain' => 'Domaine', + 'DNS Support' => 'Support DNS', + 'Mail Support' => 'Support Email', + 'Advanced options' => 'Options avancées', + 'Aliases' => 'Alias', + 'SSL Certificate' => 'Certificat SSL', + 'SSL Key' => 'Clé SSL', + 'SSL Certificate Authority / Intermediate' => 'Autorité de certification SSL / Intermédiaire', + 'SSL CSR' => 'Jeton CSR SSL', + 'optional' => 'optionnel', + 'internal' => 'interne', + 'Statistics Authorization' => 'Droits d\'Accès aux Statistiques', + 'Statistics Auth' => 'Accès aux Statistiques', + 'Account' => 'Compte', + 'Prefix will be automaticaly added to username' => 'Le préfixe %s sera automatiquement ajouté au nom d\'utilisateur', + 'Send FTP credentials to email' => 'Envoyer les identifiants FTP à l\'adresse email', + 'Expiration Date' => 'Date d\'Expiration', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'Nom des serveurs', + 'Record' => 'Enregistrement', + 'IP or Value' => 'IP ou Valeur', + 'Priority' => 'Priorité', + 'Record Number' => 'Nombre d\'Enregistrements', + 'in megabytes' => 'en mégaoctets', + 'Message' => 'Message', + 'use local-part' => 'utilisation locale', + 'one or more email addresses' => 'une ou plusieurs adresses email', + 'Prefix will be automaticaly added to database name and database user' => 'Le préfixe %s sera automatiquement ajouté au nom de la base de données et de son utilisateur', + 'Database' => 'Base de Données', + 'Type' => 'Type', + 'Minute' => 'Minute', + 'Command' => 'Commande', + 'Package Name' => 'Nom du Paquet', + 'Netmask' => 'Masque Réseau', + 'Interface' => 'Interface', + 'Shared' => 'Partagé', + 'Assigned user' => 'Utilisateur associé', + 'Assigned domain' => 'Domaine associé', + 'NAT IP association' => 'Association NAT IP', + 'shell' => 'shell', + 'web domains' => 'domaines web', + 'web aliases' => 'alias web', + 'dns records' => 'enregistrements dns', + 'mail domains' => 'domaines email', + 'mail accounts' => 'comptes email', + 'accounts' => 'comptes', + 'databases' => 'bases de données', + 'cron jobs' => 'tâches cron', + 'backups' => 'sauvegardes', + 'quota' => 'quota', + 'day of week' => 'jour de la semaine', + 'cmd' => 'cmd', + 'users' => 'utilisateurs', + 'domains' => 'domaines', + 'aliases' => 'alias', + 'records' => 'enregistrements', + 'jobs' => 'tâches', + 'username' => 'nom d\'utilisateur', + 'password' => 'mot de passe', + 'type' => 'type', + 'charset' => 'charset', + 'domain' => 'domaine', + 'ip' => 'ip', + 'ip address' => 'adresse IP', + 'IP address' => 'Adresse IP', + 'netmask' => 'masque réseau', + 'interface' => 'interface', + 'assigned user' => 'utilisateur associé', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'utilisateur', + 'email' => 'email', + 'first name' => 'prénom', + 'last name' => 'nom', + 'account' => 'compte', + 'ssl certificate' => 'certificat ssl', + 'ssl key' => 'clé ssl', + 'stats user password' => 'Mot de passe du compte statistiques', + 'stats username' => 'utilisateur statistiques', + 'stats password' => 'mot de passe statistiques', + 'ftp user password' => 'mot de passe ftp', + 'ftp user' => 'utilisateur ftp', + 'Last 70 lines of %s.%s.log' => 'Dernières 70 lignes du fichier %s.%s.log', + 'Download AccessLog' => 'Télécharger le fichier AccessLog', + 'Download ErrorLog' => 'Télécharger le fichier ErrorLog', + 'Country' => 'Pays', + '2 letter code' => 'Code sur 2 lettres', + 'State / Province' => 'Pays / Province', + 'City / Locality' => 'Ville', + 'Organization' => 'Organisation', + + '1 account' => '1 compte', + '%s accounts' => '%s comptes', + '1 domain' => '1 domaine', + '%s domains' => '%s domaines', + '1 record' => '1 enregistrement', + '%s records' => '%s enregistrements', + '1 mail account' => '1 compte email', + '%s mail accounts' => '%s comptes email', + '1 database' => '1 base de données', + '%s databases' => '%s base de données', + '1 cron job' => '1 tâche cron', + '%s cron jobs' => '%s tâches cron', + '1 archive' => '1 archive', + '%s archives' => '%s archives', + '1 package' => '1 paquet', + '%s packages' => '%s paquets', + '1 IP address' => '1 adresse IP', + '%s IP addresses' => '%s adresses IP', + '1 month' => '1 mois', + '%s months' => '%s mois', + '1 log record' => '1 enregistrement', + '%s log records' => '%s enregistrements', + '1 object' => '1 objet', + '%s objects' => '%s objets', + 'no exclusions' => 'pas d\'exclusions', + + 'USER_CREATED_OK' => 'Utilisateur %s créé avec succès.', + 'WEB_DOMAIN_CREATED_OK' => 'Domaine %s créé avec succès.', + 'DNS_DOMAIN_CREATED_OK' => 'Domaine DNS %s créé avec succès.', + 'DNS_RECORD_CREATED_OK' => 'L\'enregistrement %s.%s a été créé avec succès.', + 'MAIL_DOMAIN_CREATED_OK' => 'Le domaine email %s a été créé avec succès.', + 'MAIL_ACCOUNT_CREATED_OK' => 'Le compte email %s@%s a été créé avec succès.', + 'DATABASE_CREATED_OK' => 'La base de données %s a été créée avec succès.', + 'CRON_CREATED_OK' => 'La tâche Cron a été créée avec succès.', + 'IP_CREATED_OK' => 'L\'adresse IP %s a été créée avec succès.', + 'PACKAGE_CREATED_OK' => 'Le paquet %s a été créé avec succès.', + 'SSL_GENERATED_OK' => 'Le certificat a été généré avec succès.', + 'Autoupdate has been successfully enabled' => 'Les mises-à-jour automatiques ont été activées avec succès.', + 'Autoupdate has been successfully disabled' => 'Les mises-à-jour automatiques ont été desactivées avec succès.', + 'Changes has been saved.' => 'Les changements ont été sauvegardés.', + 'Confirmation' => 'Confirmation', + 'DELETE_USER_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur %s ?', + 'SUSPEND_USER_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre l\'utilisateur %s ?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver l\'utilisateur %s ?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer le domaine %s ?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre le domaine %s ?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver le domaine %s ?', + 'DELETE_RECORD_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer l\'enregistrement %s ?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre l\'enregistrement %s ?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver l\'enregistrement %s ?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer %s ?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre %s ?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver %s ?', + 'DELETE_DATABASE_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer la base de données %s ?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre la base de données %s ?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver la base de données %s ?', + 'DELETE_CRON_CONFIRMATION' => 'Êtes-vous sûr de vouloir suprimer la tâche cron ?', + 'SUSPEND_CRON_CONFIRMATION' => 'Êtes-vous sûr de vouloir suspendre la tâche cron ?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Êtes-vous sûr de vouloir réactiver la tâche cron ?', + 'DELETE_BACKUP_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer la sauvergarde %s ?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer l\'exclusion %s ?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer le paquet %s ?', + 'DELETE_IP_CONFIRMATION' => 'Êtes-vous sûr de vouloir supprimer l\'adresse IP %s ?', + 'Welcome' => 'Bienvenue', + 'LOGGED_IN_AS' => 'Connecté en tant que %s', + 'Error' => 'Erreur', + 'Invalid username or password' => 'Nom d\'utilisateur ou mot de passe invalide.', + 'Invalid username or code' => 'Nom d\'utilisateur ou code de confirmation invalide.', + 'Passwords not match' => 'Les mots de passe ne correspondent pas.', + 'Please enter valid email address.' => 'Veuillez entrer une adresse email valide.', + 'Field "%s" can not be blank.' => 'Le champ "%s" ne peut être vide.', + 'Password is too short.' => 'Le mot de passe est trop court (6 caractères minimum)', + 'Error code:' => 'Code erreur : %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" échouée', + 'IP address is in use' => 'L\'adresse IP est en cours d\'utilisation', + 'BACKUP_SCHEDULED' => 'La tâche a bien été ajoutée à la liste. Vous recevrez un mail de confirmation lorsque la sauvegarde sera prête pour le téléchargement.', + 'BACKUP_EXISTS' => 'La création d\'une sauvegarde est déjà en cours. Veuillez attendre que celle-ci soit terminée.', + 'RESTORE_SCHEDULED' => 'La tâche a bien été ajoutée à la liste. Vous recevrez un mail de confirmation lorsque sera terminée.', + 'RESTORE_EXISTS' => 'La restauration d\'une sauvegarde est déjà en cours. Veuillez attendre que celle-ci soit terminée avant d\en lancer une nouvelle.', + + 'WEB_EXCLUSIONS' => "Entrez les noms de domaines, un par ligne. Pour exclure tous les domaines utilisez *. Pour exclure des répertoires spécifiques utilisez le format suivant : domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Entrez les noms de domaines, un par ligne. Pour exclure tous les domaines utilisez *.", + 'MAIL_EXCLUSIONS' => "Entrez les domaines, un par ligne. Pour exclure tous les domaines utilisez *. Pour exclure des comptes spécifiques utilisez le format suivant : domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Entrez le nom complet des bases de données, une par ligne. Pour exclure toutes les bases de données utilisez *.", + 'CRON_EXCLUSIONS' => "Pour explure toutes les tâches utilisez *.", + 'USER_EXCLUSIONS' => "Entrez les noms de répertoires, un par ligne. Pour exclure tous les répertoires utilisez *.", + + 'Welcome to Vesta Control Panel' => 'Bienvenue sur l\interface d\'administration Vesta CP', + 'MAIL_FROM' => 'Vesta Control Panel ', + 'GREETINGS_GORDON_FREEMAN' => "Bonjour, %s %s,\n", + 'GREETINGS' => "Bonjour,\n", + 'ACCOUNT_READY' => "Votre compte a été créé avec succès et est prêt à l\'emploi.\n\nhttps://%s/login/\nUtilisateur : %s\nMot de Passe : %s\n\n--\nVesta Control Panel\n", + + 'FTP login credentials' => 'Identifiants de connexion FTP', + 'FTP_ACCOUNT_READY' => "Le compte FTP a été créé avec succès et est prêt à l\'emploi.\n\nHôte : %s\nUtilisateur : %s_%s\nMot de Passe : %s\n\n--\nVesta Control Panel\n", + + 'Database Credentials' => 'Identifiants de connexion à la Base de Données', + 'DATABASE_READY' => "La base de données a été créée avec succès et est prête à l\'emploi.\n\nBase de Données : %s\nUtilisateur : %s\nMot de Passe: %s\n%s\n\n--\nVesta Control Panel\n", + + 'forgot password' => 'mot de passe oublié', + 'Confirm' => 'Confirmer', + 'New Password' => 'Nouveau mot de passe', + 'Confirm Password' => 'Confirmer le mot de passe', + 'Reset' => 'Réinitialiser', + 'Reset Code' => 'Code de Réinitialisation', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'Un Code de Réinitialisation de votre mot de passe a été envoyé à votre adresse email
', + 'MAIL_RESET_SUBJECT' => 'Réinitialisation du mot de passe de %s', + 'PASSWORD_RESET_REQUEST' => "Pour réinitialiser votre mot de passe, veuillez suivre le lien suivant :\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nSinon, vous pouvez suivre https://%s/reset/?action=code&user=%s et entrer le code de réinitialisation suivant :\n%s\n\nSi vous n'avez pas demandé la réinitialisation de votre mot de passe, veuillez ignorer ce message. Nous vous prions de nous excuser pour la gène occasionnée.\n\n--\nVesta Control Panel\n", +); From 2828dfc8709904fa91a8d9454f68a10f0fb1e399 Mon Sep 17 00:00:00 2001 From: Estratos Consulting Date: Thu, 24 Jul 2014 05:46:08 -0600 Subject: [PATCH 48/84] Update index.php Comments about error coming from setting PHP Directive Display Errors to ON Initializing arg1, arg2, ...arg9 ='' may be useful to avoid this problem when calling the API from a script Error logic may break when you get this notifies on the response --- web/api/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/api/index.php b/web/api/index.php index 4ea052279..458342838 100644 --- a/web/api/index.php +++ b/web/api/index.php @@ -26,7 +26,10 @@ if (isset($_POST['user']) || isset($_POST['hash'])) { echo 'Error: only admin is allowed to use API'; exit; } - + // Not Declaring arguments may cause Notifies on the response on an API Call when the Directive Dysplay errors is enabled + // you may initialize argument arg1, arg2,... arg9 to = '' here + // Or post the unused args to ='' + // Prepare arguments if (isset($_POST['cmd'])) $cmd = escapeshellarg($_POST['cmd']); if (isset($_POST['arg1'])) $arg1 = escapeshellarg($_POST['arg1']); From 6c7a3f97f41ec1ba5bb7ffb7cce807ded78abc32 Mon Sep 17 00:00:00 2001 From: nhoway Date: Fri, 25 Jul 2014 11:46:36 +0200 Subject: [PATCH 49/84] Update fr.php --- web/inc/i18n/fr.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/web/inc/i18n/fr.php b/web/inc/i18n/fr.php index 45f997cc0..35a5e5923 100644 --- a/web/inc/i18n/fr.php +++ b/web/inc/i18n/fr.php @@ -25,13 +25,13 @@ $LANG['fr'] = array( 'Add User' => 'Ajouter un Utilisateur', 'Add Domain' => 'Ajouter un Domaine', - 'Add Web Domain' => 'Ajouter un Domaine Web', - 'Add DNS Domain' => 'Ajouter un Domaine DNS', + 'Add Web Domain' => 'Ajouter un Domaine', + 'Add DNS Domain' => 'Ajouter un DNS', 'Add DNS Record' => 'Ajouter un Enregistrement DNS', - 'Add Mail Domain' => 'Ajouter un Domaine Mail', - 'Add Mail Account' => 'Ajouter un Compte Mail', - 'Add Database' => 'Ajouter une Base de Données', - 'Add Cron Job' => 'Ajouter une Tâche Cron', + 'Add Mail Domain' => 'Ajouter un Domaine', + 'Add Mail Account' => 'Ajouter un Compte', + 'Add Database' => 'Ajouter une BDD', + 'Add Cron Job' => 'Ajouter une Tâche', 'Create Backup' => 'Créer un Backup', 'Configure' => 'Configurer', 'Restore All' => 'Restaurer Tout', @@ -45,7 +45,7 @@ $LANG['fr'] = array( 'Yearly' => 'Annuel', 'Add' => 'Ajouter', 'Back' => 'Retour', - 'Save' => 'Sauvegarder', + 'Save' => 'Sauvegarde', 'Submit' => 'Envoyer', 'toggle all' => 'selectionner tout', @@ -91,8 +91,8 @@ $LANG['fr'] = array( 'Editing Domain' => 'Edition d\'un Domaine', 'Adding DNS Domain' => 'Ajout d\'un Domaine DNS', 'Editing DNS Domain' => 'Edition d\'un Domaine DNS', - 'Adding DNS Record' => 'Ajout d\'un Record DNS', - 'Editing DNS Record' => 'Edition d\'un Record DNS', + 'Adding DNS Record' => 'Ajout d\'un Enregistrement DNS', + 'Editing DNS Record' => 'Edition d\'un Enregistrement DNS', 'Adding Mail Domain' => 'Ajout d\'un Domaine Mail', 'Editing Mail Domain' => 'Edition d\'un Domaine Mail', 'Adding Mail Account' => 'Ajout d\'un Compte Mail', @@ -112,7 +112,7 @@ $LANG['fr'] = array( 'active' => 'actif', 'spnd' => 'suspendu', - 'suspended' => 'suspendu', + 'suspended' => 'suspendus', 'running' => 'lancé', 'stopped' => 'arrêté', 'outdated' => 'périmé', @@ -156,9 +156,9 @@ $LANG['fr'] = array( 'Cron Jobs' => 'Tâches Cron', 'SSH Access' => 'Accès SSH', 'IP Addresses' => 'Adresses IP', - 'Backups' => 'Backups', - 'Backup System' => 'Système de Backup', - 'backup exclusions' => 'exclusions du backup', + 'Backups' => 'Sauvegardes', + 'Backup System' => 'Système de Sauvegarde', + 'backup exclusions' => 'exclusions de la sauvegarde', 'template' => 'template', 'SSL Support' => 'Support SSL', 'SSL Home Directory' => 'Racine SSL', @@ -181,7 +181,7 @@ $LANG['fr'] = array( 'Do not store forwarded mail' => 'Ne pas conserver le mail transféré', 'database' => 'base de données', 'User' => 'Utilisateur', - 'Host' => 'Host', + 'Host' => 'Serveur', 'Charset' => 'Charset', 'Min' => 'Mn', 'Hour' => 'Heure', @@ -257,7 +257,7 @@ $LANG['fr'] = array( 'Expiration Date' => 'Date d\'Expiration', 'YYYY-MM-DD' => 'YYYY-MM-DD', 'Name servers' => 'Nom des serveurs', - 'Record' => 'Enregistrement', + 'Record' => 'Valeur de l\'Enregistrement', 'IP or Value' => 'IP ou Valeur', 'Priority' => 'Priorité', 'Record Number' => 'Nombre d\'Enregistrements', @@ -284,13 +284,15 @@ $LANG['fr'] = array( 'mail domains' => 'domaines email', 'mail accounts' => 'comptes email', 'accounts' => 'comptes', - 'databases' => 'bases de données', + 'databases' => 'bases données', 'cron jobs' => 'tâches cron', 'backups' => 'sauvegardes', 'quota' => 'quota', 'day of week' => 'jour de la semaine', 'cmd' => 'cmd', 'users' => 'utilisateurs', + 'disk' => 'disque', + 'traffic' => 'traffic', 'domains' => 'domaines', 'aliases' => 'alias', 'records' => 'enregistrements', From 387f673560d81400db85337106f3d50702089603 Mon Sep 17 00:00:00 2001 From: estratos Date: Fri, 25 Jul 2014 20:35:50 -0600 Subject: [PATCH 50/84] Changed cmd Query on Api index.php To avoid "Notice : undefined variables " changed the way the cmd query is built by validating each argument Not empty into the cmd command string --- web/api/index.php | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/web/api/index.php b/web/api/index.php index 458342838..cbaec6c34 100644 --- a/web/api/index.php +++ b/web/api/index.php @@ -26,9 +26,7 @@ if (isset($_POST['user']) || isset($_POST['hash'])) { echo 'Error: only admin is allowed to use API'; exit; } - // Not Declaring arguments may cause Notifies on the response on an API Call when the Directive Dysplay errors is enabled - // you may initialize argument arg1, arg2,... arg9 to = '' here - // Or post the unused args to ='' + // Prepare arguments if (isset($_POST['cmd'])) $cmd = escapeshellarg($_POST['cmd']); @@ -42,8 +40,27 @@ if (isset($_POST['user']) || isset($_POST['hash'])) { if (isset($_POST['arg8'])) $arg8 = escapeshellarg($_POST['arg8']); if (isset($_POST['arg9'])) $arg9 = escapeshellarg($_POST['arg9']); - // Run query - exec (VESTA_CMD.$cmd." ".$arg1." ".$arg2." ".$arg3." ".$arg4." ".$arg5." ".$arg6." ".$arg7." ".$arg8." ".$arg9, $output, $return_var); + // Build query + $cmdquery = VESTA_CMD.$cmd." ".$arg1." ".$arg2." "; + if(!empty($arg3)){ + $cmdquery = $cmdquery.$arg3." "; } + if(!empty($arg4)){ + $cmdquery = $cmdquery.$arg4." "; } + + if(!empty($arg5)){ + $cmdquery = $cmdquery.$arg5." "; } + if(!empty($arg6)){ + $cmdquery = $cmdquery.$arg6." "; } + if(!empty($arg7)){ + $cmdquery = $cmdquery.$arg7." "; } + if(!empty($arg8)){ + $cmdquery = $cmdquery.$arg8." "; } + if(!empty($arg9)){ + $cmdquery = $cmdquery.$arg9; } + + // Run query + exec ($cmdquery, $output, $return_var); + if ((!empty($_POST['returncode'])) && ($_POST['returncode'] == 'yes')) { echo $return_var; } else { From c9bc37d8b827c8344e2143e8b3ee454e4901f24d Mon Sep 17 00:00:00 2001 From: estratos Date: Fri, 25 Jul 2014 20:45:43 -0600 Subject: [PATCH 51/84] Changed cmd Query on Api index.php To avoid "Notice : undefined variables " changed the way the cmd query is built by validating each argument Not empty into the cmd command string (update) --- web/api/index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/api/index.php b/web/api/index.php index cbaec6c34..80354da07 100644 --- a/web/api/index.php +++ b/web/api/index.php @@ -41,12 +41,16 @@ if (isset($_POST['user']) || isset($_POST['hash'])) { if (isset($_POST['arg9'])) $arg9 = escapeshellarg($_POST['arg9']); // Build query - $cmdquery = VESTA_CMD.$cmd." ".$arg1." ".$arg2." "; - if(!empty($arg3)){ + $cmdquery = VESTA_CMD.$cmd." "; + + if(!empty($arg1)){ + $cmdquery = $cmdquery.$arg1." "; } + if(!empty($arg2)){ + $cmdquery = $cmdquery.$arg2." "; } + if(!empty($arg3)){ $cmdquery = $cmdquery.$arg3." "; } if(!empty($arg4)){ $cmdquery = $cmdquery.$arg4." "; } - if(!empty($arg5)){ $cmdquery = $cmdquery.$arg5." "; } if(!empty($arg6)){ From 065e66c70d403d78ef9a1a8ead64d95f14960c8f Mon Sep 17 00:00:00 2001 From: estratos Date: Sat, 26 Jul 2014 03:48:44 -0600 Subject: [PATCH 52/84] Rusian languaje on Search page Comented Set Locale ru_RU.utf8 , now is on the correct languaje setting --- web/search/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/search/index.php b/web/search/index.php index bdb9a7166..fc5ffd069 100644 --- a/web/search/index.php +++ b/web/search/index.php @@ -25,7 +25,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); top_panel($user,$TAB); $lang = 'ru_RU.utf8'; -setlocale(LC_ALL, $lang); +//setlocale(LC_ALL, $lang); // Data if ($_SESSION['user'] == 'admin') { From 6cd65c593d614fbe82c449e392604d5f8d61bad6 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 29 Jul 2014 20:46:00 +0300 Subject: [PATCH 53/84] Upadted formating --- install/debian/exim4.conf.template | 123 ++++++++++++++++++----------- install/rhel/exim-smarthost.conf | 114 ++++++++++++++++---------- install/rhel/exim.conf | 122 +++++++++++++++++----------- install/ubuntu/exim4.conf.template | 123 ++++++++++++++++++----------- install/vst-install-debian.sh | 12 +-- install/vst-install-rhel.sh | 12 +-- install/vst-install-ubuntu.sh | 12 +-- 7 files changed, 324 insertions(+), 194 deletions(-) diff --git a/install/debian/exim4.conf.template b/install/debian/exim4.conf.template index 30c13d4af..742f0409e 100644 --- a/install/debian/exim4.conf.template +++ b/install/debian/exim4.conf.template @@ -1,14 +1,18 @@ -########################################################################## +###################################################################### +# # +# Exim configuration file for Vesta Control Panel # +# # +###################################################################### + #SPAMASSASSIN = yes -SPAM_SCORE = 50 -CLAMD = yes -########################################################################## +#SPAM_SCORE = 50 +#CLAMD = yes domainlist local_domains = dsearch;/etc/exim4/domains/ domainlist relay_to_domains = dsearch;/etc/exim4/domains/ -hostlist relay_from_hosts = 127.0.0.1 -hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf -hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf +hostlist relay_from_hosts = 127.0.0.1 +hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf +hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf no_local_from_check untrusted_set_sender = * acl_smtp_connect = acl_check_spammers @@ -43,41 +47,38 @@ DKIM_FILE = /etc/exim4/domains/${lc:${domain:$h_from:}}/dkim.pem DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} -########################################################################## + +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### begin acl -########################################################################## + acl_check_spammers: - accept hosts = +whitelist + accept hosts = +whitelist + drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers + accept + acl_check_mail: - deny - condition = ${if eq{$sender_helo_name}{}} + deny condition = ${if eq{$sender_helo_name}{}} message = HELO required before MAIL -# drop -# condition = ${if isip{$sender_helo_name}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.3) + drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}} condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}} delay = 45s -# drop -# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}} -# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) - drop - condition = ${if isip{$sender_helo_name}} + + drop condition = ${if isip{$sender_helo_name}} message = Access denied - Invalid HELO name (See RFC2821 4.1.3) -# drop -# condition = ${if match{$sender_helo_name}{\N\.$\N}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) -# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]" -# condition = ${if match{$sender_helo_name}{$primary_hostname}} + drop condition = ${if eq{[$interface_address]}{$sender_helo_name}} message = $interface_address is _my_ address + accept @@ -100,8 +101,8 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - hosts = !+whitelist + deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text + hosts = !+whitelist dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} require message = relay not permitted @@ -115,27 +116,30 @@ acl_check_rcpt: .ifdef CLAMD warn set acl_m0 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antivirus}{yes}{no}} set acl_m0 = yes .endif + .ifdef SPAMASSASSIN warn set acl_m1 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antispam}{yes}{no}} set acl_m1 = yes .endif + accept acl_check_data: .ifdef CLAMD - deny message = Message contains a virus ($malware_name) and has been rejected + deny message = Message contains a virus ($malware_name) and has been rejected malware = * condition = ${if eq{$acl_m0}{yes}{yes}{no}} .endif .ifdef SPAMASSASSIN - warn - !authenticated = * + warn !authenticated = * hosts = !+relay_from_hosts condition = ${if < {$message_size}{100K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} @@ -144,23 +148,29 @@ acl_check_data: add_header = X-Spam-Bar: $spam_bar add_header = X-Spam-Report: $spam_report set acl_m2 = $spam_score_int - warn - condition = ${if !eq{$acl_m2}{} {yes}{no}} + + warn condition = ${if !eq{$acl_m2}{} {yes}{no}} condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}} add_header = X-Spam-Status: Yes message = SpamAssassin detected spam (from $sender_address to $recipients). .endif + accept acl_check_mime: - deny message = Blacklisted file extension detected - condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + deny message = Blacklisted file extension detected + condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + accept -########################################################################## + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### begin authenticators -########################################################################## + dovecot_plain: driver = dovecot public_name = PLAIN @@ -173,9 +183,14 @@ dovecot_login: server_socket = /var/run/dovecot/auth-client server_set_id = $auth1 -########################################################################## + + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### begin routers -########################################################################## + #smarthost: # driver = manualroute # domains = ! +local_domains @@ -255,9 +270,12 @@ terminate_alias: condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}} -########################################################################## + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### begin transports -########################################################################## + remote_smtp: driver = smtp #helo_data = $sender_address_domain @@ -267,7 +285,6 @@ remote_smtp: dkim_canon = relaxed dkim_strict = 0 - procmail: driver = pipe command = "/usr/bin/procmail -d $local_part" @@ -308,7 +325,7 @@ local_spam_delivery: delivery_date_add envelope_to_add return_path_add - directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.spam" + directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.Spam" quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part" quota_warn_threshold = 75% @@ -337,8 +354,24 @@ devnull: driver = appendfile file = /dev/null -########################################################################## + + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### begin retry + +# Address or Domain Error Retries +# ----------------- ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h -########################################################################## + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### begin rewrite + + + +###################################################################### diff --git a/install/rhel/exim-smarthost.conf b/install/rhel/exim-smarthost.conf index 1f649a9e7..086ca6507 100644 --- a/install/rhel/exim-smarthost.conf +++ b/install/rhel/exim-smarthost.conf @@ -1,14 +1,18 @@ -########################################################################## +###################################################################### +# # +# Exim configuration file for Vesta Control Panel # +# # +###################################################################### + #SPAMASSASSIN = yes -SPAM_SCORE = 10 +#SPAM_SCORE = 50 #CLAMD = yes -########################################################################## domainlist local_domains = dsearch;/etc/exim/domains/ domainlist relay_to_domains = dsearch;/etc/exim/domains/ -hostlist relay_from_hosts = 127.0.0.1 -hostlist whitelist = net-iplsearch;/etc/exim/white-blocks.conf -hostlist spammers = net-iplsearch;/etc/exim/spam-blocks.conf +hostlist relay_from_hosts = 127.0.0.1 +hostlist whitelist = net-iplsearch;/etc/exim/white-blocks.conf +hostlist spammers = net-iplsearch;/etc/exim/spam-blocks.conf no_local_from_check untrusted_set_sender = * acl_smtp_connect = acl_check_spammers @@ -43,41 +47,37 @@ DKIM_FILE = /etc/exim/domains/${lc:${domain:$h_from:}}/dkim.pem DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} -########################################################################## +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### begin acl -########################################################################## + acl_check_spammers: - accept hosts = +whitelist + accept hosts = +whitelist + drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers + accept + acl_check_mail: - deny - condition = ${if eq{$sender_helo_name}{}} + deny condition = ${if eq{$sender_helo_name}{}} message = HELO required before MAIL -# drop -# condition = ${if isip{$sender_helo_name}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.3) + drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}} condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}} delay = 45s -# drop -# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}} -# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) - drop - condition = ${if isip{$sender_helo_name}} + + drop condition = ${if isip{$sender_helo_name}} message = Access denied - Invalid HELO name (See RFC2821 4.1.3) -# drop -# condition = ${if match{$sender_helo_name}{\N\.$\N}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) -# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]" -# condition = ${if match{$sender_helo_name}{$primary_hostname}} + drop condition = ${if eq{[$interface_address]}{$sender_helo_name}} message = $interface_address is _my_ address + accept @@ -100,8 +100,8 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - hosts = !+whitelist + deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text + hosts = !+whitelist dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} require message = relay not permitted @@ -115,27 +115,30 @@ acl_check_rcpt: .ifdef CLAMD warn set acl_m0 = no + warn condition = ${if exists {/etc/exim/domains/$domain/antivirus}{yes}{no}} set acl_m0 = yes .endif + .ifdef SPAMASSASSIN warn set acl_m1 = no + warn condition = ${if exists {/etc/exim/domains/$domain/antispam}{yes}{no}} set acl_m1 = yes .endif + accept acl_check_data: .ifdef CLAMD - deny message = Message contains a virus ($malware_name) and has been rejected + deny message = Message contains a virus ($malware_name) and has been rejected malware = * condition = ${if eq{$acl_m0}{yes}{yes}{no}} .endif .ifdef SPAMASSASSIN - warn - !authenticated = * + warn !authenticated = * hosts = !+relay_from_hosts condition = ${if < {$message_size}{100K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} @@ -144,23 +147,29 @@ acl_check_data: add_header = X-Spam-Bar: $spam_bar add_header = X-Spam-Report: $spam_report set acl_m2 = $spam_score_int - warn - condition = ${if !eq{$acl_m2}{} {yes}{no}} + + warn condition = ${if !eq{$acl_m2}{} {yes}{no}} condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}} add_header = X-Spam-Status: Yes message = SpamAssassin detected spam (from $sender_address to $recipients). .endif + accept acl_check_mime: deny message = Blacklisted file extension detected condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + accept -########################################################################## + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### begin authenticators -########################################################################## + login: driver = plaintext public_name = LOGIN @@ -180,9 +189,13 @@ dovecot_login: server_set_id = $auth1 -########################################################################## + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### begin routers -########################################################################## + smarthost: driver = manualroute domains = ! +local_domains @@ -260,9 +273,12 @@ terminate_alias: condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/domains/$domain/aliases}{true}{false}} -########################################################################## + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### begin transports -########################################################################## + remote_smtp: driver = smtp dkim_domain = DKIM_DOMAIN @@ -316,7 +332,7 @@ local_spam_delivery: delivery_date_add envelope_to_add return_path_add - directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}}}}/mail/$domain/$local_part/.spam" + directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}}}}/mail/$domain/$local_part/.Spam" quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}}}}M quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}}}}/mail/$domain/$local_part" quota_warn_threshold = 75% @@ -345,8 +361,24 @@ devnull: driver = appendfile file = /dev/null -########################################################################## + + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### begin retry + +# Address or Domain Error Retries +# ----------------- ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h -########################################################################## + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### begin rewrite + + + +###################################################################### diff --git a/install/rhel/exim.conf b/install/rhel/exim.conf index 25d99fbd5..0f9830168 100644 --- a/install/rhel/exim.conf +++ b/install/rhel/exim.conf @@ -1,14 +1,18 @@ -########################################################################## +###################################################################### +# # +# Exim configuration file for Vesta Control Panel # +# # +###################################################################### + #SPAMASSASSIN = yes -SPAM_SCORE = 50 +#SPAM_SCORE = 50 #CLAMD = yes -########################################################################## domainlist local_domains = dsearch;/etc/exim/domains/ domainlist relay_to_domains = dsearch;/etc/exim/domains/ -hostlist relay_from_hosts = 127.0.0.1 -hostlist whitelist = net-iplsearch;/etc/exim/white-blocks.conf -hostlist spammers = net-iplsearch;/etc/exim/spam-blocks.conf +hostlist relay_from_hosts = 127.0.0.1 +hostlist whitelist = net-iplsearch;/etc/exim/white-blocks.conf +hostlist spammers = net-iplsearch;/etc/exim/spam-blocks.conf no_local_from_check untrusted_set_sender = * acl_smtp_connect = acl_check_spammers @@ -26,8 +30,8 @@ av_scanner = clamd: /var/run/clamav/clamd.sock .endif tls_advertise_hosts = * -tls_certificate = /etc/pki/tls/certs/exim.pem -tls_privatekey = /etc/pki/tls/private/exim.pem +tls_certificate = /usr/local/vesta/ssl/certificate.crt +tls_privatekey = /usr/local/vesta/ssl/certificate.key daemon_smtp_ports = 25 : 465 : 587 : 2525 tls_on_connect_ports = 465 @@ -43,41 +47,38 @@ DKIM_FILE = /etc/exim/domains/${lc:${domain:$h_from:}}/dkim.pem DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} -########################################################################## + +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### begin acl -########################################################################## + acl_check_spammers: - accept hosts = +whitelist + accept hosts = +whitelist + drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers + accept + acl_check_mail: - deny - condition = ${if eq{$sender_helo_name}{}} + deny condition = ${if eq{$sender_helo_name}{}} message = HELO required before MAIL -# drop -# condition = ${if isip{$sender_helo_name}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.3) + drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}} condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}} delay = 45s -# drop -# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}} -# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) - drop - condition = ${if isip{$sender_helo_name}} + + drop condition = ${if isip{$sender_helo_name}} message = Access denied - Invalid HELO name (See RFC2821 4.1.3) -# drop -# condition = ${if match{$sender_helo_name}{\N\.$\N}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) -# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]" -# condition = ${if match{$sender_helo_name}{$primary_hostname}} + drop condition = ${if eq{[$interface_address]}{$sender_helo_name}} message = $interface_address is _my_ address + accept @@ -100,8 +101,8 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - hosts = !+whitelist + deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text + hosts = !+whitelist dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}} require message = relay not permitted @@ -115,27 +116,30 @@ acl_check_rcpt: .ifdef CLAMD warn set acl_m0 = no + warn condition = ${if exists {/etc/exim/domains/$domain/antivirus}{yes}{no}} set acl_m0 = yes .endif + .ifdef SPAMASSASSIN warn set acl_m1 = no + warn condition = ${if exists {/etc/exim/domains/$domain/antispam}{yes}{no}} set acl_m1 = yes .endif + accept acl_check_data: .ifdef CLAMD - deny message = Message contains a virus ($malware_name) and has been rejected + deny message = Message contains a virus ($malware_name) and has been rejected malware = * condition = ${if eq{$acl_m0}{yes}{yes}{no}} .endif .ifdef SPAMASSASSIN - warn - !authenticated = * + warn !authenticated = * hosts = !+relay_from_hosts condition = ${if < {$message_size}{100K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} @@ -144,23 +148,29 @@ acl_check_data: add_header = X-Spam-Bar: $spam_bar add_header = X-Spam-Report: $spam_report set acl_m2 = $spam_score_int - warn - condition = ${if !eq{$acl_m2}{} {yes}{no}} + + warn condition = ${if !eq{$acl_m2}{} {yes}{no}} condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}} add_header = X-Spam-Status: Yes message = SpamAssassin detected spam (from $sender_address to $recipients). .endif + accept acl_check_mime: - deny message = Blacklisted file extension detected - condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + deny message = Blacklisted file extension detected + condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + accept -########################################################################## + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### begin authenticators -########################################################################## + dovecot_plain: driver = dovecot public_name = PLAIN @@ -173,9 +183,14 @@ dovecot_login: server_socket = /var/run/dovecot/auth-client server_set_id = $auth1 -########################################################################## + + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### begin routers -########################################################################## + #smarthost: # driver = manualroute # domains = ! +local_domains @@ -255,9 +270,12 @@ terminate_alias: condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/domains/$domain/aliases}{true}{false}} -########################################################################## + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### begin transports -########################################################################## + remote_smtp: driver = smtp #helo_data = $sender_address_domain @@ -267,7 +285,6 @@ remote_smtp: dkim_canon = relaxed dkim_strict = 0 - procmail: driver = pipe command = "/usr/bin/procmail -d $local_part" @@ -337,8 +354,23 @@ devnull: driver = appendfile file = /dev/null -########################################################################## + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### begin retry + +# Address or Domain Error Retries +# ----------------- ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h -########################################################################## + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### begin rewrite + + + +###################################################################### diff --git a/install/ubuntu/exim4.conf.template b/install/ubuntu/exim4.conf.template index 30c13d4af..742f0409e 100644 --- a/install/ubuntu/exim4.conf.template +++ b/install/ubuntu/exim4.conf.template @@ -1,14 +1,18 @@ -########################################################################## +###################################################################### +# # +# Exim configuration file for Vesta Control Panel # +# # +###################################################################### + #SPAMASSASSIN = yes -SPAM_SCORE = 50 -CLAMD = yes -########################################################################## +#SPAM_SCORE = 50 +#CLAMD = yes domainlist local_domains = dsearch;/etc/exim4/domains/ domainlist relay_to_domains = dsearch;/etc/exim4/domains/ -hostlist relay_from_hosts = 127.0.0.1 -hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf -hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf +hostlist relay_from_hosts = 127.0.0.1 +hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf +hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf no_local_from_check untrusted_set_sender = * acl_smtp_connect = acl_check_spammers @@ -43,41 +47,38 @@ DKIM_FILE = /etc/exim4/domains/${lc:${domain:$h_from:}}/dkim.pem DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}} -########################################################################## + +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### begin acl -########################################################################## + acl_check_spammers: - accept hosts = +whitelist + accept hosts = +whitelist + drop message = Your host in blacklist on this server. log_message = Host in blacklist hosts = +spammers + accept + acl_check_mail: - deny - condition = ${if eq{$sender_helo_name}{}} + deny condition = ${if eq{$sender_helo_name}{}} message = HELO required before MAIL -# drop -# condition = ${if isip{$sender_helo_name}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.3) + drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}} condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}} delay = 45s -# drop -# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}} -# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) - drop - condition = ${if isip{$sender_helo_name}} + + drop condition = ${if isip{$sender_helo_name}} message = Access denied - Invalid HELO name (See RFC2821 4.1.3) -# drop -# condition = ${if match{$sender_helo_name}{\N\.$\N}} -# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1) -# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]" -# condition = ${if match{$sender_helo_name}{$primary_hostname}} + drop condition = ${if eq{[$interface_address]}{$sender_helo_name}} message = $interface_address is _my_ address + accept @@ -100,8 +101,8 @@ acl_check_rcpt: accept authenticated = * control = submission/domain= - deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text - hosts = !+whitelist + deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text + hosts = !+whitelist dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}} require message = relay not permitted @@ -115,27 +116,30 @@ acl_check_rcpt: .ifdef CLAMD warn set acl_m0 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antivirus}{yes}{no}} set acl_m0 = yes .endif + .ifdef SPAMASSASSIN warn set acl_m1 = no + warn condition = ${if exists {/etc/exim4/domains/$domain/antispam}{yes}{no}} set acl_m1 = yes .endif + accept acl_check_data: .ifdef CLAMD - deny message = Message contains a virus ($malware_name) and has been rejected + deny message = Message contains a virus ($malware_name) and has been rejected malware = * condition = ${if eq{$acl_m0}{yes}{yes}{no}} .endif .ifdef SPAMASSASSIN - warn - !authenticated = * + warn !authenticated = * hosts = !+relay_from_hosts condition = ${if < {$message_size}{100K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} @@ -144,23 +148,29 @@ acl_check_data: add_header = X-Spam-Bar: $spam_bar add_header = X-Spam-Report: $spam_report set acl_m2 = $spam_score_int - warn - condition = ${if !eq{$acl_m2}{} {yes}{no}} + + warn condition = ${if !eq{$acl_m2}{} {yes}{no}} condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}} add_header = X-Spam-Status: Yes message = SpamAssassin detected spam (from $sender_address to $recipients). .endif + accept acl_check_mime: - deny message = Blacklisted file extension detected - condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + deny message = Blacklisted file extension detected + condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}} + accept -########################################################################## + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### begin authenticators -########################################################################## + dovecot_plain: driver = dovecot public_name = PLAIN @@ -173,9 +183,14 @@ dovecot_login: server_socket = /var/run/dovecot/auth-client server_set_id = $auth1 -########################################################################## + + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### begin routers -########################################################################## + #smarthost: # driver = manualroute # domains = ! +local_domains @@ -255,9 +270,12 @@ terminate_alias: condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}} -########################################################################## + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### begin transports -########################################################################## + remote_smtp: driver = smtp #helo_data = $sender_address_domain @@ -267,7 +285,6 @@ remote_smtp: dkim_canon = relaxed dkim_strict = 0 - procmail: driver = pipe command = "/usr/bin/procmail -d $local_part" @@ -308,7 +325,7 @@ local_spam_delivery: delivery_date_add envelope_to_add return_path_add - directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.spam" + directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.Spam" quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part" quota_warn_threshold = 75% @@ -337,8 +354,24 @@ devnull: driver = appendfile file = /dev/null -########################################################################## + + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### begin retry + +# Address or Domain Error Retries +# ----------------- ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h -########################################################################## + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### begin rewrite + + + +###################################################################### diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index f3a7eacd4..abe0a8cae 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -233,9 +233,6 @@ if [ -z $email ]; then if [ -z "$servername" ]; then read -p "Please enter hostname [$(hostname)]: " servername fi - if [ -z "$servername" ]; then - servername=$(hostname) - fi fi # Validate email @@ -464,6 +461,9 @@ if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then fi # Set server hostname +if [ -z "$servername" ]; then + servername=$(hostname) +fi /usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null # Templates @@ -627,9 +627,9 @@ fi # Exim wget $CHOST/$VERSION/exim4.conf.template -O /etc/exim4/exim4.conf.template -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/^SPAMASSASSIN/#SPAMASSASSIN/g" /etc/exim4/exim4.conf.template - sed -i "s/^CLAMD/#CLAMD/g" /etc/exim4/exim4.conf.template +if [ "$srv_type" != 'micro' ] && [ "$srv_type" != 'small' ]; then + sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template + sed -i "s/#CLAMD/CLAMD/g" /etc/exim4/exim4.conf.template fi wget $CHOST/$VERSION/dnsbl.conf -O /etc/exim4/dnsbl.conf wget $CHOST/$VERSION/spam-blocks.conf -O /etc/exim4/spam-blocks.conf diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 54ef51747..5ddfaf4bd 100644 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -233,9 +233,6 @@ if [ -z $email ]; then if [ -z "$servername" ]; then read -p "Please enter hostname [$(hostname)]: " servername fi - if [ -z "$servername" ]; then - servername=$(hostname) - fi fi # Validate email @@ -524,6 +521,9 @@ if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then fi # Set server hostname +if [ -z "$servername" ]; then + servername=$(hostname) +fi /usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null # Templates @@ -683,9 +683,9 @@ fi # Exim wget $CHOST/$VERSION/exim.conf -O /etc/exim/exim.conf -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/^SPAMASSASSIN/#SPAMASSASSIN/g" /etc/exim/exim.conf - sed -i "s/^CLAMD/#CLAMD/g" /etc/exim/exim.conf +if [ "$srv_type" != 'micro' ] && [ "$srv_type" != 'small' ]; then + sed -i "s/#SPAM/SPAM/g" /etc/exim/exim.conf + sed -i "s/#CLAMD/CLAMD/g" /etc/exim/exim.conf fi wget $CHOST/$VERSION/dnsbl.conf -O /etc/exim/dnsbl.conf wget $CHOST/$VERSION/spam-blocks.conf -O /etc/exim/spam-blocks.conf diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 74f4b4cf6..4d99cb207 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -231,9 +231,6 @@ if [ -z $email ]; then if [ -z "$servername" ]; then read -p "Please enter hostname [$(hostname)]: " servername fi - if [ -z "$servername" ]; then - servername=$(hostname) - fi fi # Validate email @@ -462,6 +459,9 @@ if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then fi # Set server hostname +if [ -z "$servername" ]; then + servername=$(hostname) +fi /usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null # Templates @@ -634,9 +634,9 @@ fi # Exim wget $CHOST/$VERSION/exim4.conf.template -O /etc/exim4/exim4.conf.template -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/^SPAMASSASSIN/#SPAMASSASSIN/g" /etc/exim4/exim4.conf.template - sed -i "s/^CLAMD/#CLAMD/g" /etc/exim4/exim4.conf.template +if [ "$srv_type" != 'micro' ] && [ "$srv_type" != 'small' ]; then + sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template + sed -i "s/#CLAMD/CLAMD/g" /etc/exim4/exim4.conf.template fi wget $CHOST/$VERSION/dnsbl.conf -O /etc/exim4/dnsbl.conf wget $CHOST/$VERSION/spam-blocks.conf -O /etc/exim4/spam-blocks.conf From 01262ce4b51e2b081e9e1a466d9f70a38cfcf401 Mon Sep 17 00:00:00 2001 From: Dustin Dauncey Date: Tue, 29 Jul 2014 14:03:16 -0700 Subject: [PATCH 54/84] Update v-add-cron-job Just fixed a typo in the description. --- bin/v-add-cron-job | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-add-cron-job b/bin/v-add-cron-job index b6b2dd575..75a396a09 100755 --- a/bin/v-add-cron-job +++ b/bin/v-add-cron-job @@ -55,7 +55,7 @@ str="$str CMD='$command' SUSPENDED='no' TIME='$TIME' DATE='$DATE'" # Adding to crontab echo "$str" >> $VESTA/data/users/$user/cron.conf -# Chaning permissions +# Changing permissions chmod 660 $VESTA/data/users/$user/cron.conf # Sort jobs by id number From d580ce6f998182c22c27dc19fa896d03d14a60aa Mon Sep 17 00:00:00 2001 From: Dustin Dauncey Date: Tue, 29 Jul 2014 15:04:05 -0700 Subject: [PATCH 55/84] Update en.php Updated for more consistency (i.e.: all sentences should end in a period.), and improved the flow of words in some sentences for clarity. Minor changes. --- web/inc/i18n/en.php | 72 ++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/web/inc/i18n/en.php b/web/inc/i18n/en.php index f4a8613f2..d9c56d45b 100644 --- a/web/inc/i18n/en.php +++ b/web/inc/i18n/en.php @@ -265,7 +265,7 @@ $LANG['en'] = array( 'Message' => 'Message', 'use local-part' => 'use local-part', 'one or more email addresses' => 'one or more email addresses', - 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user', + 'Prefix will be automaticaly added to database name and database user' => 'Prefix %s will be automaticaly added to database name and database user.', 'Database' => 'Database', 'Type' => 'Type', 'Minute' => 'Minute', @@ -355,50 +355,50 @@ $LANG['en'] = array( '%s objects' => '%s objects', 'no exclusions' => 'no exclusions', - 'USER_CREATED_OK' => 'User %s has been created successfully', + 'USER_CREATED_OK' => 'User %s has been created successfully.', 'WEB_DOMAIN_CREATED_OK' => 'Domain %s has been created successfully.', 'DNS_DOMAIN_CREATED_OK' => 'DNS domain %s has been created successfully.', 'DNS_RECORD_CREATED_OK' => 'Record %s.%s has been created successfully.', 'MAIL_DOMAIN_CREATED_OK' => 'Mail domain %s has been created successfully.', - 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully', - 'DATABASE_CREATED_OK' => 'Database %s has been created successfully', + 'MAIL_ACCOUNT_CREATED_OK' => 'Mail account %s@%s has been created successfully.', + 'DATABASE_CREATED_OK' => 'Database %s has been created successfully.', 'CRON_CREATED_OK' => 'Cron job has been created successfully.', 'IP_CREATED_OK' => 'IP address %s has been created successfully.', 'PACKAGE_CREATED_OK' => 'Package %s has been created successfully.', 'SSL_GENERATED_OK' => 'Certificate has been generated successfully.', - 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled', - 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled', - 'Changes has been saved.' => 'Changes has been saved.', + 'Autoupdate has been successfully enabled' => 'Autoupdate has been successfully enabled.', + 'Autoupdate has been successfully disabled' => 'Autoupdate has been successfully disabled.', + 'Changes has been saved.' => 'Changes have been saved.', 'Confirmation' => 'Confirmation', - 'DELETE_USER_CONFIRMATION' => 'Are you sure to delete user %s?', - 'SUSPEND_USER_CONFIRMATION' => 'Are you sure to suspend user %s?', - 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure to unsuspend user %s?', - 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure to delete domain %s?', - 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to suspend domain %s?', - 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure to unsuspend domain %s?', - 'DELETE_RECORD_CONFIRMATION' => 'Are you sure to delete record %s?', - 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure to suspend record %s?', - 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure to unsuspend record %s?', - 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to delete %s?', - 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to suspend %s?', - 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure to unsuspend %s?', - 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure to delete database %s?', - 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to suspend database %s?', - 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure to unsuspend database %s?', - 'DELETE_CRON_CONFIRMATION' => 'Are you sure to delete cron job?', - 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure to suspend cron job?', - 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure to unsuspend cron job?', - 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure to delete %s backup?', - 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure to delete %s exclusion?', - 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure to delete package %s?', - 'DELETE_IP_CONFIRMATION' => 'Are you sure to delere IP address %s?', + 'DELETE_USER_CONFIRMATION' => 'Are you sure you want to delete user %s?', + 'SUSPEND_USER_CONFIRMATION' => 'Are you sure you want to suspend user %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Are you sure you want to unsuspend user %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Are you sure you want to delete domain %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure you want to suspend domain %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Are you sure you want to unsuspend domain %s?', + 'DELETE_RECORD_CONFIRMATION' => 'Are you sure you want to delete record %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Are you sure you want to suspend record %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Are you sure you want to unsuspend record %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure you want to delete %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure you want to suspend %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Are you sure you want to unsuspend %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'Are you sure you want to delete database %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Are you sure you want to suspend database %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Are you sure you want to unsuspend database %s?', + 'DELETE_CRON_CONFIRMATION' => 'Are you sure you want to delete cron job?', + 'SUSPEND_CRON_CONFIRMATION' => 'Are you sure you want to suspend cron job?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Are you sure you want to unsuspend cron job?', + 'DELETE_BACKUP_CONFIRMATION' => 'Are you sure you want to delete %s backup?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Are you sure you want to delete %s exclusion?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Are you sure you want to delete package %s?', + 'DELETE_IP_CONFIRMATION' => 'Are you sure you want to delete IP address %s?', 'Welcome' => 'Welcome', 'LOGGED_IN_AS' => 'Logged in as user %s', 'Error' => 'Error', - 'Invalid username or password' => 'Invalid username or password', - 'Invalid username or code' => 'Invalid username or code', - 'Passwords not match' => 'Passwords not match', - 'Please enter valid email address.' => 'Please enter valid email address.', + 'Invalid username or password' => 'Invalid username or password.', + 'Invalid username or code' => 'Invalid username or code.', + 'Passwords not match' => 'Passwords do not match.', + 'Please enter valid email address.' => 'Please enter a valid email address.', 'Field "%s" can not be blank.' => 'Field "%s" can not be blank.', 'Password is too short.' => 'Password is too short (minimum is 6 characters)', 'Error code:' => 'Error code: %s', @@ -406,7 +406,7 @@ $LANG['en'] = array( 'IP address is in use' => 'IP address is in use', 'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', 'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.', - 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.', + 'RESTORE_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your restore has been completed.', 'RESTORE_EXISTS' => 'An existing restoration task is already running. Please wait for it to finish before launching it again.', 'WEB_EXCLUSIONS' => "Type domain name, one per line. To exclude all domains use *. To exclude specific dirs use following format: domain.com:public_html/cache:public_html/tmp", @@ -420,10 +420,10 @@ $LANG['en'] = array( 'MAIL_FROM' => 'Vesta Control Panel ', 'GREETINGS_GORDON_FREEMAN' => "Hello, %s %s,\n", 'GREETINGS' => "Hello,\n", - 'ACCOUNT_READY' => "Your account has been created and ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + 'ACCOUNT_READY' => "Your account has been created and is ready for use.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", 'FTP login credentials' => 'FTP login credentials', - 'FTP_ACCOUNT_READY' => "FTP account has been created and ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + 'FTP_ACCOUNT_READY' => "FTP account has been created and is ready for use.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", 'Database Credentials' => 'Database Credentials', 'DATABASE_READY' => "Database has been created successfully.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", From f7bd734faadf071d2417d3209a2785e9e7fc5dd0 Mon Sep 17 00:00:00 2001 From: estratos Date: Wed, 30 Jul 2014 02:52:52 -0600 Subject: [PATCH 56/84] Fix Error Page Not Available on Success #191 script was calling CLI v-add-web-domain and restarting by default so scripts calling API will loose connection during HTTP Request --- bin/v-add-domain | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/v-add-domain b/bin/v-add-domain index 32e56214c..9000e72d7 100755 --- a/bin/v-add-domain +++ b/bin/v-add-domain @@ -48,14 +48,16 @@ if [ -z "$ip" ]; then fi # Web domain +# Not restart at this point will loose conecction from API calls if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then - $BIN/v-add-web-domain $user $domain $ip + $BIN/v-add-web-domain $user $domain $ip no retun_code=$? fi # Proxy support +# Not restart at this point will loose conecction from API calls if [ ! -z "$PROXY_SYSTEM" ] && [ "$retun_code" -eq 0 ]; then - $BIN/v-add-web-domain-proxy $user $domain + $BIN/v-add-web-domain-proxy $user $domain '' '' no fi # DNS domain From f1062c344863806c2fc1d2e3da2c6d583e2df169 Mon Sep 17 00:00:00 2001 From: estratos Date: Wed, 30 Jul 2014 03:05:14 -0600 Subject: [PATCH 57/84] Spelling correction some spelling corrections --- bin/v-add-domain | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/v-add-domain b/bin/v-add-domain index 9000e72d7..1e56e2a67 100755 --- a/bin/v-add-domain +++ b/bin/v-add-domain @@ -9,7 +9,7 @@ # Variable&Function # #----------------------------------------------------------# -# Argument defenition +# Argument definition user=$1 domain=$2 ip=$3 @@ -48,31 +48,31 @@ if [ -z "$ip" ]; then fi # Web domain -# Not restart at this point will loose conecction from API calls +# Do Not restart at this point will loose conecction from API calls if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then $BIN/v-add-web-domain $user $domain $ip no - retun_code=$? + return_code=$? fi # Proxy support -# Not restart at this point will loose conecction from API calls -if [ ! -z "$PROXY_SYSTEM" ] && [ "$retun_code" -eq 0 ]; then +# Do Not restart at this point will loose conecction from API calls +if [ ! -z "$PROXY_SYSTEM" ] && [ "$return_code" -eq 0 ]; then $BIN/v-add-web-domain-proxy $user $domain '' '' no fi # DNS domain if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then - if [ "$retun_code" -eq 0 ]; then + if [ "$return_code" -eq 0 ]; then $BIN/v-add-dns-domain $user $domain $ip - retun_code=$? + return_code=$? fi fi # Mail domain if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then - if [ "$retun_code" -eq 0 ]; then + if [ "$return_code" -eq 0 ]; then $BIN/v-add-mail-domain $user $domain - retun_code=$? + return_code=$? fi fi @@ -81,4 +81,4 @@ fi # Vesta # #----------------------------------------------------------# -exit $retun_code +exit $return_code From 76a56e33249f8e87a971d0c4a535f09ff04f6f57 Mon Sep 17 00:00:00 2001 From: estratos Date: Wed, 30 Jul 2014 03:17:26 -0600 Subject: [PATCH 58/84] Spelling Spelling Correction to comments --- bin/v-add-domain | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-add-domain b/bin/v-add-domain index 1e56e2a67..66fd2664c 100755 --- a/bin/v-add-domain +++ b/bin/v-add-domain @@ -48,14 +48,14 @@ if [ -z "$ip" ]; then fi # Web domain -# Do Not restart at this point will loose conecction from API calls +# Do Not restart at this point, will loose connection from API calls if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then $BIN/v-add-web-domain $user $domain $ip no return_code=$? fi # Proxy support -# Do Not restart at this point will loose conecction from API calls +# Do Not restart at this point, will loose connection from API calls if [ ! -z "$PROXY_SYSTEM" ] && [ "$return_code" -eq 0 ]; then $BIN/v-add-web-domain-proxy $user $domain '' '' no fi From 2f300aab696e0f45eae9835330bfe1227c06ebaa Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:29:50 +0300 Subject: [PATCH 59/84] Fix for Ubuntu 14.04 --- bin/v-list-user-ns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-list-user-ns b/bin/v-list-user-ns index d296191b3..1da0fe5f1 100755 --- a/bin/v-list-user-ns +++ b/bin/v-list-user-ns @@ -21,7 +21,7 @@ json_list_ns() { ns=$(grep "^NS='" $USER_DATA/user.conf |cut -f 2 -d \') echo '[' i=1 - nslistc=$(echo -e "${ns//,/\n}"|wc -l) + nslistc=$(echo -e "${ns//,/\\n}"|wc -l) for nameserver in ${ns//,/ };do if [ "$i" -ne "$nslistc" ]; then echo -e "\t\"$nameserver\"," From 2558fa550d14ce56656667c8b319c2559454f3e0 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:34:34 +0300 Subject: [PATCH 60/84] Improved code formating --- web/add/cron/index.php | 71 ++-- web/add/db/index.php | 111 +++--- web/add/dns/index.php | 146 ++++---- web/add/ip/index.php | 139 +++---- web/add/mail/index.php | 234 ++++++------ web/add/package/index.php | 312 ++++++++-------- web/add/user/index.php | 196 +++++----- web/edit/backup/exclusions/index.php | 213 ++++++----- web/edit/cron/index.php | 120 +++--- web/edit/db/index.php | 101 +++-- web/edit/dns/index.php | 319 ++++++++-------- web/edit/ip/index.php | 189 +++++----- web/edit/mail/index.php | 527 ++++++++++++++------------- web/edit/package/index.php | 363 +++++++++--------- web/edit/user/index.php | 337 +++++++---------- 15 files changed, 1723 insertions(+), 1655 deletions(-) diff --git a/web/add/cron/index.php b/web/add/cron/index.php index 047d89b20..d7f1a2ce0 100644 --- a/web/add/cron/index.php +++ b/web/add/cron/index.php @@ -4,32 +4,19 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'CRON'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -// Header -include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); - -// Panel -top_panel($user,$TAB); - +// Check POST request if (!empty($_POST['ok'])) { - // Check input + + // Check empty fields if ((!isset($_POST['v_min'])) || ($_POST['v_min'] == '')) $errors[] = __('minute'); if ((!isset($_POST['v_hour'])) || ($_POST['v_hour'] == '')) $errors[] = __('hour'); if ((!isset($_POST['v_day'])) || ($_POST['v_day'] == '')) $errors[] = __('day'); if ((!isset($_POST['v_month'])) || ($_POST['v_month'] == '')) $errors[] = __('month'); if ((!isset($_POST['v_wday'])) || ($_POST['v_wday'] == '')) $errors[] = __('day of week'); if ((!isset($_POST['v_cmd'])) || ($_POST['v_cmd'] == '')) $errors[] = __('cmd'); - - // Protect input - $v_min = escapeshellarg($_POST['v_min']); - $v_hour = escapeshellarg($_POST['v_hour']); - $v_day = escapeshellarg($_POST['v_day']); - $v_month = escapeshellarg($_POST['v_month']); - $v_wday = escapeshellarg($_POST['v_wday']); - $v_cmd = escapeshellarg($_POST['v_cmd']); - - // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { if ( $i == 0 ) { @@ -39,32 +26,46 @@ if (!empty($_POST['ok'])) { } } $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); - } else { - // Add Cron Job + } + + // Protect input + $v_min = escapeshellarg($_POST['v_min']); + $v_hour = escapeshellarg($_POST['v_hour']); + $v_day = escapeshellarg($_POST['v_day']); + $v_month = escapeshellarg($_POST['v_month']); + $v_wday = escapeshellarg($_POST['v_wday']); + $v_cmd = escapeshellarg($_POST['v_cmd']); + + // Add cron job + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-cron-job ".$user." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var); - $v_type = $_POST['v_type']; - $v_charset = $_POST['v_charset']; check_return_code($return_var,$output); - unset($v_password); unset($output); - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('CRON_CREATED_OK'); - unset($v_min); - unset($v_hour); - unset($v_day); - unset($v_month); - unset($v_wday); - unset($v_cmd); - unset($output); - } + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('CRON_CREATED_OK'); + unset($v_min); + unset($v_hour); + unset($v_day); + unset($v_month); + unset($v_wday); + unset($v_cmd); + unset($output); } } -exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var); -$db_types = json_decode(implode('', $output), true); -unset($output); +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); +// Panel +top_panel($user,$TAB); + +// Display body include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html'); + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/add/db/index.php b/web/add/db/index.php index a4c1e543e..a9d7e8fa7 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -6,24 +6,16 @@ session_start(); $TAB = 'DB'; include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -// Header -include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); - -// Panel -top_panel($user,$TAB); - -$v_db_email = $panel[$user]['CONTACT']; - +// Check POST request if (!empty($_POST['ok'])) { - // Check input + + // Check empty fields 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_host'])) $errors[] = __('host'); if (empty($_POST['v_charset'])) $errors[] = __('charset'); - - // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { if ( $i == 0 ) { @@ -36,12 +28,18 @@ if (!empty($_POST['ok'])) { } // Validate email - if (!empty($_POST['v_db_email'])) { + if ((!empty($_POST['v_db_email'])) && (empty($_SESSION['error_msg']))) { if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) { $_SESSION['error_msg'] = __('Please enter valid email address.'); } } + // Check password length + if (empty($_SESSION['error_msg'])) { + $pw_len = strlen($_POST['v_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); + } + // Protect input $v_database = escapeshellarg($_POST['v_database']); $v_dbuser = escapeshellarg($_POST['v_dbuser']); @@ -51,63 +49,71 @@ if (!empty($_POST['ok'])) { $v_host = $_POST['v_host']; $v_db_email = $_POST['v_db_email']; - // Check password length + // Add database if (empty($_SESSION['error_msg'])) { - $pw_len = strlen($_POST['v_password']); - if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); - } - - if (empty($_SESSION['error_msg'])) { - // Add Database $v_type = escapeshellarg($_POST['v_type']); $v_charset = escapeshellarg($_POST['v_charset']); $v_host = escapeshellarg($_POST['v_host']); exec (VESTA_CMD."v-add-database ".$user." ".$v_database." ".$v_dbuser." ".$v_password." ".$v_type." ".$v_host." ".$v_charset, $output, $return_var); + check_return_code($return_var,$output); + unset($output); $v_type = $_POST['v_type']; $v_host = $_POST['v_host']; $v_charset = $_POST['v_charset']; - check_return_code($return_var,$output); + } + + // Get database manager url + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); + $sys = json_decode(implode('', $output), true); unset($output); - if ((!empty($v_db_email)) && (empty($_SESSION['error_msg']))) { - 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 = $v_db_email; - $subject = __("Database Credentials"); - $hostname = exec('hostname'); - $from = __('MAIL_FROM',$hostname); - $mailtext = __('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link); - send_email($to, $subject, $mailtext, $from); - } - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); - $sys = json_decode(implode('', $output), true); - unset($output); + list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"] . ":"); + if ($_POST['v_host'] != 'localhost' ) $http_host = $_POST['v_host']; + if ($_POST['v_type'] == 'mysql') $db_admin = "phpMyAdmin"; + if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/"; + if (($_POST['v_type'] == 'mysql') && (!empty($sys['config']['DB_PMA_URL']))) $db_admin_link = $sys['config']['DB_PMA_URL']; + if ($_POST['v_type'] == 'pgsql') $db_admin = "phpPgAdmin"; + if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/"; + if (($_POST['v_type'] == 'pgsql') && (!empty($sys['config']['DB_PGA_URL']))) $db_admin_link = $sys['config']['DB_PGA_URL']; + } - list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"] . ":"); - if ($_POST['v_host'] != 'localhost' ) $http_host = $_POST['v_host']; - if ($_POST['v_type'] == 'mysql') $db_admin = "phpMyAdmin"; - if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/"; - if (($_POST['v_type'] == 'mysql') && (!empty($sys['config']['DB_PMA_URL']))) $db_admin_link = $sys['config']['DB_PMA_URL']; - if ($_POST['v_type'] == 'pgsql') $db_admin = "phpPgAdmin"; - if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/"; - if (($_POST['v_type'] == 'pgsql') && (!empty($sys['config']['DB_PGA_URL']))) $db_admin_link = $sys['config']['DB_PGA_URL']; + // Email login credentials + if ((!empty($v_db_email)) && (empty($_SESSION['error_msg']))) { + $to = $v_db_email; + $subject = __("Database Credentials"); + $hostname = exec('hostname'); + $from = __('MAIL_FROM',$hostname); + $mailtext = __('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link); + send_email($to, $subject, $mailtext, $from); + } - $_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']); - $_SESSION['ok_msg'] .= " / " . __('open %s',$db_admin) . ""; - unset($v_database); - unset($v_dbuser); - unset($v_password); - unset($v_type); - unset($v_charset); - } + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']); + $_SESSION['ok_msg'] .= " / " . __('open %s',$db_admin) . ""; + unset($v_database); + unset($v_dbuser); + unset($v_password); + unset($v_type); + unset($v_charset); } } +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); + +// Panel +top_panel($user,$TAB); + +// Get user email +$v_db_email = $panel[$user]['CONTACT']; + +// List avaiable database types exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var); $db_types = json_decode(implode('', $output), true); unset($output); +// List available database servers $db_hosts = array(); foreach ($db_types as $db_type ) { exec (VESTA_CMD."v-list-database-hosts ".$db_type." 'json'", $output, $return_var); @@ -117,7 +123,10 @@ foreach ($db_types as $db_type ) { unset($output); } +// Display body include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html'); + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/add/dns/index.php b/web/add/dns/index.php index 8f6ec6c8e..f5a1b8a68 100644 --- a/web/add/dns/index.php +++ b/web/add/dns/index.php @@ -4,31 +4,15 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'DNS'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -// Header -include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); - -// Panel -top_panel($user,$TAB); - +// Check POST request for dns domain if (!empty($_POST['ok'])) { - // Check input + + // Check empty fields if (empty($_POST['v_domain'])) $errors[] = __('domain'); if (empty($_POST['v_ip'])) $errors[] = __('ip'); - - // Protect input - $v_domain = preg_replace("/^www./i", "", $_POST['v_domain']); - $v_domain = escapeshellarg($v_domain); - $v_domain = strtolower($v_domain); - $v_ip = escapeshellarg($_POST['v_ip']); - - if (!empty($_POST['v_ns1'])) $v_ns1 = escapeshellarg($_POST['v_ns1']); - if (!empty($_POST['v_ns2'])) $v_ns2 = escapeshellarg($_POST['v_ns2']); - if (!empty($_POST['v_ns3'])) $v_ns3 = escapeshellarg($_POST['v_ns3']); - if (!empty($_POST['v_ns4'])) $v_ns4 = escapeshellarg($_POST['v_ns4']); - - // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { if ( $i == 0 ) { @@ -38,49 +22,78 @@ if (!empty($_POST['ok'])) { } } $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); - } else { - // Add DNS + } + + // Protect input + $v_domain = preg_replace("/^www./i", "", $_POST['v_domain']); + $v_domain = escapeshellarg($v_domain); + $v_domain = strtolower($v_domain); + $v_ip = escapeshellarg($_POST['v_ip']); + if (!empty($_POST['v_ns1'])) $v_ns1 = escapeshellarg($_POST['v_ns1']); + if (!empty($_POST['v_ns2'])) $v_ns2 = escapeshellarg($_POST['v_ns2']); + if (!empty($_POST['v_ns3'])) $v_ns3 = escapeshellarg($_POST['v_ns3']); + if (!empty($_POST['v_ns4'])) $v_ns4 = escapeshellarg($_POST['v_ns4']); + + // Add dns domain + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$v_ns4." no", $output, $return_var); check_return_code($return_var,$output); unset($output); + } - // Change Expiriation date + // Set expiriation date + if (empty($_SESSION['error_msg'])) { if ((!empty($_POST['v_exp'])) && ($_POST['v_exp'] != date('Y-m-d', strtotime('+1 year')))) { $v_exp = escapeshellarg($_POST['v_exp']); exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } + } - // Change TTL + // Set ttl + if (empty($_SESSION['error_msg'])) { if ((!empty($_POST['v_ttl'])) && ($_POST['v_ttl'] != '14400') && (empty($_SESSION['error_msg']))) { $v_ttl = escapeshellarg($_POST['v_ttl']); exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } + } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); - unset($v_domain); - } - - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-restart-dns", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } + // Restart dns server + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); + unset($v_domain); } } -// DNS Record + +// Check POST request for dns record if (!empty($_POST['ok_rec'])) { - // Check input + + // Check empty fields if (empty($_POST['v_domain'])) $errors[] = 'domain'; if (empty($_POST['v_rec'])) $errors[] = 'record'; if (empty($_POST['v_type'])) $errors[] = 'type'; if (empty($_POST['v_val'])) $errors[] = 'value'; + if (!empty($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } // Protect input $v_domain = escapeshellarg($_POST['v_domain']); @@ -89,34 +102,36 @@ if (!empty($_POST['ok_rec'])) { $v_val = escapeshellarg($_POST['v_val']); $v_priority = escapeshellarg($_POST['v_priority']); - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } else { - // Add DNS Record + // Add dns record + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-dns-record ".$user." ".$v_domain." ".$v_rec." ".$v_type." ".$v_val." ".$v_priority, $output, $return_var); - $v_type = $_POST['v_type']; check_return_code($return_var,$output); unset($output); - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('DNS_RECORD_CREATED_OK',$_POST[v_rec],$_POST[v_domain]); - unset($v_domain); - unset($v_rec); - unset($v_val); - unset($v_priority); - } + $v_type = $_POST['v_type']; + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('DNS_RECORD_CREATED_OK',$_POST[v_rec],$_POST[v_domain]); + unset($v_domain); + unset($v_rec); + unset($v_val); + unset($v_priority); } } -if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { - if ((empty($v_ns1)) && (empty($v_ns2))) { + +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); + +// Panel +top_panel($user,$TAB); + +// Display body for dns domain +if (empty($_GET['domain'])) { + if (empty($v_ttl)) $v_ttl = 14400; + if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year')); + if (empty($v_ns1)) { exec (VESTA_CMD."v-list-user-ns ".$user." json", $output, $return_var); $nameservers = json_decode(implode('', $output), true); $v_ns1 = $nameservers[0]; @@ -125,17 +140,18 @@ if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { $v_ns4 = $nameservers[3]; unset($output); } - if (empty($v_ttl)) $v_ttl = 14400; - if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year')); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} else { +} + +// Display body for dns record +if (!empty($_GET['domain'])) { $v_domain = $_GET['domain']; include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns_rec.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); } +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); + // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/add/ip/index.php b/web/add/ip/index.php index 23eeb2434..dfb595ca1 100644 --- a/web/add/ip/index.php +++ b/web/add/ip/index.php @@ -4,80 +4,93 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'IP'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Check user +if ($_SESSION['user'] != 'admin') { + header("Location: /list/user"); + exit; +} + +// Check POST request +if (!empty($_POST['ok'])) { + + // Check empty fields + if (empty($_POST['v_ip'])) $errors[] = __('ip address'); + if (empty($_POST['v_netmask'])) $errors[] = __('netmask'); + if (empty($_POST['v_interface'])) $errors[] = __('interface'); + if (empty($_POST['v_owner'])) $errors[] = __('assigned user'); + if (!empty($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Protect input + $v_ip = escapeshellarg($_POST['v_ip']); + $v_netmask = escapeshellarg($_POST['v_netmask']); + $v_name = escapeshellarg($_POST['v_name']); + $v_nat = escapeshellarg($_POST['v_nat']); + $v_interface = escapeshellarg($_POST['v_interface']); + $v_owner = escapeshellarg($_POST['v_owner']); + $v_shared = $_POST['v_shared']; + + // Check shared checkmark + if ($v_shared == 'on') { + $ip_status = 'shared'; + } else { + $ip_status = 'dedicated'; + $v_dedicated = 'yes'; + + } + + // Add IP + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-sys-ip ".$v_ip." ".$v_netmask." ".$v_interface." ".$v_owner." '".$ip_status."' ".$v_name." ".$v_nat, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_owner = $_POST['v_owner']; + $v_interface = $_POST['v_interface']; + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('IP_CREATED_OK',$_POST['v_ip'],$_POST['v_ip']); + unset($v_ip); + unset($v_netmask); + unset($v_name); + unset($v_nat); + } +} + // 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_ip'])) $errors[] = __('ip address'); - if (empty($_POST['v_netmask'])) $errors[] = __('netmask'); - if (empty($_POST['v_interface'])) $errors[] = __('interface'); - if (empty($_POST['v_owner'])) $errors[] = __('assigned user'); +// List network interfaces +exec (VESTA_CMD."v-list-sys-interfaces 'json'", $output, $return_var); +$interfaces = json_decode(implode('', $output), true); +unset($output); - // Protect input - $v_ip = escapeshellarg($_POST['v_ip']); - $v_netmask = escapeshellarg($_POST['v_netmask']); - $v_name = escapeshellarg($_POST['v_name']); - $v_nat = escapeshellarg($_POST['v_nat']); +// List users +exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var); +$users = json_decode(implode('', $output), true); +unset($output); - $v_interface = $_POST['v_interface']; - $v_shared = $_POST['v_shared']; - if ($v_shared == 'on') { - $ip_status = 'shared'; - } else { - $ip_status = 'dedicated'; - $v_dedicated = 'yes'; - } +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_ip.html'); - $v_owner = $_POST['v_owner']; - - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } else { - // Add IP - $v_interface = escapeshellarg($_POST['v_interface']); - $v_owner = $_POST['v_owner']; - exec (VESTA_CMD."v-add-sys-ip ".$v_ip." ".$v_netmask." ".$v_interface." ".$v_owner." '".$ip_status."' ".$v_name." ".$v_nat, $output, $return_var); - $v_owner = $_POST['v_owner']; - $v_interface = $_POST['v_interface']; - check_return_code($return_var,$output); - unset($output); - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('IP_CREATED_OK',$_POST['v_ip'],$_POST['v_ip']); - unset($v_ip); - unset($v_netmask); - unset($v_name); - unset($v_nat); - } - } - } - exec (VESTA_CMD."v-list-sys-interfaces 'json'", $output, $return_var); - $interfaces = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var); - $users = json_decode(implode('', $output), true); - unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_ip.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/add/mail/index.php b/web/add/mail/index.php index 492d16739..41c0714d9 100644 --- a/web/add/mail/index.php +++ b/web/add/mail/index.php @@ -4,41 +4,15 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'MAIL'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -// Header -include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); -// Panel -top_panel($user,$TAB); - -// Mail Domain +// Check POST request for mail domain if (!empty($_POST['ok'])) { + + // Check empty fields if (empty($_POST['v_domain'])) $errors[] = __('domain'); - if (!empty($_POST['v_antispam'])) { - $v_antispam = 'yes'; - } else { - $v_antispam = 'no'; - } - - if (!empty($_POST['v_antivirus'])) { - $v_antivirus = 'yes'; - } else { - $v_antivirus = 'no'; - } - - if (!empty($_POST['v_dkim'])) { - $v_dkim = 'yes'; - } else { - $v_dkim = 'no'; - } - - // Protect input - $v_domain = preg_replace("/^www./i", "", $_POST['v_domain']); - $v_domain = escapeshellarg($v_domain); - $v_domain = strtolower($v_domain); - - // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { if ( $i == 0 ) { @@ -48,27 +22,66 @@ if (!empty($_POST['ok'])) { } } $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); - } else { + } - // Add mail domain + // Check antispam option + if (!empty($_POST['v_antispam'])) { + $v_antispam = 'yes'; + } else { + $v_antispam = 'no'; + } + + // Check antivirus option + if (!empty($_POST['v_antivirus'])) { + $v_antivirus = 'yes'; + } else { + $v_antivirus = 'no'; + } + + // Check dkim option + if (!empty($_POST['v_dkim'])) { + $v_dkim = 'yes'; + } else { + $v_dkim = 'no'; + } + + // Set domain name to lowercase and remove www prefix + $v_domain = preg_replace("/^www./i", "", $_POST['v_domain']); + $v_domain = escapeshellarg($v_domain); + $v_domain = strtolower($v_domain); + + // Add mail domain + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-mail-domain ".$user." ".$v_domain." ".$v_antispam." ".$v_antivirus." ".$v_dkim, $output, $return_var); check_return_code($return_var,$output); unset($output); + } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']); - unset($v_domain); - } + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']); + unset($v_domain); } } -// Mail Account +// Check POST request for mail account if (!empty($_POST['ok_acc'])) { - // Check input + + // Check empty fields if (empty($_POST['v_domain'])) $errors[] = __('domain'); if (empty($_POST['v_account'])) $errors[] = __('account'); if (empty($_POST['v_password'])) $errors[] = __('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'] = __('Field "%s" can not be blank.',$error_msg); + } // Protect input $v_domain = escapeshellarg($_POST['v_domain']); @@ -78,99 +91,100 @@ if (!empty($_POST['ok_acc'])) { $v_quota = escapeshellarg($_POST['v_quota']); $v_aliases = $_POST['v_aliases']; $v_fwd = $_POST['v_fwd']; - if (empty($_POST['v_quota'])) $v_quota = 0; if ((!empty($_POST['v_quota'])) || (!empty($_POST['v_aliases'])) || (!empty($_POST['v_fwd'])) ) $v_adv = 'yes'; - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } else { - // Add Mail Account + // Add Mail Account + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-add-mail-account ".$user." ".$v_domain." ".$v_account." ".$v_password." ".$v_quota, $output, $return_var); check_return_code($return_var,$output); unset($output); + } - // Add Aliases - if ((!empty($_POST['v_aliases'])) && (empty($_SESSION['error_msg']))) { - $valiases = preg_replace("/\n/", " ", $_POST['v_aliases']); - $valiases = preg_replace("/,/", " ", $valiases); - $valiases = preg_replace('/\s+/', ' ',$valiases); - $valiases = trim($valiases); - $aliases = explode(" ", $valiases); - foreach ($aliases as $alias) { - $alias = escapeshellarg($alias); - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-mail-account-alias ".$user." ".$v_domain." ".$v_account." ".$alias, $output, $return_var); - check_return_code($return_var,$output); - } - unset($output); - } - } - - // Add Forwads - if ((!empty($_POST['v_fwd'])) && (empty($_SESSION['error_msg']))) { - $vfwd = preg_replace("/\n/", " ", $_POST['v_fwd']); - $vfwd = preg_replace("/,/", " ", $vfwd); - $vfwd = preg_replace('/\s+/', ' ',$vfwd); - $vfwd = trim($vfwd); - $fwd = explode(" ", $vfwd); - foreach ($fwd as $forward) { - $forward = escapeshellarg($forward); - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-mail-account-forward ".$user." ".$v_domain." ".$v_account." ".$forward, $output, $return_var); - check_return_code($return_var,$output); - } - unset($output); - } - // Add fwd_only flag - if ((!empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-account-fwd-only ".$user." ".$v_domain." ".$v_account, $output, $return_var); + // Add Aliases + if ((!empty($_POST['v_aliases'])) && (empty($_SESSION['error_msg']))) { + $valiases = preg_replace("/\n/", " ", $_POST['v_aliases']); + $valiases = preg_replace("/,/", " ", $valiases); + $valiases = preg_replace('/\s+/', ' ',$valiases); + $valiases = trim($valiases); + $aliases = explode(" ", $valiases); + foreach ($aliases as $alias) { + $alias = escapeshellarg($alias); + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-mail-account-alias ".$user." ".$v_domain." ".$v_account." ".$alias, $output, $return_var); check_return_code($return_var,$output); unset($output); } } + } - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); - $sys = json_decode(implode('', $output), true); - unset($output); - - list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":"); - $webmail = "http://".$http_host."/webmail/"; - if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL']; - - $_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',strtolower($_POST['v_account']),$_POST[v_domain],strtolower($_POST['v_account']),$_POST[v_domain]); - $_SESSION['ok_msg'] .= " / " . __('open webmail') . ""; - unset($v_account); - unset($v_password); - unset($v_password); - unset($v_aliases); - unset($v_fwd); - unset($v_quota); + // Add Forwarders + if ((!empty($_POST['v_fwd'])) && (empty($_SESSION['error_msg']))) { + $vfwd = preg_replace("/\n/", " ", $_POST['v_fwd']); + $vfwd = preg_replace("/,/", " ", $vfwd); + $vfwd = preg_replace('/\s+/', ' ',$vfwd); + $vfwd = trim($vfwd); + $fwd = explode(" ", $vfwd); + foreach ($fwd as $forward) { + $forward = escapeshellarg($forward); + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-mail-account-forward ".$user." ".$v_domain." ".$v_account." ".$forward, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } } } + + // Add fwd_only flag + if ((!empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-account-fwd-only ".$user." ".$v_domain." ".$v_account, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Get webmail url + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); + $sys = json_decode(implode('', $output), true); + unset($output); + list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":"); + $webmail = "http://".$http_host."/webmail/"; + if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL']; + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',strtolower($_POST['v_account']),$_POST[v_domain],strtolower($_POST['v_account']),$_POST[v_domain]); + $_SESSION['ok_msg'] .= " / " . __('open webmail') . ""; + unset($v_account); + unset($v_password); + unset($v_password); + unset($v_aliases); + unset($v_fwd); + unset($v_quota); + } } +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); -if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { - $v_domain = (isset($_GET['domain'])?$_GET['domain']:''); +// Panel +top_panel($user,$TAB); + +// Display body for mail domain +if (empty($_GET['domain'])) { include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} else { +} + +// Display body for mail account +if (!empty($_GET['domain'])) { $v_domain = $_GET['domain']; include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail_acc.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); } +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); + // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/add/package/index.php b/web/add/package/index.php index 594d3529d..7feb8218b 100644 --- a/web/add/package/index.php +++ b/web/add/package/index.php @@ -4,175 +4,181 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'PACKAGE'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -if (empty($_SESSION['user'])) { - header("Location: /login/"); +// Check user +if ($_SESSION['user'] != 'admin') { + header("Location: /list/user"); + exit; } +// Check POST request +if (!empty($_POST['ok'])) { + + // Check empty fields + if (empty($_POST['v_package'])) $errors[] = __('package'); + if (empty($_POST['v_web_template'])) $errors[] = __('web template'); + if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template'); + if (empty($_POST['v_dns_template'])) $errors[] = __('dns template'); + if (empty($_POST['v_shell'])) $errrors[] = __('shell'); + if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains'); + if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases'); + if (!isset($_POST['v_dns_domains'])) $errors[] = __('dns domains'); + if (!isset($_POST['v_dns_records'])) $errors[] = __('dns records'); + if (!isset($_POST['v_mail_domains'])) $errors[] = __('mail domains'); + if (!isset($_POST['v_mail_accounts'])) $errors[] = __('mail accounts'); + if (!isset($_POST['v_databases'])) $errors[] = __('databases'); + if (!isset($_POST['v_cron_jobs'])) $errors[] = __('cron jobs'); + if (!isset($_POST['v_backups'])) $errors[] = __('backups'); + if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota'); + if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth'); + if (empty($_POST['v_ns1'])) $errors[] = __('ns1'); + if (empty($_POST['v_ns2'])) $errors[] = __('ns2'); + if (!empty($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Protect input + $v_package = escapeshellarg($_POST['v_package']); + $v_web_template = escapeshellarg($_POST['v_web_template']); + $v_proxy_template = escapeshellarg($_POST['v_proxy_template']); + $v_dns_template = escapeshellarg($_POST['v_dns_template']); + $v_shell = escapeshellarg($_POST['v_shell']); + $v_web_domains = escapeshellarg($_POST['v_web_domains']); + $v_web_aliases = escapeshellarg($_POST['v_web_aliases']); + $v_dns_domains = escapeshellarg($_POST['v_dns_domains']); + $v_dns_records = escapeshellarg($_POST['v_dns_records']); + $v_mail_domains = escapeshellarg($_POST['v_mail_domains']); + $v_mail_accounts = escapeshellarg($_POST['v_mail_accounts']); + $v_databases = escapeshellarg($_POST['v_databases']); + $v_cron_jobs = escapeshellarg($_POST['v_cron_jobs']); + $v_backups = escapeshellarg($_POST['v_backups']); + $v_disk_quota = escapeshellarg($_POST['v_disk_quota']); + $v_bandwidth = escapeshellarg($_POST['v_bandwidth']); + $v_ns1 = trim($_POST['v_ns1'], '.'); + $v_ns2 = trim($_POST['v_ns2'], '.'); + $v_ns3 = trim($_POST['v_ns3'], '.'); + $v_ns4 = trim($_POST['v_ns4'], '.'); + $v_ns = $v_ns1.",".$v_ns2; + if (!empty($v_ns3)) $v_ns .= ",".$v_ns3; + if (!empty($v_ns4)) $v_ns .= ",".$v_ns4; + $v_ns = escapeshellarg($v_ns); + $v_time = escapeshellarg(date('H:i:s')); + $v_date = escapeshellarg(date('Y-m-d')); + + // Create temporary dir + if (empty($_SESSION['error_msg'])) { + exec ('mktemp -d', $output, $return_var); + $tmpdir = $output[0]; + check_return_code($return_var,$output); + unset($output); + } + + // Create package file + if (empty($_SESSION['error_msg'])) { + $pkg = "WEB_TEMPLATE=".$v_web_template."\n"; + $pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n"; + $pkg .= "DNS_TEMPLATE=".$v_dns_template."\n"; + $pkg .= "WEB_DOMAINS=".$v_web_domains."\n"; + $pkg .= "WEB_ALIASES=".$v_web_aliases."\n"; + $pkg .= "DNS_DOMAINS=".$v_dns_domains."\n"; + $pkg .= "DNS_RECORDS=".$v_dns_records."\n"; + $pkg .= "MAIL_DOMAINS=".$v_mail_domains."\n"; + $pkg .= "MAIL_ACCOUNTS=".$v_mail_accounts."\n"; + $pkg .= "DATABASES=".$v_databases."\n"; + $pkg .= "CRON_JOBS=".$v_cron_jobs."\n"; + $pkg .= "DISK_QUOTA=".$v_disk_quota."\n"; + $pkg .= "BANDWIDTH=".$v_bandwidth."\n"; + $pkg .= "NS=".$v_ns."\n"; + $pkg .= "SHELL=".$v_shell."\n"; + $pkg .= "BACKUPS=".$v_backups."\n"; + $pkg .= "TIME=".$v_time."\n"; + $pkg .= "DATE=".$v_date."\n"; + + $fp = fopen($tmpdir."/".$_POST['v_package'].".pkg", 'w'); + fwrite($fp, $pkg); + fclose($fp); + } + + // Add new package + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Remove tmpdir + exec ('rm -rf '.$tmpdir, $output, $return_var); + unset($output); + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('PACKAGE_CREATED_OK',$_POST['v_package'],$_POST['v_package']); + unset($v_package); + } + +} + + // 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_package'])) $errors[] = __('package'); - if (empty($_POST['v_web_template'])) $errors[] = __('web template'); - if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template'); - if (empty($_POST['v_dns_template'])) $errors[] = __('dns template'); - if (empty($_POST['v_shell'])) $errrors[] = __('shell'); - if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains'); - if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases'); - if (!isset($_POST['v_dns_domains'])) $errors[] = __('dns domains'); - if (!isset($_POST['v_dns_records'])) $errors[] = __('dns records'); - if (!isset($_POST['v_mail_domains'])) $errors[] = __('mail domains'); - if (!isset($_POST['v_mail_accounts'])) $errors[] = __('mail accounts'); - if (!isset($_POST['v_databases'])) $errors[] = __('databases'); - if (!isset($_POST['v_cron_jobs'])) $errors[] = __('cron jobs'); - if (!isset($_POST['v_backups'])) $errors[] = __('backups'); - if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota'); - if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth'); - if (empty($_POST['v_ns1'])) $errors[] = __('ns1'); - if (empty($_POST['v_ns2'])) $errors[] = __('ns2'); +// List web temmplates +exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); +$web_templates = json_decode(implode('', $output), true); +unset($output); +// List web templates for proxy +exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); +$proxy_templates = json_decode(implode('', $output), true); +unset($output); - // Protect input - $v_package = escapeshellarg($_POST['v_package']); - $v_web_template = escapeshellarg($_POST['v_web_template']); - $v_proxy_template = escapeshellarg($_POST['v_proxy_template']); - $v_dns_template = escapeshellarg($_POST['v_dns_template']); - $v_shell = escapeshellarg($_POST['v_shell']); - $v_web_domains = escapeshellarg($_POST['v_web_domains']); - $v_web_aliases = escapeshellarg($_POST['v_web_aliases']); - $v_dns_domains = escapeshellarg($_POST['v_dns_domains']); - $v_dns_records = escapeshellarg($_POST['v_dns_records']); - $v_mail_domains = escapeshellarg($_POST['v_mail_domains']); - $v_mail_accounts = escapeshellarg($_POST['v_mail_accounts']); - $v_databases = escapeshellarg($_POST['v_databases']); - $v_cron_jobs = escapeshellarg($_POST['v_cron_jobs']); - $v_backups = escapeshellarg($_POST['v_backups']); - $v_disk_quota = escapeshellarg($_POST['v_disk_quota']); - $v_bandwidth = escapeshellarg($_POST['v_bandwidth']); - $v_ns1 = trim($_POST['v_ns1'], '.'); - $v_ns2 = trim($_POST['v_ns2'], '.'); - $v_ns3 = trim($_POST['v_ns3'], '.'); - $v_ns4 = trim($_POST['v_ns4'], '.'); - $v_ns = $v_ns1.",".$v_ns2; - if (!empty($v_ns3)) $v_ns .= ",".$v_ns3; - if (!empty($v_ns4)) $v_ns .= ",".$v_ns4; - $v_ns = escapeshellarg($v_ns); - $v_time = escapeshellarg(date('H:i:s')); - $v_date = escapeshellarg(date('Y-m-d')); +// List DNS templates +exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); +$dns_templates = json_decode(implode('', $output), true); +unset($output); - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } else { - exec ('mktemp -d', $output, $return_var); - $tmpdir = $output[0]; - unset($output); +// List system shells +exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); +$shells = json_decode(implode('', $output), true); +unset($output); - // Create package - $pkg = "WEB_TEMPLATE=".$v_web_template."\n"; - $pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n"; - $pkg .= "DNS_TEMPLATE=".$v_dns_template."\n"; - $pkg .= "WEB_DOMAINS=".$v_web_domains."\n"; - $pkg .= "WEB_ALIASES=".$v_web_aliases."\n"; - $pkg .= "DNS_DOMAINS=".$v_dns_domains."\n"; - $pkg .= "DNS_RECORDS=".$v_dns_records."\n"; - $pkg .= "MAIL_DOMAINS=".$v_mail_domains."\n"; - $pkg .= "MAIL_ACCOUNTS=".$v_mail_accounts."\n"; - $pkg .= "DATABASES=".$v_databases."\n"; - $pkg .= "CRON_JOBS=".$v_cron_jobs."\n"; - $pkg .= "DISK_QUOTA=".$v_disk_quota."\n"; - $pkg .= "BANDWIDTH=".$v_bandwidth."\n"; - $pkg .= "NS=".$v_ns."\n"; - $pkg .= "SHELL=".$v_shell."\n"; - $pkg .= "BACKUPS=".$v_backups."\n"; - $pkg .= "TIME=".$v_time."\n"; - $pkg .= "DATE=".$v_date."\n"; +// Set default values +if (empty($v_web_template)) $v_web_template = 'default'; +if (empty($v_proxy_template)) $v_proxy_template = 'default'; +if (empty($v_dns_template)) $v_dns_template = 'default'; +if (empty($v_shell)) $v_shell = 'nologin'; +if (empty($v_web_domains)) $v_web_domains = "'0'"; +if (empty($v_web_aliases)) $v_web_aliases = "'0'"; +if (empty($v_dns_domains)) $v_dns_domains = "'0'"; +if (empty($v_dns_records)) $v_dns_records = "'0'"; +if (empty($v_mail_domains)) $v_mail_domains = "'0'"; +if (empty($v_mail_accounts)) $v_mail_accounts = "'0'"; +if (empty($v_databases)) $v_databases = "'0'"; +if (empty($v_cron_jobs)) $v_cron_jobs = "'0'"; +if (empty($v_backups)) $v_backups = "'0'"; +if (empty($v_disk_quota)) $v_disk_quota = "'0'"; +if (empty($v_bandwidth)) $v_bandwidth = "'0'"; +if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd'; +if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd'; - // Write package - $fp = fopen($tmpdir."/".$_POST['v_package'].".pkg", 'w'); - fwrite($fp, $pkg); - fclose($fp); +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_package.html'); - // Add new package - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Remove tmpdir - exec ('rm -rf '.$tmpdir, $output, $return_var); - unset($output); - - // Check output - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('PACKAGE_CREATED_OK',$_POST['v_package'],$_POST['v_package']); - unset($v_package); - } - - } - } - - - exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); - check_error($return_var); - $web_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); - check_error($return_var); - $proxy_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); - check_error($return_var); - $dns_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); - check_error($return_var); - $shells = json_decode(implode('', $output), true); - unset($output); - - // Set default values - if (empty($v_web_template)) $v_web_template = 'default'; - if (empty($v_proxy_template)) $v_proxy_template = 'default'; - if (empty($v_dns_template)) $v_dns_template = 'default'; - if (empty($v_shell)) $v_shell = 'nologin'; - if (empty($v_web_domains)) $v_web_domains = "'0'"; - if (empty($v_web_aliases)) $v_web_aliases = "'0'"; - if (empty($v_dns_domains)) $v_dns_domains = "'0'"; - if (empty($v_dns_records)) $v_dns_records = "'0'"; - if (empty($v_mail_domains)) $v_mail_domains = "'0'"; - if (empty($v_mail_accounts)) $v_mail_accounts = "'0'"; - if (empty($v_databases)) $v_databases = "'0'"; - if (empty($v_cron_jobs)) $v_cron_jobs = "'0'"; - if (empty($v_backups)) $v_backups = "'0'"; - if (empty($v_disk_quota)) $v_disk_quota = "'0'"; - if (empty($v_bandwidth)) $v_bandwidth = "'0'"; - if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd'; - if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd'; - - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_package.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/add/user/index.php b/web/add/user/index.php index 59e9181ea..3324c0464 100644 --- a/web/add/user/index.php +++ b/web/add/user/index.php @@ -1,110 +1,128 @@ $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Validate email + if ((empty($_SESSION['error_msg'])) && (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL))) { + $_SESSION['error_msg'] = __('Please enter valid email address.'); + } + + // Check password length + if (empty($_SESSION['error_msg'])) { + $pw_len = strlen($_POST['v_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); + } + + // Protect input + $v_username = escapeshellarg($_POST['v_username']); + $v_password = escapeshellarg($_POST['v_password']); + $v_email = escapeshellarg($_POST['v_email']); + $v_package = escapeshellarg($_POST['v_package']); + $v_language = escapeshellarg($_POST['v_language']); + $v_fname = escapeshellarg($_POST['v_fname']); + $v_lname = escapeshellarg($_POST['v_lname']); + $v_notify = $_POST['v_notify']; + + + // Add user + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-user ".$v_username." ".$v_password." ".$v_email." ".$v_package." ".$v_fname." ".$v_lname, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Set language + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Send email to the new user + if ((empty($_SESSION['error_msg'])) && (!empty($v_notify))) { + $to = $_POST['v_notify']; + $subject = _translate($_POST['v_language'],"Welcome to Vesta Control Panel"); + $hostname = exec('hostname'); + unset($output); + $from = _translate($_POST['v_language'],'MAIL_FROM',$hostname); + if (!empty($_POST['v_fname'])) { + $mailtext = _translate($_POST['v_language'],'GREETINGS_GORDON_FREEMAN',$_POST['v_fname'],$_POST['v_lname']); + } else { + $mailtext = _translate($_POST['v_language'],'GREETINGS'); + } + $mailtext .= _translate($_POST['v_language'],'ACCOUNT_READY',$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']); + send_email($to, $subject, $mailtext, $from); + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('USER_CREATED_OK',$_POST['v_username'],$_POST['v_username']); + $_SESSION['ok_msg'] .= " / " . __('login as') ." ".$_POST['v_username']. ""; + unset($v_username); + unset($v_password); + unset($v_email); + unset($v_fname); + unset($v_lname); + unset($v_notify); + } +} + + // 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_username'])) $errors[] = __('user'); - if (empty($_POST['v_password'])) $errors[] = __('password'); - if (empty($_POST['v_package'])) $errrors[] = __('package'); - if (empty($_POST['v_email'])) $errors[] = __('email'); - if (empty($_POST['v_fname'])) $errors[] = __('first name'); - if (empty($_POST['v_lname'])) $errors[] = __('last name'); +// List hosting packages +exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); +check_error($return_var); +$data = json_decode(implode('', $output), true); +unset($output); - // Protect input - $v_username = escapeshellarg($_POST['v_username']); - $v_password = escapeshellarg($_POST['v_password']); - $v_email = escapeshellarg($_POST['v_email']); - $v_package = escapeshellarg($_POST['v_package']); - $v_language = escapeshellarg($_POST['v_language']); - $v_fname = escapeshellarg($_POST['v_fname']); - $v_lname = escapeshellarg($_POST['v_lname']); - $v_notify = $_POST['v_notify']; +// List languages +exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var); +$languages = json_decode(implode('', $output), true); +unset($output); - // Validate email - if (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL)) { - $_SESSION['error_msg'] = __('Please enter valid email address.'); - } +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_user.html'); - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } - - // Check password length - if (empty($_SESSION['error_msg'])) { - $pw_len = strlen($_POST['v_password']); - if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); - } - - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-user ".$v_username." ".$v_password." ".$v_email." ".$v_package." ".$v_fname." ".$v_lname, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var); - if (!empty($v_notify)) { - $to = $_POST['v_notify']; - $subject = _translate($_POST['v_language'],"Welcome to Vesta Control Panel"); - $hostname = exec('hostname'); - $from = _translate($_POST['v_language'],'MAIL_FROM',$hostname); - if (!empty($_POST['v_fname'])) { - $mailtext = _translate($_POST['v_language'],'GREETINGS_GORDON_FREEMAN',$_POST['v_fname'],$_POST['v_lname']); - } else { - $mailtext = _translate($_POST['v_language'],'GREETINGS'); - } - $mailtext .= _translate($_POST['v_language'],'ACCOUNT_READY',$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']); - send_email($to, $subject, $mailtext, $from); - } - - $_SESSION['ok_msg'] = __('USER_CREATED_OK',$_POST[v_username],$_POST[v_username]); - $_SESSION['ok_msg'] .= " / " . __('login as') ." ".$_POST[v_username]. ""; - unset($v_username); - unset($v_password); - unset($v_email); - unset($v_fname); - unset($v_lname); - unset($v_notify); - } - unset($output); - } - } - - exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); - check_error($return_var); - $data = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var); - $languages = json_decode(implode('', $output), true); - unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_user.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/backup/exclusions/index.php b/web/edit/backup/exclusions/index.php index a9c09929e..3f0e81130 100644 --- a/web/edit/backup/exclusions/index.php +++ b/web/edit/backup/exclusions/index.php @@ -3,116 +3,129 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'BACKUP EXCLUSIONS'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Edit as someone else? +if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { + $user=escapeshellarg($_GET['user']); +} + +// List backup exclustions +exec (VESTA_CMD."v-list-user-backup-exclusions ".$user." 'json'", $output, $return_var); +check_return_code($return_var,$output); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse web +$v_username = $user; +foreach ($data['WEB'] as $key => $value) { + if (!empty($value)){ + $v_web .= $key . ":" . $value. "\n"; + } else { + $v_web .= $key . "\n"; + } +} + +// Parse dns +foreach ($data['DNS'] as $key => $value) { + if (!empty($value)){ + $v_dns .= $key . ":" . $value. "\n"; + } else { + $v_dns .= $key . "\n"; + } +} + +// Parse mail +foreach ($data['MAIL'] as $key => $value) { + if (!empty($value)){ + $v_mail .= $key . ":" . $value. "\n"; + } else { + $v_mail .= $key . "\n"; + } +} + +// Parse databases +foreach ($data['DB'] as $key => $value) { + if (!empty($value)){ + $v_db .= $key . ":" . $value. "\n"; + } else { + $v_db .= $key . "\n"; + } +} + +// Parse user directories +foreach ($data['USER'] as $key => $value) { + if (!empty($value)){ + $v_userdir .= $key . ":" . $value. "\n"; + } else { + $v_userdir .= $key . "\n"; + } +} + +// Check POST request +if (!empty($_POST['save'])) { + $v_web = $_POST['v_web']; + $v_web_tmp = str_replace("\r\n", ",", $_POST['v_web']); + $v_web_tmp = rtrim($v_web_tmp, ","); + $v_web_tmp = "WEB=" . escapeshellarg($v_web_tmp); + + $v_dns = $_POST['v_dns']; + $v_dns_tmp = str_replace("\r\n", ",", $_POST['v_dns']); + $v_dns_tmp = rtrim($v_dns_tmp, ","); + $v_dns_tmp = "DNS=" . escapeshellarg($v_dns_tmp); + + $v_mail = $_POST['v_mail']; + $v_mail_tmp = str_replace("\r\n", ",", $_POST['v_mail']); + $v_mail_tmp = rtrim($v_mail_tmp, ","); + $v_mail_tmp = "MAIL=" . escapeshellarg($v_mail_tmp); + + $v_db = $_POST['v_db']; + $v_db_tmp = str_replace("\r\n", ",", $_POST['v_db']); + $v_db_tmp = rtrim($v_db_tmp, ","); + $v_db_tmp = "DB=" . escapeshellarg($v_db_tmp); + + $v_cron = $_POST['v_cron']; + $v_cron_tmp = str_replace("\r\n", ",", $_POST['v_cron']); + $v_cron_tmp = rtrim($v_cron_tmp, ","); + $v_cron_tmp = "CRON=" . escapeshellarg($v_cron_tmp); + + $v_userdir = $_POST['v_userdir']; + $v_userdir_tmp = str_replace("\r\n", ",", $_POST['v_userdir']); + $v_userdir_tmp = rtrim($v_userdir_tmp, ","); + $v_userdir_tmp = "USER=" . escapeshellarg($v_userdir_tmp); + + // Create temporary exeption list on a filesystem + exec ('mktemp', $mktemp_output, $return_var); + $tmp = $mktemp_output[0]; + $fp = fopen($tmp, 'w'); + fwrite($fp, $v_web_tmp . "\n" . $v_dns_tmp . "\n" . $v_mail_tmp . "\n" . $v_db_tmp . "\n" . $v_userdir_tmp . "\n"); + fclose($fp); + unset($mktemp_output); + + // Save changes + exec (VESTA_CMD."v-update-user-backup-exclusions ".$user." ".$tmp, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __("Changes has been saved."); + } +} + + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); -// Edit as someone else? -if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { - $user=escapeshellarg($_GET['user']); -} - -exec (VESTA_CMD."v-list-user-backup-exclusions ".$user." 'json'", $output, $return_var); -check_return_code($return_var,$output); -if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $user; - - foreach ($data['WEB'] as $key => $value) { - if (!empty($value)){ - $v_web .= $key . ":" . $value. "\n"; - } else { - $v_web .= $key . "\n"; - } - } - - foreach ($data['DNS'] as $key => $value) { - if (!empty($value)){ - $v_dns .= $key . ":" . $value. "\n"; - } else { - $v_dns .= $key . "\n"; - } - } - - foreach ($data['MAIL'] as $key => $value) { - if (!empty($value)){ - $v_mail .= $key . ":" . $value. "\n"; - } else { - $v_mail .= $key . "\n"; - } - } - - foreach ($data['DB'] as $key => $value) { - if (!empty($value)){ - $v_db .= $key . ":" . $value. "\n"; - } else { - $v_db .= $key . "\n"; - } - } - - foreach ($data['USER'] as $key => $value) { - if (!empty($value)){ - $v_userdir .= $key . ":" . $value. "\n"; - } else { - $v_userdir .= $key . "\n"; - } - } - - - // Action - if (!empty($_POST['save'])) { - - $v_web = $_POST['v_web']; - $v_web_tmp = str_replace("\r\n", ",", $_POST['v_web']); - $v_web_tmp = rtrim($v_web_tmp, ","); - $v_web_tmp = "WEB=" . escapeshellarg($v_web_tmp); - - $v_dns = $_POST['v_dns']; - $v_dns_tmp = str_replace("\r\n", ",", $_POST['v_dns']); - $v_dns_tmp = rtrim($v_dns_tmp, ","); - $v_dns_tmp = "DNS=" . escapeshellarg($v_dns_tmp); - - $v_mail = $_POST['v_mail']; - $v_mail_tmp = str_replace("\r\n", ",", $_POST['v_mail']); - $v_mail_tmp = rtrim($v_mail_tmp, ","); - $v_mail_tmp = "MAIL=" . escapeshellarg($v_mail_tmp); - - $v_db = $_POST['v_db']; - $v_db_tmp = str_replace("\r\n", ",", $_POST['v_db']); - $v_db_tmp = rtrim($v_db_tmp, ","); - $v_db_tmp = "DB=" . escapeshellarg($v_db_tmp); - - $v_cron = $_POST['v_cron']; - $v_cron_tmp = str_replace("\r\n", ",", $_POST['v_cron']); - $v_cron_tmp = rtrim($v_cron_tmp, ","); - $v_cron_tmp = "CRON=" . escapeshellarg($v_cron_tmp); - - $v_userdir = $_POST['v_userdir']; - $v_userdir_tmp = str_replace("\r\n", ",", $_POST['v_userdir']); - $v_userdir_tmp = rtrim($v_userdir_tmp, ","); - $v_userdir_tmp = "USER=" . escapeshellarg($v_userdir_tmp); - - exec ('mktemp', $mktemp_output, $return_var); - $tmp = $mktemp_output[0]; - $fp = fopen($tmp, 'w'); - fwrite($fp, $v_web_tmp . "\n" . $v_dns_tmp . "\n" . $v_mail_tmp . "\n" . $v_db_tmp . "\n" . $v_userdir_tmp . "\n"); - fclose($fp); - exec (VESTA_CMD."v-update-user-backup-exclusions ".$user." ".$tmp, $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __("Changes has been saved."); - } - } -} - +// Display body include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_backup_exclusions.html'); + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/edit/cron/index.php b/web/edit/cron/index.php index c5929b405..09d63cb5e 100644 --- a/web/edit/cron/index.php +++ b/web/edit/cron/index.php @@ -3,73 +3,79 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'CRON'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Edit as someone else? +if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { + $user=escapeshellarg($_GET['user']); +} + +// Check job id +if (empty($_GET['job'])) { + header("Location: /list/cron/"); + exit; +} + +// List cron job +$v_job = escapeshellarg($_GET['job']); +exec (VESTA_CMD."v-list-cron-job ".$user." ".$v_job." 'json'", $output, $return_var); +check_return_code($return_var,$output); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse cron job +$v_username = $user; +$v_job = $_GET['job']; +$v_min = $data[$v_job]['MIN']; +$v_hour = $data[$v_job]['HOUR']; +$v_day = $data[$v_job]['DAY']; +$v_month = $data[$v_job]['MONTH']; +$v_wday = $data[$v_job]['WDAY']; +$v_cmd = $data[$v_job]['CMD']; +$v_date = $data[$v_job]['DATE']; +$v_time = $data[$v_job]['TIME']; +$v_suspended = $data[$v_job]['SUSPENDED']; +if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; +} else { + $v_status = 'active'; +} + +// Check POST request +if (!empty($_POST['save'])) { + $v_username = $user; + $v_min = escapeshellarg($_POST['v_min']); + $v_hour = escapeshellarg($_POST['v_hour']); + $v_day = escapeshellarg($_POST['v_day']); + $v_month = escapeshellarg($_POST['v_month']); + $v_wday = escapeshellarg($_POST['v_wday']); + $v_cmd = escapeshellarg($_POST['v_cmd']); + + // Save changes + exec (VESTA_CMD."v-change-cron-job ".$v_username." ".$v_job." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + + $v_cmd = $_POST['v_cmd']; + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __("Changes has been saved."); + } +} + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); -// Edit as someone else? -if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { - $user=escapeshellarg($_GET['user']); -} - -// Check user argument? -if (empty($_GET['job'])) { - header("Location: /list/cron/"); - exit; -} - -$v_job = escapeshellarg($_GET['job']); -exec (VESTA_CMD."v-list-cron-job ".$user." ".$v_job." 'json'", $output, $return_var); -check_return_code($return_var,$output); -if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $user; - $v_job = $_GET['job']; - $v_min = $data[$v_job]['MIN']; - $v_hour = $data[$v_job]['HOUR']; - $v_day = $data[$v_job]['DAY']; - $v_month = $data[$v_job]['MONTH']; - $v_wday = $data[$v_job]['WDAY']; - $v_cmd = $data[$v_job]['CMD']; - $v_date = $data[$v_job]['DATE']; - $v_time = $data[$v_job]['TIME']; - $v_suspended = $data[$v_job]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - - // Action - if (!empty($_POST['save'])) { - $v_username = $user; - // Change job - if (($v_min != $_POST['v_min']) || ($v_hour != $_POST['v_hour']) || ($v_day != $_POST['v_day']) || ($v_month != $_POST['v_month']) || ($v_wday != $_POST['v_wday']) || ($v_cmd != $_POST['v_cmd']) &&(empty($_SESSION['error_msg']))) { - $v_min = escapeshellarg($_POST['v_min']); - $v_hour = escapeshellarg($_POST['v_hour']); - $v_day = escapeshellarg($_POST['v_day']); - $v_month = escapeshellarg($_POST['v_month']); - $v_wday = escapeshellarg($_POST['v_wday']); - $v_cmd = escapeshellarg($_POST['v_cmd']); - exec (VESTA_CMD."v-change-cron-job ".$v_username." ".$v_job." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_cmd = $_POST['v_cmd']; - } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __("Changes has been saved."); - } - } -} - +// Display body include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_cron.html'); + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/edit/db/index.php b/web/edit/db/index.php index 435bbb17f..c64e53046 100644 --- a/web/edit/db/index.php +++ b/web/edit/db/index.php @@ -3,8 +3,8 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'DB'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); // Header @@ -13,6 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); +// Check database id if (empty($_GET['database'])) { header("Location: /list/db/"); exit; @@ -23,69 +24,63 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { $user=escapeshellarg($_GET['user']); } +// List datbase $v_database = escapeshellarg($_GET['database']); exec (VESTA_CMD."v-list-database ".$user." ".$v_database." 'json'", $output, $return_var); check_return_code($return_var,$output); -if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse database +$v_username = $user; +$v_database = $_GET['database']; +$v_dbuser = $data[$v_database]['DBUSER']; +$v_password = "••••••••"; +$v_host = $data[$v_database]['HOST']; +$v_type = $data[$v_database]['TYPE']; +$v_charset = $data[$v_database]['CHARSET']; +$v_date = $data[$v_database]['DATE']; +$v_time = $data[$v_database]['TIME']; +$v_suspended = $data[$v_database]['SUSPENDED']; +if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; +} else { + $v_status = 'active'; +} + +// Check POST request +if (!empty($_POST['save'])) { $v_username = $user; - $v_database = $_GET['database']; - $v_dbuser = $data[$v_database]['DBUSER']; - $v_password = "••••••••"; - $v_host = $data[$v_database]['HOST']; - $v_type = $data[$v_database]['TYPE']; - $v_charset = $data[$v_database]['CHARSET']; - $v_date = $data[$v_database]['DATE']; - $v_time = $data[$v_database]['TIME']; - $v_suspended = $data[$v_database]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; + + // Change database user + if (($v_dbuser != $_POST['v_dbuser']) && (empty($_SESSION['error_msg']))) { + $v_dbuser = preg_replace("/^".$user."_/", "", $_POST['v_dbuser']); + $v_dbuser = escapeshellarg($v_dbuser); + exec (VESTA_CMD."v-change-database-user ".$v_username." ".$v_database." ".$v_dbuser, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_dbuser = $user."_".preg_replace("/^".$user."_/", "", $_POST['v_dbuser']); } - // Action - if (!empty($_POST['save'])) { - $v_username = $user; + // Change database password + if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { + $v_password = escapeshellarg($_POST['v_password']); + exec (VESTA_CMD."v-change-database-password ".$v_username." ".$v_database." ".$v_password, $output, $return_var); + check_return_code($return_var,$output); + $v_password = "••••••••"; + unset($output); + } - // Change database username - if (($v_dbuser != $_POST['v_dbuser']) && (empty($_SESSION['error_msg']))) { - $v_dbuser = preg_replace("/^".$user."_/", "", $_POST['v_dbuser']); - $v_dbuser = escapeshellarg($v_dbuser); - if ($v_password != $_POST['v_password']) { - // Change username and password - $v_password = escapeshellarg($_POST['v_password']); - exec (VESTA_CMD."v-change-database-user ".$v_username." ".$v_database." ".$v_dbuser." ".$v_password, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_dbuser = $user."_".preg_replace("/^".$user."_/", "", $_POST['v_dbuser']); - $v_password = "••••••••"; - $v_pw_changed = 'yes'; - } else { - // Change only username - exec (VESTA_CMD."v-change-database-user ".$v_username." ".$v_database." ".$v_dbuser, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_dbuser = $user."_".preg_replace("/^".$user."_/", "", $_POST['v_dbuser']); - } - } - - // Change only database password - if (($v_password != $_POST['v_password']) && (!isset($v_pw_changed)) && (empty($_SESSION['error_msg']))) { - $v_password = escapeshellarg($_POST['v_password']); - exec (VESTA_CMD."v-change-database-password ".$v_username." ".$v_database." ".$v_password, $output, $return_var); - check_return_code($return_var,$output); - $v_password = "••••••••"; - unset($output); - } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); } } +// Display body include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html'); + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/edit/dns/index.php b/web/edit/dns/index.php index cd6a1c179..d07d1a6dd 100644 --- a/web/edit/dns/index.php +++ b/web/edit/dns/index.php @@ -3,17 +3,11 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'DNS'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); -// Header -include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); - -// Panel -top_panel($user,$TAB); - -// Check user argument? +// Check domain name if (empty($_GET['domain'])) { header("Location: /list/dns/"); exit; @@ -24,163 +18,194 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { $user=escapeshellarg($_GET['user']); } -// Check domain +// List dns domain if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) { $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v-list-dns-domain ".$user." ".$v_domain." json", $output, $return_var); check_return_code($return_var,$output); + $data = json_decode(implode('', $output), true); + unset($output); + + // Parse dns domain + $v_username = $user; + $v_domain = $_GET['domain']; + $v_ip = $data[$v_domain]['IP']; + $v_template = $data[$v_domain]['TPL']; + $v_ttl = $data[$v_domain]['TTL']; + $v_exp = $data[$v_domain]['EXP']; + $v_soa = $data[$v_domain]['SOA']; + $v_date = $data[$v_domain]['DATE']; + $v_time = $data[$v_domain]['TIME']; + $v_suspended = $data[$v_domain]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; + } + + // List dns templates + exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); + $templates = json_decode(implode('', $output), true); + unset($output); +} + +// List dns record +if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) { + $v_domain = escapeshellarg($_GET['domain']); + $v_record_id = escapeshellarg($_GET['record_id']); + exec (VESTA_CMD."v-list-dns-records ".$user." ".$v_domain." 'json'", $output, $return_var); + check_return_code($return_var,$output); + $data = json_decode(implode('', $output), true); + unset($output); + + // Parse dns record + $v_username = $user; + $v_domain = $_GET['domain']; + $v_record_id = $_GET['record_id']; + $v_rec = $data[$v_record_id]['RECORD']; + $v_type = $data[$v_record_id]['TYPE']; + $v_val = $data[$v_record_id]['VALUE']; + $v_priority = $data[$v_record_id]['PRIORITY']; + $v_suspended = $data[$v_record_id]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; + } + $v_date = $data[$v_record_id]['DATE']; + $v_time = $data[$v_record_id]['TIME']; +} + +// Check POST request for dns domain +if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['record_id']))) { + $v_domain = escapeshellarg($_POST['v_domain']); + + // Change domain IP + if (($v_ip != $_POST['v_ip']) && (empty($_SESSION['error_msg']))) { + $v_ip = escapeshellarg($_POST['v_ip']); + exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); + check_return_code($return_var,$output); + $restart_dns = 'yes'; + unset($output); + } + + // Change domain template + if (($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) { + $v_template = escapeshellarg($_POST['v_template']); + exec (VESTA_CMD."v-change-dns-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $restart_dns = 'yes'; + } + + // Change SOA record + if (($v_soa != $_POST['v_soa']) && (empty($_SESSION['error_msg']))) { + $v_soa = escapeshellarg($_POST['v_soa']); + exec (VESTA_CMD."v-change-dns-domain-soa ".$v_username." ".$v_domain." ".$v_soa." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $restart_dns = 'yes'; + } + + // Change expiriation date + if (($v_exp != $_POST['v_exp']) && (empty($_SESSION['error_msg']))) { + $v_exp = escapeshellarg($_POST['v_exp']); + exec (VESTA_CMD."v-change-dns-domain-exp ".$v_username." ".$v_domain." ".$v_exp." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Change domain ttl + if (($v_ttl != $_POST['v_ttl']) && (empty($_SESSION['error_msg']))) { + $v_ttl = escapeshellarg($_POST['v_ttl']); + exec (VESTA_CMD."v-change-dns-domain-ttl ".$v_username." ".$v_domain." ".$v_ttl." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $restart_dns = 'yes'; + } + + // Restart dns server + if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Set success message if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); + $_SESSION['ok_msg'] = __('Changes has been saved.'); + } +} + +// Check POST request for dns record +if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (!empty($_GET['record_id']))) { + // Protect input + $v_domain = escapeshellarg($_POST['v_domain']); + $v_record_id = escapeshellarg($_POST['v_record_id']); + + // Change dns record + if (($v_val != $_POST['v_val']) || ($v_priority != $_POST['v_priority']) && (empty($_SESSION['error_msg']))) { + $v_val = escapeshellarg($_POST['v_val']); + $v_priority = escapeshellarg($_POST['v_priority']); + exec (VESTA_CMD."v-change-dns-record ".$v_username." ".$v_domain." ".$v_record_id." ".$v_val." ".$v_priority, $output, $return_var); + check_return_code($return_var,$output); + $v_val = $_POST['v_val']; unset($output); - $v_username = $user; - $v_domain = $_GET['domain']; - $v_ip = $data[$v_domain]['IP']; - $v_template = $data[$v_domain]['TPL']; - $v_ttl = $data[$v_domain]['TTL']; - $v_exp = $data[$v_domain]['EXP']; - $v_soa = $data[$v_domain]['SOA']; - $v_date = $data[$v_domain]['DATE']; - $v_time = $data[$v_domain]['TIME']; - $v_suspended = $data[$v_domain]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); - $templates = json_decode(implode('', $output), true); + $restart_dns = 'yes'; + } + + // Change dns record id + if (($_GET['record_id'] != $_POST['v_record_id']) && (empty($_SESSION['error_msg']))) { + $v_old_record_id = escapeshellarg($_GET['record_id']); + exec (VESTA_CMD."v-change-dns-record-id ".$v_username." ".$v_domain." ".$v_old_record_id." ".$v_record_id, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $restart_dns = 'yes'; + } + + // Restart dns server + if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); 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-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); - check_return_code($return_var,$output); - $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-dns-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $restart_dns = 'yes'; - } - - // SOA - if (($v_soa != $_POST['v_soa']) && (empty($_SESSION['error_msg']))) { - $v_soa = escapeshellarg($_POST['v_soa']); - exec (VESTA_CMD."v-change-dns-domain-soa ".$v_username." ".$v_domain." ".$v_soa." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $restart_dns = 'yes'; - } - - // EXP - if (($v_exp != $_POST['v_exp']) && (empty($_SESSION['error_msg']))) { - $v_exp = escapeshellarg($_POST['v_exp']); - exec (VESTA_CMD."v-change-dns-domain-exp ".$v_username." ".$v_domain." ".$v_exp." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $restart_dns = 'yes'; - } - - // TTL - if (($v_ttl != $_POST['v_ttl']) && (empty($_SESSION['error_msg']))) { - $v_ttl = escapeshellarg($_POST['v_ttl']); - exec (VESTA_CMD."v-change-dns-domain-ttl ".$v_username." ".$v_domain." ".$v_ttl." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $restart_dns = 'yes'; - } - - // Restart dns - if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-restart-dns", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); } + // Change url if record id was changed + if ((empty($_SESSION['error_msg'])) && ($_GET['record_id'] != $_POST['v_record_id'])) { + header("Location: /edit/dns/?domain=".$_GET['domain']."&record_id=".$_POST['v_record_id']); + exit; + } +} + +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); + +// Panel +top_panel($user,$TAB); + +// Display body for dns domain +if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) { if ($_SESSION['user'] == 'admin') { include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns.html'); } else { include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_dns.html'); } - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} else { - $v_domain = escapeshellarg($_GET['domain']); - $v_record_id = escapeshellarg($_GET['record_id']); - exec (VESTA_CMD."v-list-dns-records ".$user." ".$v_domain." 'json'", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $user; - $v_domain = $_GET['domain']; - $v_record_id = $_GET['record_id']; - $v_rec = $data[$v_record_id]['RECORD']; - $v_type = $data[$v_record_id]['TYPE']; - $v_val = $data[$v_record_id]['VALUE']; - $v_priority = $data[$v_record_id]['PRIORITY']; - $v_suspended = $data[$v_record_id]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - $v_date = $data[$v_record_id]['DATE']; - $v_time = $data[$v_record_id]['TIME']; - } - - // Action - if (!empty($_POST['save'])) { - $v_domain = escapeshellarg($_POST['v_domain']); - $v_record_id = escapeshellarg($_POST['v_record_id']); - if (($v_val != $_POST['v_val']) || ($v_priority != $_POST['v_priority']) && (empty($_SESSION['error_msg']))) { - $v_val = escapeshellarg($_POST['v_val']); - $v_priority = escapeshellarg($_POST['v_priority']); - exec (VESTA_CMD."v-change-dns-record ".$v_username." ".$v_domain." ".$v_record_id." ".$v_val." ".$v_priority, $output, $return_var); - check_return_code($return_var,$output); - $v_val = $_POST['v_val']; - $restart_dns = 'yes'; - unset($output); - } - - if (($_GET['record_id'] != $_POST['v_record_id']) && (empty($_SESSION['error_msg']))) { - $v_old_record_id = escapeshellarg($_GET['record_id']); - exec (VESTA_CMD."v-change-dns-record-id ".$v_username." ".$v_domain." ".$v_old_record_id." ".$v_record_id, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - - if ((empty($_SESSION['error_msg'])) && ($_GET['record_id'] != $_POST['v_record_id'])) { - header("Location: /edit/dns/?domain=".$_GET['domain']."&record_id=".$_POST['v_record_id']); - exit; - } - } - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns_rec.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); } +// List dns record +if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) { + // Display body for dns record + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns_rec.html'); +} + +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/ip/index.php b/web/edit/ip/index.php index c6cdf2de9..bec1ae58f 100644 --- a/web/edit/ip/index.php +++ b/web/edit/ip/index.php @@ -3,107 +3,114 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'IP'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Check user +if ($_SESSION['user'] != 'admin') { + header("Location: /list/user"); + exit; +} + +// Check ip argument +if (empty($_GET['ip'])) { + header("Location: /list/ip/"); + exit; +} + +// List ip +$v_ip = escapeshellarg($_GET['ip']); +exec (VESTA_CMD."v-list-sys-ip ".$v_ip." 'json'", $output, $return_var); +check_return_code($return_var,$output); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse ip +$v_username = $user; +$v_ip = $_GET['ip']; +$v_netmask = $data[$v_ip]['NETMASK']; +$v_interace = $data[$v_ip]['INTERFACE']; +$v_name = $data[$v_ip]['NAME']; +$v_nat = $data[$v_ip]['NAT']; +$v_ipstatus = $data[$v_ip]['STATUS']; +if ($v_ipstatus == 'dedicated') $v_dedicated = 'yes'; +$v_owner = $data[$v_ip]['OWNER']; +$v_date = $data[$v_ip]['DATE']; +$v_time = $data[$v_ip]['TIME']; +$v_suspended = $data[$v_ip]['SUSPENDED']; +if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; +} else { + $v_status = 'active'; +} + +// List users +exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var); +$users = json_decode(implode('', $output), true); +unset($output); + +// Check POST request +if (!empty($_POST['save'])) { + $v_ip = escapeshellarg($_POST['v_ip']); + + // Change Status + if (($v_ipstatus == 'shared') && (empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'dedicated'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_dedicated = 'yes'; + } + if (($v_ipstatus == 'dedicated') && (!empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'shared'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + unset($v_dedicated); + } + + // Change owner + if (($v_owner != $_POST['v_owner']) && (empty($_SESSION['error_msg']))) { + $v_owner = escapeshellarg($_POST['v_owner']); + exec (VESTA_CMD."v-change-sys-ip-owner ".$v_ip." ".$v_owner, $output, $return_var); + check_return_code($return_var,$output); + $v_owner = $_POST['v_owner']; + unset($output); + } + + // Change associated domain + if (($v_name != $_POST['v_name']) && (empty($_SESSION['error_msg']))) { + $v_name = escapeshellarg($_POST['v_name']); + exec (VESTA_CMD."v-change-sys-ip-name ".$v_ip." ".$v_name, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Change NAT address + if (($v_nat != $_POST['v_nat']) && (empty($_SESSION['error_msg']))) { + $v_nat = escapeshellarg($_POST['v_nat']); + exec (VESTA_CMD."v-change-sys-ip-nat ".$v_ip." ".$v_nat, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); + } +} + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); -// Are you admin? -if ($_SESSION['user'] == 'admin') { +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_ip.html'); - // Check user argument? - if (empty($_GET['ip'])) { - header("Location: /list/ip/"); - exit; - } - - $v_ip = escapeshellarg($_GET['ip']); - exec (VESTA_CMD."v-list-sys-ip ".$v_ip." 'json'", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $user; - $v_ip = $_GET['ip']; - $v_netmask = $data[$v_ip]['NETMASK']; - $v_interace = $data[$v_ip]['INTERFACE']; - $v_name = $data[$v_ip]['NAME']; - $v_nat = $data[$v_ip]['NAT']; - $v_ipstatus = $data[$v_ip]['STATUS']; - if ($v_ipstatus == 'dedicated') $v_dedicated = 'yes'; - $v_owner = $data[$v_ip]['OWNER']; - $v_date = $data[$v_ip]['DATE']; - $v_time = $data[$v_ip]['TIME']; - $v_suspended = $data[$v_ip]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - - exec (VESTA_CMD."v-list-sys-users 'json'", $output, $return_var); - $users = json_decode(implode('', $output), true); - unset($output); - - // Action - if (!empty($_POST['save'])) { - $v_username = $user; - $v_ip = escapeshellarg($_POST['v_ip']); - - // Change Status - if (($v_ipstatus == 'shared') && (empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'dedicated'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_dedicated = 'yes'; - } - if (($v_ipstatus == 'dedicated') && (!empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'shared'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - unset($v_dedicated); - } - - // Change owner - if (($v_owner != $_POST['v_owner']) && (empty($_SESSION['error_msg']))) { - $v_owner = escapeshellarg($_POST['v_owner']); - exec (VESTA_CMD."v-change-sys-ip-owner ".$v_ip." ".$v_owner, $output, $return_var); - check_return_code($return_var,$output); - $v_owner = $_POST['v_owner']; - unset($output); - } - - // Change Name - if (($v_name != $_POST['v_name']) && (empty($_SESSION['error_msg']))) { - $v_name = escapeshellarg($_POST['v_name']); - exec (VESTA_CMD."v-change-sys-ip-name ".$v_ip." ".$v_name, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Change Nat - if (($v_nat != $_POST['v_nat']) && (empty($_SESSION['error_msg']))) { - $v_nat = escapeshellarg($_POST['v_nat']); - exec (VESTA_CMD."v-change-sys-ip-nat ".$v_ip." ".$v_nat, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - } - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_ip.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/mail/index.php b/web/edit/mail/index.php index c70c6c896..6ff029351 100644 --- a/web/edit/mail/index.php +++ b/web/edit/mail/index.php @@ -3,8 +3,8 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'MAIL'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); // Header @@ -13,7 +13,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); -// Check user argument? +// Check domain argument if (empty($_GET['domain'])) { header("Location: /list/mail/"); exit; @@ -23,272 +23,289 @@ if (empty($_GET['domain'])) { if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { $user=escapeshellarg($_GET['user']); } +$v_username = $user; -// Check domain +// List mail domain if ((!empty($_GET['domain'])) && (empty($_GET['account']))) { $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v-list-mail-domain ".$user." ".$v_domain." json", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $user; - $v_domain = $_GET['domain']; - $v_antispam = $data[$v_domain]['ANTISPAM']; - $v_antivirus = $data[$v_domain]['ANTIVIRUS']; - $v_dkim = $data[$v_domain]['DKIM']; - $v_catchall = $data[$v_domain]['CATCHALL']; - $v_date = $data[$v_domain]['DATE']; - $v_time = $data[$v_domain]['TIME']; - $v_suspended = $data[$v_domain]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } + $data = json_decode(implode('', $output), true); + unset($output); + + // Parse domain + $v_domain = $_GET['domain']; + $v_antispam = $data[$v_domain]['ANTISPAM']; + $v_antivirus = $data[$v_domain]['ANTIVIRUS']; + $v_dkim = $data[$v_domain]['DKIM']; + $v_catchall = $data[$v_domain]['CATCHALL']; + $v_date = $data[$v_domain]['DATE']; + $v_time = $data[$v_domain]['TIME']; + $v_suspended = $data[$v_domain]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; } +} - // Action - if (!empty($_POST['save'])) { - $v_domain = escapeshellarg($_POST['v_domain']); - // Antispam - if (($v_antispam == 'yes') && (empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_antispam = 'no'; - unset($output); - } - if (($v_antispam == 'no') && (!empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_antispam = 'yes'; - unset($output); - } - // Antivirus - if (($v_antivirus == 'yes') && (empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_antivirus = 'no'; - unset($output); - } - if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_antivirus = 'yes'; - unset($output); - } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - - // DKIM - if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_dkim = 'no'; - unset($output); - } - if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_dkim = 'yes'; - unset($output); - } - - // Catchall - if ((!empty($v_catchall)) && (empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-domain-catchall ".$v_username." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - $v_catchall = ''; - unset($output); - } - if ((!empty($v_catchall)) && (!empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { - if ($v_catchall != $_POST['v_catchall']) { - $v_catchall = escapeshellarg($_POST['v_catchall']); - exec (VESTA_CMD."v-change-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - if ((empty($v_catchall)) && (!empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { - $v_catchall = escapeshellarg($_POST['v_catchall']); - exec (VESTA_CMD."v-add-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} else { - $v_username = $user; +// List mail account +if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) { $v_domain = escapeshellarg($_GET['domain']); $v_account = escapeshellarg($_GET['account']); exec (VESTA_CMD."v-list-mail-account ".$user." ".$v_domain." ".$v_account." 'json'", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); + $data = json_decode(implode('', $output), true); + unset($output); + + // Parse mail account + $v_username = $user; + $v_domain = $_GET['domain']; + $v_account = $_GET['account']; + $v_password = "••••••••"; + $v_aliases = str_replace(',', "\n", $data[$v_account]['ALIAS']); + $valiases = explode(",", $data[$v_account]['ALIAS']); + $v_fwd = str_replace(',', "\n", $data[$v_account]['FWD']); + $vfwd = explode(",", $data[$v_account]['FWD']); + $v_fwd_only = $data[$v_account]['FWD_ONLY']; + $v_quota = $data[$v_account]['QUOTA']; + $v_autoreply = $data[$v_account]['AUTOREPLY']; + $v_suspended = $data[$v_account]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; + } + $v_date = $data[$v_account]['DATE']; + $v_time = $data[$v_account]['TIME']; + + // Parse autoreply + if ( $v_autoreply == 'yes' ) { + exec (VESTA_CMD."v-list-mail-account-autoreply ".$user." '".$v_domain."' '".$v_account."' json", $output, $return_var); + $autoreply_str = json_decode(implode('', $output), true); unset($output); - $v_username = $user; - $v_domain = $_GET['domain']; - $v_account = $_GET['account']; - $v_password = "••••••••"; - $v_aliases = str_replace(',', "\n", $data[$v_account]['ALIAS']); - $valiases = explode(",", $data[$v_account]['ALIAS']); - $v_fwd = str_replace(',', "\n", $data[$v_account]['FWD']); - $vfwd = explode(",", $data[$v_account]['FWD']); - $v_fwd_only = $data[$v_account]['FWD_ONLY']; - $v_quota = $data[$v_account]['QUOTA']; - $v_autoreply = $data[$v_account]['AUTOREPLY']; - if ( $v_autoreply == 'yes' ) { - exec (VESTA_CMD."v-list-mail-account-autoreply ".$user." '".$v_domain."' '".$v_account."' json", $output, $return_var); - $autoreply_str = json_decode(implode('', $output), true); - unset($output); - $v_autoreply_message = $autoreply_str[$v_account]['MSG']; - } - $v_suspended = $data[$v_account]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - $v_date = $data[$v_account]['DATE']; - $v_time = $data[$v_account]['TIME']; + $v_autoreply_message = $autoreply_str[$v_account]['MSG']; } - - // Action - if (!empty($_POST['save'])) { - $v_domain = escapeshellarg($_POST['v_domain']); - $v_account = escapeshellarg($_POST['v_account']); - // Password - if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { - $v_password = escapeshellarg($_POST['v_password']); - exec (VESTA_CMD."v-change-mail-account-password ".$v_username." ".$v_domain." ".$v_account." ".$v_password, $output, $return_var); - check_return_code($return_var,$output); - $v_password = "••••••••"; - unset($output); - } - - // Quota - if (($v_quota != $_POST['v_quota']) && (empty($_SESSION['error_msg']))) { - if (empty($_POST['v_quota'])) { - $v_quota = 0; - } else { - $v_quota = escapeshellarg($_POST['v_quota']); - } - exec (VESTA_CMD."v-change-mail-account-quota ".$v_username." ".$v_domain." ".$v_account." ".$v_quota, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // 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))) { - exec (VESTA_CMD."v-delete-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - $result = array_diff($aliases, $valiases); - foreach ($result as $alias) { - if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { - exec (VESTA_CMD."v-add-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - } - // Forwarders - if (empty($_SESSION['error_msg'])) { - $wfwd = preg_replace("/\n/", " ", $_POST['v_fwd']); - $wfwd = preg_replace("/,/", " ", $wfwd); - $wfwd = preg_replace('/\s+/', ' ',$wfwd); - $wfwd = trim($wfwd); - $fwd = explode(" ", $wfwd); - $v_fwd = str_replace(' ', "\n", $wfwd); - $result = array_diff($vfwd, $fwd); - foreach ($result as $forward) { - if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { - exec (VESTA_CMD."v-delete-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - $result = array_diff($fwd, $vfwd); - foreach ($result as $forward) { - if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { - exec (VESTA_CMD."v-add-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - } - - // FWD_ONLY flag - if (($v_fwd_only == 'yes') && (empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-account-fwd-only ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_fwd_only = ''; - } - if (($v_fwd_only != 'yes') && (!empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-account-fwd-only ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_fwd_only = 'yes'; - } - - // Autoreply - if (($v_autoreply == 'yes') && (empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-delete-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_autoreply = 'no'; - $v_autoreply_message = ''; - } - if (($v_autoreply == 'yes') && (!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) { - if ( $v_autoreply_message != str_replace("\r\n", "\n", $_POST['v_autoreply_message'])) { - $v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']); - $v_autoreply_message = escapeshellarg($v_autoreply_message); - exec (VESTA_CMD."v-add-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account." ".$v_autoreply_message, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_autoreply_message = $_POST['v_autoreply_message']; - } - } - if (($v_autoreply == 'no') && (!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) { - if (empty($_POST['v_autoreply_message'])) $_SESSION['error_msg'] = $_SESSION['error_msg'] = __('Field "%s" can not be blank.','atoreply'); - if (empty($_SESSION['error_msg'])) { - $v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']); - $v_autoreply_message = escapeshellarg($v_autoreply_message); - exec (VESTA_CMD."v-add-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account." ".$v_autoreply_message, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_autoreply = 'yes'; - $v_autoreply_message = $_POST['v_autoreply_message']; - } - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail_acc.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); } +// Check POST request for mail domain +if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['account']))) { + $v_domain = escapeshellarg($_POST['v_domain']); + + // Delete antispam + if (($v_antispam == 'yes') && (empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_antispam = 'no'; + unset($output); + } + + // Add antispam + if (($v_antispam == 'no') && (!empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_antispam = 'yes'; + unset($output); + } + + // Delete antivirus + if (($v_antivirus == 'yes') && (empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_antivirus = 'no'; + unset($output); + } + + // Add antivirs + if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_antivirus = 'yes'; + unset($output); + } + + // Delete DKIM + if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_dkim = 'no'; + unset($output); + } + + // Add DKIM + if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_dkim = 'yes'; + unset($output); + } + + // Delete catchall + if ((!empty($v_catchall)) && (empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-domain-catchall ".$v_username." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + $v_catchall = ''; + unset($output); + } + + // Change catchall address + if ((!empty($v_catchall)) && (!empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { + if ($v_catchall != $_POST['v_catchall']) { + $v_catchall = escapeshellarg($_POST['v_catchall']); + exec (VESTA_CMD."v-change-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + + // Add catchall + if ((empty($v_catchall)) && (!empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) { + $v_catchall = escapeshellarg($_POST['v_catchall']); + exec (VESTA_CMD."v-add-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); + } +} + +// Check POST request for mail account +if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (!empty($_GET['account']))) { + $v_domain = escapeshellarg($_POST['v_domain']); + $v_account = escapeshellarg($_POST['v_account']); + + // Change password + if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { + $v_password = escapeshellarg($_POST['v_password']); + exec (VESTA_CMD."v-change-mail-account-password ".$v_username." ".$v_domain." ".$v_account." ".$v_password, $output, $return_var); + check_return_code($return_var,$output); + $v_password = "••••••••"; + unset($output); + } + + // Change quota + if (($v_quota != $_POST['v_quota']) && (empty($_SESSION['error_msg']))) { + if (empty($_POST['v_quota'])) { + $v_quota = 0; + } else { + $v_quota = escapeshellarg($_POST['v_quota']); + } + exec (VESTA_CMD."v-change-mail-account-quota ".$v_username." ".$v_domain." ".$v_account." ".$v_quota, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Change account 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))) { + exec (VESTA_CMD."v-delete-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + $result = array_diff($aliases, $valiases); + foreach ($result as $alias) { + if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { + exec (VESTA_CMD."v-add-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + } + + // Change forwarders + if (empty($_SESSION['error_msg'])) { + $wfwd = preg_replace("/\n/", " ", $_POST['v_fwd']); + $wfwd = preg_replace("/,/", " ", $wfwd); + $wfwd = preg_replace('/\s+/', ' ',$wfwd); + $wfwd = trim($wfwd); + $fwd = explode(" ", $wfwd); + $v_fwd = str_replace(' ', "\n", $wfwd); + $result = array_diff($vfwd, $fwd); + foreach ($result as $forward) { + if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { + exec (VESTA_CMD."v-delete-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + $result = array_diff($fwd, $vfwd); + foreach ($result as $forward) { + if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { + exec (VESTA_CMD."v-add-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + } + + // Delete FWD_ONLY flag + if (($v_fwd_only == 'yes') && (empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-account-fwd-only ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_fwd_only = ''; + } + + // Add FWD_ONLY flag + if (($v_fwd_only != 'yes') && (!empty($_POST['v_fwd_only'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-account-fwd-only ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_fwd_only = 'yes'; + } + + // Delete autoreply + if (($v_autoreply == 'yes') && (empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_autoreply = 'no'; + $v_autoreply_message = ''; + } + + // Add autoreply + if ((!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) { + if ( $v_autoreply_message != str_replace("\r\n", "\n", $_POST['v_autoreply_message'])) { + $v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']); + $v_autoreply_message = escapeshellarg($v_autoreply_message); + exec (VESTA_CMD."v-add-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account." ".$v_autoreply_message, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_autoreply = 'yes'; + $v_autoreply_message = $_POST['v_autoreply_message']; + } + } + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); + } +} + +// Display body for mail domain +if ((!empty($_GET['domain'])) && (empty($_GET['account']))) { + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail.html'); +} + +// Display body for mail account +if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) { + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail_acc.html'); +} + +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); + // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/package/index.php b/web/edit/package/index.php index 2347aa261..41b3640b6 100644 --- a/web/edit/package/index.php +++ b/web/edit/package/index.php @@ -3,196 +3,199 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'PACKAGE'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); + +// Check user +if ($_SESSION['user'] != 'admin') { + header("Location: /list/user"); + exit; +} + +// Check package argument +if (empty($_GET['package'])) { + header("Location: /list/package/"); + exit; +} + + +// List package +$v_package = escapeshellarg($_GET['package']); +exec (VESTA_CMD."v-list-user-package ".$v_package." 'json'", $output, $return_var); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse package +$v_package = $_GET['package']; +$v_web_template = $data[$v_package]['WEB_TEMPLATE']; +$v_proxy_template = $data[$v_package]['PROXY_TEMPLATE']; +$v_dns_template = $data[$v_package]['DNS_TEMPLATE']; +$v_web_domains = $data[$v_package]['WEB_DOMAINS']; +$v_web_aliases = $data[$v_package]['WEB_ALIASES']; +$v_dns_domains = $data[$v_package]['DNS_DOMAINS']; +$v_dns_records = $data[$v_package]['DNS_RECORDS']; +$v_mail_domains = $data[$v_package]['MAIL_DOMAINS']; +$v_mail_accounts = $data[$v_package]['MAIL_ACCOUNTS']; +$v_databases = $data[$v_package]['DATABASES']; +$v_cron_jobs = $data[$v_package]['CRON_JOBS']; +$v_disk_quota = $data[$v_package]['DISK_QUOTA']; +$v_bandwidth = $data[$v_package]['BANDWIDTH']; +$v_shell = $data[$v_package]['SHELL']; +$v_ns = $data[$v_package]['NS']; +$nameservers = explode(", ", $v_ns); +$v_ns1 = $nameservers[0]; +$v_ns2 = $nameservers[1]; +$v_ns3 = $nameservers[2]; +$v_ns4 = $nameservers[3]; +$v_backups = $data[$v_package]['BACKUPS']; +$v_date = $data[$v_package]['DATE']; +$v_time = $data[$v_package]['TIME']; +$v_status = 'active'; + +// List web templates +exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); +$web_templates = json_decode(implode('', $output), true); +unset($output); + +// List proxy templates +exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); +$proxy_templates = json_decode(implode('', $output), true); +unset($output); + +// List dns templates +exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); +$dns_templates = json_decode(implode('', $output), true); +unset($output); + +// List shels +exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); +$shells = json_decode(implode('', $output), true); +unset($output); + +// Check POST request +if (!empty($_POST['save'])) { + + // Check empty fields + if (empty($_POST['v_package'])) $errors[] = __('package'); + if (empty($_POST['v_web_template'])) $errors[] = __('web template'); + if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template'); + if (empty($_POST['v_dns_template'])) $errors[] = __('dns template'); + if (empty($_POST['v_shell'])) $errrors[] = __('shell'); + if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains'); + if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases'); + if (!isset($_POST['v_dns_domains'])) $errors[] = __('dns domains'); + if (!isset($_POST['v_dns_records'])) $errors[] = __('dns records'); + if (!isset($_POST['v_mail_domains'])) $errors[] = __('mail domains'); + if (!isset($_POST['v_mail_accounts'])) $errors[] = __('mail accounts'); + if (!isset($_POST['v_databases'])) $errors[] = __('databases'); + if (!isset($_POST['v_cron_jobs'])) $errors[] = __('cron jobs'); + if (!isset($_POST['v_backups'])) $errors[] = __('backups'); + if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota'); + if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth'); + if (empty($_POST['v_ns1'])) $errors[] = __('ns1'); + if (empty($_POST['v_ns2'])) $errors[] = __('ns2'); + if (!empty($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Protect input + $v_package = escapeshellarg($_POST['v_package']); + $v_web_template = escapeshellarg($_POST['v_web_template']); + $v_proxy_template = escapeshellarg($_POST['v_proxy_template']); + $v_dns_template = escapeshellarg($_POST['v_dns_template']); + $v_shell = escapeshellarg($_POST['v_shell']); + $v_web_domains = escapeshellarg($_POST['v_web_domains']); + $v_web_aliases = escapeshellarg($_POST['v_web_aliases']); + $v_dns_domains = escapeshellarg($_POST['v_dns_domains']); + $v_dns_records = escapeshellarg($_POST['v_dns_records']); + $v_mail_domains = escapeshellarg($_POST['v_mail_domains']); + $v_mail_accounts = escapeshellarg($_POST['v_mail_accounts']); + $v_databases = escapeshellarg($_POST['v_databases']); + $v_cron_jobs = escapeshellarg($_POST['v_cron_jobs']); + $v_backups = escapeshellarg($_POST['v_backups']); + $v_disk_quota = escapeshellarg($_POST['v_disk_quota']); + $v_bandwidth = escapeshellarg($_POST['v_bandwidth']); + $v_ns1 = trim($_POST['v_ns1'], '.'); + $v_ns2 = trim($_POST['v_ns2'], '.'); + $v_ns3 = trim($_POST['v_ns3'], '.'); + $v_ns4 = trim($_POST['v_ns4'], '.'); + $v_ns = $v_ns1.",".$v_ns2; + if (!empty($v_ns3)) $v_ns .= ",".$v_ns3; + if (!empty($v_ns4)) $v_ns .= ",".$v_ns4; + $v_ns = escapeshellarg($v_ns); + $v_time = escapeshellarg(date('H:i:s')); + $v_date = escapeshellarg(date('Y-m-d')); + + // Create temprorary directory + exec ('mktemp -d', $output, $return_var); + $tmpdir = $output[0]; + unset($output); + + // Save package file on a fs + $pkg = "WEB_TEMPLATE=".$v_web_template."\n"; + $pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n"; + $pkg .= "DNS_TEMPLATE=".$v_dns_template."\n"; + $pkg .= "WEB_DOMAINS=".$v_web_domains."\n"; + $pkg .= "WEB_ALIASES=".$v_web_aliases."\n"; + $pkg .= "DNS_DOMAINS=".$v_dns_domains."\n"; + $pkg .= "DNS_RECORDS=".$v_dns_records."\n"; + $pkg .= "MAIL_DOMAINS=".$v_mail_domains."\n"; + $pkg .= "MAIL_ACCOUNTS=".$v_mail_accounts."\n"; + $pkg .= "DATABASES=".$v_databases."\n"; + $pkg .= "CRON_JOBS=".$v_cron_jobs."\n"; + $pkg .= "DISK_QUOTA=".$v_disk_quota."\n"; + $pkg .= "BANDWIDTH=".$v_bandwidth."\n"; + $pkg .= "NS=".$v_ns."\n"; + $pkg .= "SHELL=".$v_shell."\n"; + $pkg .= "BACKUPS=".$v_backups."\n"; + $pkg .= "TIME=".$v_time."\n"; + $pkg .= "DATE=".$v_date."\n"; + $fp = fopen($tmpdir."/".$_POST['v_package'].".pkg", 'w'); + fwrite($fp, $pkg); + fclose($fp); + + // Save changes + exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package." 'yes'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + + // Remove temporary dir + exec ('rm -rf '.$tmpdir, $output, $return_var); + unset($output); + + // Propogate new package + exec (VESTA_CMD."v-update-user-package ".$v_package." 'json'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + + // Set success message + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('Changes has been saved.'); + } +} + + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); -// Are you admin? -if ($_SESSION['user'] == 'admin') { +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_package.html'); - // Check user argument? - if (empty($_GET['package'])) { - header("Location: /list/package/"); - exit; - } - - $v_package = escapeshellarg($_GET['package']); - exec (VESTA_CMD."v-list-user-package ".$v_package." 'json'", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - - $v_package = $_GET['package']; - $v_web_template = $data[$v_package]['WEB_TEMPLATE']; - $v_proxy_template = $data[$v_package]['PROXY_TEMPLATE']; - $v_dns_template = $data[$v_package]['DNS_TEMPLATE']; - $v_web_domains = $data[$v_package]['WEB_DOMAINS']; - $v_web_aliases = $data[$v_package]['WEB_ALIASES']; - $v_dns_domains = $data[$v_package]['DNS_DOMAINS']; - $v_dns_records = $data[$v_package]['DNS_RECORDS']; - $v_mail_domains = $data[$v_package]['MAIL_DOMAINS']; - $v_mail_accounts = $data[$v_package]['MAIL_ACCOUNTS']; - $v_databases = $data[$v_package]['DATABASES']; - $v_cron_jobs = $data[$v_package]['CRON_JOBS']; - $v_disk_quota = $data[$v_package]['DISK_QUOTA']; - $v_bandwidth = $data[$v_package]['BANDWIDTH']; - $v_shell = $data[$v_package]['SHELL']; - $v_ns = $data[$v_package]['NS']; - $nameservers = explode(", ", $v_ns); - $v_ns1 = $nameservers[0]; - $v_ns2 = $nameservers[1]; - $v_ns3 = $nameservers[2]; - $v_ns4 = $nameservers[3]; - $v_backups = $data[$v_package]['BACKUPS']; - $v_date = $data[$v_package]['DATE']; - $v_time = $data[$v_package]['TIME']; - $v_status = 'active'; - - - exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); - check_error($return_var); - $web_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); - check_error($return_var); - $proxy_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var); - check_error($return_var); - $dns_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); - check_error($return_var); - $shells = json_decode(implode('', $output), true); - unset($output); - - // Action - if (!empty($_POST['save'])) { - // Check input - if (empty($_POST['v_package'])) $errors[] = __('package'); - if (empty($_POST['v_web_template'])) $errors[] = __('web template'); - if (empty($_POST['v_proxy_template'])) $errors[] = __('proxy template'); - if (empty($_POST['v_dns_template'])) $errors[] = __('dns template'); - if (empty($_POST['v_shell'])) $errrors[] = __('shell'); - if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains'); - if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases'); - if (!isset($_POST['v_dns_domains'])) $errors[] = __('dns domains'); - if (!isset($_POST['v_dns_records'])) $errors[] = __('dns records'); - if (!isset($_POST['v_mail_domains'])) $errors[] = __('mail domains'); - if (!isset($_POST['v_mail_accounts'])) $errors[] = __('mail accounts'); - if (!isset($_POST['v_databases'])) $errors[] = __('databases'); - if (!isset($_POST['v_cron_jobs'])) $errors[] = __('cron jobs'); - if (!isset($_POST['v_backups'])) $errors[] = __('backups'); - if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota'); - if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth'); - if (empty($_POST['v_ns1'])) $errors[] = __('ns1'); - if (empty($_POST['v_ns2'])) $errors[] = __('ns2'); - - // Protect input - $v_package = escapeshellarg($_POST['v_package']); - $v_web_template = escapeshellarg($_POST['v_web_template']); - $v_proxy_template = escapeshellarg($_POST['v_proxy_template']); - $v_dns_template = escapeshellarg($_POST['v_dns_template']); - $v_shell = escapeshellarg($_POST['v_shell']); - $v_web_domains = escapeshellarg($_POST['v_web_domains']); - $v_web_aliases = escapeshellarg($_POST['v_web_aliases']); - $v_dns_domains = escapeshellarg($_POST['v_dns_domains']); - $v_dns_records = escapeshellarg($_POST['v_dns_records']); - $v_mail_domains = escapeshellarg($_POST['v_mail_domains']); - $v_mail_accounts = escapeshellarg($_POST['v_mail_accounts']); - $v_databases = escapeshellarg($_POST['v_databases']); - $v_cron_jobs = escapeshellarg($_POST['v_cron_jobs']); - $v_backups = escapeshellarg($_POST['v_backups']); - $v_disk_quota = escapeshellarg($_POST['v_disk_quota']); - $v_bandwidth = escapeshellarg($_POST['v_bandwidth']); - $v_ns1 = trim($_POST['v_ns1'], '.'); - $v_ns2 = trim($_POST['v_ns2'], '.'); - $v_ns3 = trim($_POST['v_ns3'], '.'); - $v_ns4 = trim($_POST['v_ns4'], '.'); - $v_ns = $v_ns1.",".$v_ns2; - if (!empty($v_ns3)) $v_ns .= ",".$v_ns3; - if (!empty($v_ns4)) $v_ns .= ",".$v_ns4; - $v_ns = escapeshellarg($v_ns); - $v_time = escapeshellarg(date('H:i:s')); - $v_date = escapeshellarg(date('Y-m-d')); - - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } else { - exec ('mktemp -d', $output, $return_var); - $tmpdir = $output[0]; - unset($output); - - // Create package - $pkg = "WEB_TEMPLATE=".$v_web_template."\n"; - $pkg .= "PROXY_TEMPLATE=".$v_proxy_template."\n"; - $pkg .= "DNS_TEMPLATE=".$v_dns_template."\n"; - $pkg .= "WEB_DOMAINS=".$v_web_domains."\n"; - $pkg .= "WEB_ALIASES=".$v_web_aliases."\n"; - $pkg .= "DNS_DOMAINS=".$v_dns_domains."\n"; - $pkg .= "DNS_RECORDS=".$v_dns_records."\n"; - $pkg .= "MAIL_DOMAINS=".$v_mail_domains."\n"; - $pkg .= "MAIL_ACCOUNTS=".$v_mail_accounts."\n"; - $pkg .= "DATABASES=".$v_databases."\n"; - $pkg .= "CRON_JOBS=".$v_cron_jobs."\n"; - $pkg .= "DISK_QUOTA=".$v_disk_quota."\n"; - $pkg .= "BANDWIDTH=".$v_bandwidth."\n"; - $pkg .= "NS=".$v_ns."\n"; - $pkg .= "SHELL=".$v_shell."\n"; - $pkg .= "BACKUPS=".$v_backups."\n"; - $pkg .= "TIME=".$v_time."\n"; - $pkg .= "DATE=".$v_date."\n"; - - // Write package - $fp = fopen($tmpdir."/".$_POST['v_package'].".pkg", 'w'); - fwrite($fp, $pkg); - fclose($fp); - - // Rewrite package - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package." 'yes'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Remove tmpdir - exec ('rm -rf '.$tmpdir, $output, $return_var); - unset($output); - - // Propogate new package - exec (VESTA_CMD."v-update-user-package ".$v_package." 'json'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - } - } - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_package.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/user/index.php b/web/edit/user/index.php index bc1aa8889..50f36c3ad 100644 --- a/web/edit/user/index.php +++ b/web/edit/user/index.php @@ -3,118 +3,126 @@ error_reporting(NULL); ob_start(); session_start(); - $TAB = 'USER'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); +// Check user argument +if (empty($_GET['user'])) { + header("Location: /list/user/"); + exit; +} + +// Edit as someone else? +if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { + $user=$_GET['user']; + $v_username=$_GET['user']; +} else { + $user=$_SESSION['user']; + $v_username=$_SESSION['user']; +} + +// List user +exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var); +check_return_code($return_var,$output); +$data = json_decode(implode('', $output), true); +unset($output); + +// Parse user +$v_password = "••••••••"; +$v_email = $data[$v_username]['CONTACT']; +$v_package = $data[$v_username]['PACKAGE']; +$v_language = $data[$v_username]['LANGUAGE']; +$v_fname = $data[$v_username]['FNAME']; +$v_lname = $data[$v_username]['LNAME']; +$v_shell = $data[$v_username]['SHELL']; +$v_ns = $data[$v_username]['NS']; +$nameservers = explode(", ", $v_ns); +$v_ns1 = $nameservers[0]; +$v_ns2 = $nameservers[1]; +$v_ns3 = $nameservers[2]; +$v_ns4 = $nameservers[3]; +$v_suspended = $data[$v_username]['SUSPENDED']; +if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; +} else { + $v_status = 'active'; +} +$v_time = $data[$v_username]['TIME']; +$v_date = $data[$v_username]['DATE']; + +// List packages +exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); +$packages = json_decode(implode('', $output), true); +unset($output); + +// List lanugages +exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var); +$languages = json_decode(implode('', $output), true); +unset($output); + +// List shells +exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); +$shells = json_decode(implode('', $output), true); +unset($output); + // Are you admin? -if ($_SESSION['user'] == 'admin') { - // Check user argument? - if (empty($_GET['user'])) { - header("Location: /list/user/"); - exit; - } +// Check POST request +if (!empty($_POST['save'])) { - // Check user - $v_username = escapeshellarg($_GET['user']); - exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_username = $_GET['user']; + // Change password + if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { + $v_password = escapeshellarg($_POST['v_password']); + exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var); + check_return_code($return_var,$output); $v_password = "••••••••"; - $v_email = $data[$v_username]['CONTACT']; - $v_package = $data[$v_username]['PACKAGE']; - $v_language = $data[$v_username]['LANGUAGE']; - $v_fname = $data[$v_username]['FNAME']; - $v_lname = $data[$v_username]['LNAME']; - $v_shell = $data[$v_username]['SHELL']; - $v_ns = $data[$v_username]['NS']; - $nameservers = explode(", ", $v_ns); - $v_ns1 = $nameservers[0]; - $v_ns2 = $nameservers[1]; - $v_ns3 = $nameservers[2]; - $v_ns4 = $nameservers[3]; - $v_suspended = $data[$v_username]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - $v_time = $data[$v_username]['TIME']; - $v_date = $data[$v_username]['DATE']; - - exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); - $packages = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var); - $languages = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-sys-shells json", $output, $return_var); - $shells = json_decode(implode('', $output), true); unset($output); } - // Action - if (!empty($_POST['save'])) { - $v_username = escapeshellarg($_POST['v_username']); + // Change package (admin only) + if (($v_package != $_POST['v_package']) && ($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) { + $v_package = escapeshellarg($_POST['v_package']); + exec (VESTA_CMD."v-change-user-package ".$v_username." ".$v_package, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } - // Change password - if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { - $v_password = escapeshellarg($_POST['v_password']); - exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var); - check_return_code($return_var,$output); - $v_password = "••••••••"; - unset($output); - } + // Change language + if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) { + $v_language = escapeshellarg($_POST['v_language']); + exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var); + check_return_code($return_var,$output); + if (($_GET['user'] == 'admin') && (empty($_SESSION['error_msg']))) $_SESSION['language'] = $_POST['v_language']; + unset($output); + } - // Change package - if (($v_package != $_POST['v_package']) && (empty($_SESSION['error_msg']))) { - $v_package = escapeshellarg($_POST['v_package']); - exec (VESTA_CMD."v-change-user-package ".$v_username." ".$v_package, $output, $return_var); + // Change shell (admin only) + if (($v_shell != $_POST['v_shell']) && ($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) { + $v_shell = escapeshellarg($_POST['v_shell']); + exec (VESTA_CMD."v-change-user-shell ".$v_username." ".$v_shell, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Change contact email + if (($v_email != $_POST['v_email']) && (empty($_SESSION['error_msg']))) { + if (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL)) { + $_SESSION['error_msg'] = __('Please enter valid email address.'); + } else { + $v_email = escapeshellarg($_POST['v_email']); + exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var); check_return_code($return_var,$output); unset($output); } + } - // Change language - if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) { - $v_language = escapeshellarg($_POST['v_language']); - exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var); - check_return_code($return_var,$output); - if (($_GET['user'] == 'admin') && (empty($_SESSION['error_msg']))) $_SESSION['language'] = $_POST['v_language']; - unset($output); - } - - // Change shell - if (($v_shell != $_POST['v_shell']) && (empty($_SESSION['error_msg']))) { - $v_shell = escapeshellarg($_POST['v_shell']); - exec (VESTA_CMD."v-change-user-shell ".$v_username." ".$v_shell, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Change contact email - if (($v_email != $_POST['v_email']) && (empty($_SESSION['error_msg']))) { - // Validate email - if (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL)) { - $_SESSION['error_msg'] = __('Please enter valid email address.'); - } else { - $v_email = escapeshellarg($_POST['v_email']); - exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var); - check_return_code($return_var,$output); - } - unset($output); - } - - // Change Name - if (($v_fname != $_POST['v_fname']) || ($v_lname != $_POST['v_lname']) && (empty($_SESSION['error_msg']))) { + // Change full name (admin only) + if (($v_fname != $_POST['v_fname']) || ($v_lname != $_POST['v_lname'])) { + if (($_SESSION['user'] == 'admin') && (empty($_SESSION['error_msg']))) { $v_fname = escapeshellarg($_POST['v_fname']); $v_lname = escapeshellarg($_POST['v_lname']); exec (VESTA_CMD."v-change-user-name ".$v_username." ".$v_fname." ".$v_lname, $output, $return_var); @@ -123,124 +131,41 @@ if ($_SESSION['user'] == 'admin') { $v_fname = $_POST['v_fname']; $v_lname = $_POST['v_lname']; } - - // Change NameServers - if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) { - $v_ns1 = escapeshellarg($_POST['v_ns1']); - $v_ns2 = escapeshellarg($_POST['v_ns2']); - $v_ns3 = escapeshellarg($_POST['v_ns3']); - $v_ns4 = escapeshellarg($_POST['v_ns4']); - $ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2; - if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3; - if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4; - exec ($ns_cmd, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - // Panel - top_panel($user,$TAB); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_user.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -} else { - // Check user argument? - if (empty($_GET['user'])) { - header("Location: /list/user/"); - exit; } - // Check user - $v_username = $user; - exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var); - check_return_code($return_var,$output); + // Change NameServers + if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) { + $v_ns1 = escapeshellarg($_POST['v_ns1']); + $v_ns2 = escapeshellarg($_POST['v_ns2']); + $v_ns3 = escapeshellarg($_POST['v_ns3']); + $v_ns4 = escapeshellarg($_POST['v_ns4']); + $ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2; + if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3; + if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4; + exec ($ns_cmd, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Set success message if (empty($_SESSION['error_msg'])) { - $data = json_decode(implode('', $output), true); - unset($output); - $v_password = "••••••••"; - $v_email = $data[$v_username]['CONTACT']; - $v_fname = $data[$v_username]['FNAME']; - $v_lname = $data[$v_username]['LNAME']; - $v_language = $data[$v_username]['LANGUAGE']; - $v_ns = $data[$v_username]['NS']; - $nameservers = explode(", ", $v_ns); - $v_ns1 = $nameservers[0]; - $v_ns2 = $nameservers[1]; - $v_ns3 = $nameservers[2]; - $v_ns4 = $nameservers[3]; - $v_suspended = $data[$v_username]['SUSPENDED']; - if ( $v_suspended == 'yes' ) { - $v_status = 'suspended'; - } else { - $v_status = 'active'; - } - $v_time = $data[$v_username]['TIME']; - $v_date = $data[$v_username]['DATE']; - - exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var); - $languages = json_decode(implode('', $output), true); - unset($output); - + $_SESSION['ok_msg'] = __('Changes has been saved.'); } - - // Action - if (!empty($_POST['save'])) { - // Change password - if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) { - $v_password = escapeshellarg($_POST['v_password']); - exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var); - check_return_code($return_var,$output); - $v_password = "••••••••"; - unset($output); - } - - // Change language - if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) { - $v_language = escapeshellarg($_POST['v_language']); - exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) $_SESSION['language'] = $_POST['v_language']; - unset($output); - } - - // Change contact email - if (($v_email != $_POST['v_email']) && (empty($_SESSION['error_msg']))) { - $v_email = escapeshellarg($_POST['v_email']); - exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Change NameServers - if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) { - $v_ns1 = escapeshellarg($_POST['v_ns1']); - $v_ns2 = escapeshellarg($_POST['v_ns2']); - $v_ns3 = escapeshellarg($_POST['v_ns3']); - $v_ns4 = escapeshellarg($_POST['v_ns4']); - $ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2; - if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3; - if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4; - exec ($ns_cmd, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - $_SESSION['ok_msg'] = __('Changes has been saved.'); - } - } - // Panel - top_panel($user,$TAB); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_user.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); } +// Panel +top_panel($user,$TAB); + +// Display body +if ($_SESSION['user'] == 'admin') { + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_user.html'); +} else { + include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_user.html'); +} + +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); + // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); From d0e3002288bc37af7ec6b4f4de37f445bec6d555 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:37:52 +0300 Subject: [PATCH 61/84] new icons --- web/images/db.png | Bin 0 -> 181 bytes web/images/edit.png | Bin 225 -> 222 bytes web/images/folder.png | Bin 0 -> 183 bytes web/images/login-as.png | Bin 2864 -> 233 bytes web/images/more.png | Bin 165 -> 176 bytes web/images/stats.png | Bin 0 -> 170 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/images/db.png create mode 100644 web/images/folder.png create mode 100644 web/images/stats.png diff --git a/web/images/db.png b/web/images/db.png new file mode 100644 index 0000000000000000000000000000000000000000..7317de69ee5bd11dc3ef436ffe93d9baa7d41301 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqoCO|{#S9GG!XV7ZFl&wkP*5S+ zBgmJ5p-Pp3p`n?9;R}#%xyZnf8_&S-B8P#&2B=XwqWL*{1yHTEr;B4q#jT{0va)#x z4;(0HXlzuR)Y#bA$tb!frHQL3X<|wO5F{lgBzQCzJxdNeaNy8^0|qbFGVn0WUdi=l TRzN#9&=>|!S3j3^P6QcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e z7jKeZ#YO-C0Axu-K~#9!e9Ey2gFpZU(C6VAwjq05C+;COVwnMKGlSTN;1;eBQoDc~ zq)`aRCBOQg_lp>#OnOupLk2I{am6h?w76r#1Fw)^bMyf#=8!>HCh&$59qKQ9Vme3o ehv(rZ!e;>DI}oWLu-<$T`Y!+g0AWc)K~xyiZO$zYgFp}l(8s0%$ua6$$qkTjJdROh9TM5z1c}5< z$Yz&Ole}+!8g&imqhFf>N4&A4gLH!*%n`Z*IsWmC4O_aw7bg7hO@T*DV8Uz7rUvptckPy+arh(OSQe$J|LC&tk2eQJE~|)z4*}Q$iB}r(ra# literal 0 HcmV?d00001 diff --git a/web/images/login-as.png b/web/images/login-as.png index 1d7e049c7f6642e67351c9cf84c45e0ee72c211a..06a5b712291ceceba6d85d47a2f9c2f261549831 100644 GIT binary patch delta 188 zcmV;t07L(<7U=06Lfe z02gnPU&TfM003`EL_t(|+FZ@S3Bo`CMA7HEhk!K%)Ec}75jG{*hgEp=WE-}ihd@$A zEF=fX!2~w>Ffi~LW|LBah#O95@x(9qbHN!q)Tm&VTT4PN-{_|PK`}Fb!GQZ}EuzE~ q2kh}hk5|M4MK(B2slrO+6ypFT!VSG-)pFAS0000f59&ghTmgWD z0l;*TI7e|ZE3OddDgXd@nX){&BsoQaTL>+22Uk}v9w^R9 z7b_GtVFF>AKrX_0nHe&HG!NkO%m4tOkrff(gY*4(&VLTB&dxTDwhmt{>c0m6B4T3W z{^ifBa6kY6;dFk{{wy!E8h|?nfNlPwCGG@hUJIag_lst-4?wj5py}FI^KkfnJUm6A zkh$5}<>chpO2k52Vaiv1{%68pz*qfj`F=e7_x0eu;v|7GU4cgg_~63K^h~83&yop* zV%+ABM}Pdc3;+Bb(;~!4V!2o<6ys46agIcqjPo+3B8fthDa9qy|77CdEc*jK-!%ZR zYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S1Au6Q;m>#f??3%Vpd|o+W=WE9003S@ zBra6Svp>fO002awfhw>;8}z{#EWidF!3EsG3xE7zHiSYX#KJ-lLJDMn9CBbOtb#%) zhRv`YDqt_vKpix|QD}yfa1JiQRk#j4a1Z)n2%fLC6RbVIkUx0b+_+BaR3c znT7Zv!AJxWizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifqlp|(=5QHQ7#Gr)$3XMd?XsE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*S zAPZv|vv@2aYYnT0b%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5c zP6_8IrP_yNQcbz0DW*G2J50yT%*~?B)|oY%Ju%lZ z=bPu7*PGwBU|M)uEVih&xMfMQuC{HqePL%}7iYJ{uEXw=y_0>qeSeMpJqHbk*$%56 zS{;6Kv~mM9! zg3B(KJ}#RZ#@)!hR=4N)wtYw9={>5&Kw=W)*2gz%*kgNq+ zEef_mrsz~!DAy_nvS(#iX1~pe$~l&+o-57m%(KedkbgIv@1Ote62cPUlD4IWOIIx& zSmwQ~YB{nzae3Pc;}r!fhE@iwJh+OsDs9zItL;~pu715HdQEGAUct(O!LkCy1 z<%NCg+}G`0PgpNm-?d@-hMgNe6^V+j6x$b<6@S<$+<4_1hi}TincS4LsjI}fWY1>O zX6feMEq|U{4wkBy=9dm`4cXeX4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC- zq*U}&`cyXV(%rRT*Z6MH?i+i&_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-N zmiuj8txj!m?Z*Ss1N{dh4z}01)YTo*JycSU)_*JOM-ImyzW$x>cP$Mz4ONYt#^NJz zM0w=t_X*$k9t}F$c8q(h;Rn+nb{%IOFKR-X@|s4QQ=0o*Vq3aT%s$c9>fU<%N829{ zoHRUHc}nwC$!Xf@g42^{^3RN&m7RTlF8SPG+oHC6=VQ*_Y7cMkx)5~X(nbG^=R3SR z&VO9;xODQe+vO8ixL2C5I$v$-bm~0*lhaSfyPUh4uDM)mx$b(swR>jw=^LIm&fWCA zdGQwi*43UlJ>9+YdT;l|_x0Zv-F|W>{m#p~*>@-It-MdXU-UrjLD@syht)q@{@mE_ z+<$7occAmp+(-8Yg@e!jk@b%cLj{kSkAKUC4TkHUI6gT!;y-fz>HMcd&t%Ugo)`Y2 z{>!cx7B7DI)$7;J(U{Spm-3gBzioV_{p!H$8L!*M!p0uH$#^p{Ui4P`?ZJ24cOCDe z-w#jZd?0@)|7iKK^;6KN`;!@ylm7$*nDhK&GcDTy000JJOGiWi{{a60|De66laV19 ze+P6)O+^RY1rrZ4JHH<&H~;_uVo5|nR0!9F%|Q(UK@ddIH@hfl1zZRM+6XETfdg(B zX$9+HN5G1J%Mb_&@Gq6rPpX+=Ds=M(Y577kqi3jhEBNkvXXu0mjfxzJZa diff --git a/web/images/more.png b/web/images/more.png index a2d6aa7c91fa1a0eeb589b3d6d54f4c016ca2f71..ce30922674e008540b835e17cfeb4a53a921cdca 100644 GIT binary patch delta 129 zcmZ3=xPftk%0y?;a)o4%AYTTCDpdxChGqtapZ|gMO9qBg0|tgy2@DKYGZ+}e^C!h0 zbz@*)F!OYA45_%4R8m%U?@WVqO=@C7!iS@a8yZ_18ymN&83d#>=`#btGZx^prw85kJYlDyqr82*Fcg1yTpPgIofWiRpcb!ET9BE)W{ zn{P5@DNvQFr;B5V#O36agoKQw1uO=S3>Nk!2?vO17zA+5l8}&KxsYMOz_7lG`TSW4 RV>zG(22WQ%mvv4FO#p(tBoY7s diff --git a/web/images/stats.png b/web/images/stats.png new file mode 100644 index 0000000000000000000000000000000000000000..c464fe6e4b68ba4d73cb5d309a505bdfbedebe76 GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqoCO|{#S9GG!XV7ZFl&wkP*5S+ zBgmJ5p-Pp3p`n?9;R}#%xyZnf8_&S-B8P#&2B=XwqWL*{1yHSlr;B4q#jT{0va&P> zrr8U(==(HuHZmj}RNg*QLwLplE%V304i{KXi2&6y{Qu9)@HL3}%Zp>1?t%E8u6{1- HoD!M Date: Wed, 30 Jul 2014 15:38:07 +0300 Subject: [PATCH 62/84] compact logo --- web/images/logo.png | Bin 5014 -> 2407 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/web/images/logo.png b/web/images/logo.png index 19acb5a434eb45303ede3cb50d287a499a734b54..9a902492d51f5e1603652e24b67852bc08d7a353 100644 GIT binary patch literal 2407 zcmV-t37GbYP)F00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru-Uka59v-xyh5i5l2=qxr zK~#9!?VDj}9LE*Me;XMWgFwBM1Q!<@U#1vbC@vRLYFtw8PUT91OCWNKO+t)=M4={S zLu&<_m;{T;H5y`EYAj-68X|BcVq#)?)VhPvQd5(oCIy4(R3-vbgF#2YU=WDuhkIL( zSG#+=x>MT^`{2-NXLe?H-h2P|e{bd>mt1nmC6`=s$)(TY^Y00e6|Qoo(EQ> z?a%qr_nBZ=t^OiV2e9P%=4*0&7Q?d4UBJh{ zX5g6Tn~7WxBN;7uc z9FxEid8eoA&Bnr-mF4;7l-26Cz}Ho$Da_~j`2&Dg8v5E+%f1$pL^ znUrOSUjs&DgR|RIXDC@8&X$UxGwb}*Tlk0~h*}b$zLh}Uhj<868CE!b^eL&*gDrME1 zjaIE(S#Th&8ljA8=$_dg$X6?D4E1JX3>fQ`)rnD6V<0xYvZM@j&}y|wg6B?QcDp^_ zobB;B2OLEqkT?U}lzA3Im5(Uz8cm2>)h-a2MM~XZsRyYhK=^p7q}Xb;*J{WY z5mXvB2@&Wmsq@VpVTOoDUGjW$ANUUNI-Mf$Qj)dD#HM~JYaxMw_EX{rQc+TdWMx^c z2E_%-z+0l6J5JxeY;$YdfR?jy9-xn5m%k#}#Kc3QRH30m^YW1QRL&Zt31Gf2k%wo1{ z#H*eq!l+tegl=v)o#@T5ayb^X`)J)F7QI{{9eQX{E@wqO7nK=YbK>b~W_*X8=DEqsD~sxgIvU z4)LljY_XNbvmOgUl=gh%0SACZ*}s~Sdfp4b&-?JOx1E$As5u^!Ie(mjZOw7ZM6>`6?mE#V9_z|5A%JaaC z)#|9E1y3Z^2c5hooJ@xEqojB>EpfvAj78A&^-|a>qmsE6x_MVPW+?|w1|@zRkgCQ_ zhspI4vtE=^)&b8qUs|nRkn$El*=lt&*m~(gG)5fwD}?f+q=INtq8gRk4GUBj9EG*l zlEaC|#2J;FmPD4G!uwf^AqKc8<(~Nw)UW?qq5NFc(_}<5|KD}O;|(BY9yss zWtJEZo9u&EErh(e6)rs`dY0##2Ue>e(%Cd@2}BJ5zn6*zboQ}cO{tt667x1m@po4Q zA-E#N;hKDJrWkrY6l=Pbn0i)Nty~FMVvrAwtiijgp`6Ng={uX`S$Mv=37iIg0{lT} zwOb1u%J6V!=p0cii#J_#Jn6dC>N(&~Qq|bz`Q~|HrD?2vA*OAXb&v?wR?G;21(FNU zT@&ZH{j4dmbb$ASp`DS1J}cY(dw};n-<(dE@DU|@zL~RHeM6LY8Tc0u58#}jb8aK8 zxES9z2n?85OrF+D>8YCHS=}6LRq1I%%0<2u2D27gyTIdG6g2{TDBn-kn~m|15~~TNsVtt-sy7?M5%X6=P+N4# zQk=5h7Wmr;T((+$EVTyhf7^_2OPC8jhBTNDKhCqP_qSZ6xrTXa%=E(qtJSYV4CR{wgUQ(S zTD`=>-QeS%Z#22|MK)yYf5Z8{A~7mBKQU^xG7`TYmutTiSj?pllIe#Da=h#pz*#BA z-jAp)x^ABTQlyX4(~s%oJmE*e7K3BcOLPjq1Hc702g~LEK&)0ujs@hBOD?(Ol1nbR Z@Ndx!Xeh;$CPx4O002ovPDHLkV1mcBl=A=p literal 5014 zcmV;H6KU*;P)R5e300009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000QVNkl^<{}vT$HAkmP&(? zQ0by5HWfus6cdX|p|m8lSS*S*Wd(6j>}%QLq9A<`D9Q$FioplLN*={vpb)Zu%y;m5 zd*|ny*Ra2aS(`CDKc@QyV&p3Nb-HUMuE$QOV)0XT2?;z|8hfjgz~-x?Zw0rlZaRUNtnoMf;aD5N3dr)^pC~a9kT2 zzRU2%D}h1aAHdhz`b5q?6Nn!Gn{@qd;CA`ymvwBLH2)Cr2=EXvrE(jvS1#c+a3t#G zc09V(bSaetZ7*p6Pv7Vue|oB%NW(9NoO?;+?HS;6fxq53-y&1p6JWkS0-hAhzXTlC z;Mu1A4KdztSk~vP!)mysRc`4d@V$Wd2f!S#6k|K?sB>6#n%A9_f|znV<}=J~IH2AB z`H?J5`aWqO0_A9k-|cmD`UL@No9|BG8{k*qN4big05TY*spfun#P$6G$bLrAIv!Pr zdH-2;ddcx_V>;jJxHpM4ash7cx7GuAvts8pB4U36?gsuS0E@cjjCJ3P%>7ZB*Jow+ zKLnnT&mREx15X(McK|N{CsO$JN(dNnIxme$pD;B0c#J_-G!$VX#q-LJ`dVWQida6p z1^7aMBR~3tn0TLFxFF!~*M6Tm{*c120Y|+@ET25*h}mBe`|mV3L7dJQPGA*E0pQ`V zR^^Dg1}(5_z^LvkS*EtAV_O{cELrX8O`-9nID=_Lz-U}+ly?G83y5coP^?S7_C;+; z<%kGjhnW2_4HmzXdVtprf_E_l@LEihX=_HA`o#9FTZ}p@dap5SKx85PF$X~`z-I(N zvlVJZ5xAr>tC+n9xJ5pEgWN=$tW2A(eON9fOw0SN#+PGsO1*%$TCT;eZ(JaE>wG1H zerpY|V%^%Nllt(geD9(Fe#JwtC*NF;T#`HZr^2>>tGwC(8*zz30zY1gsTt)A z2XHOK-;ZYatWrYFk44({OZ)#I;&cl5uSV9bz&#pG=QC))21ogv<>N0BKHWMIqf>0n zn9fM!NWte zX!nFQpvION@WdK^mty1ZfS*)uwitXz#tqnqH|bIlkvpX0lfe7(_3MC}6NWCOh|!;g zc8@zcypf>W1Gy5@x&;Eh+lYSFBLTBr+mM*@Vgnko2KYf4sUKunx)S=Qazr-F){LkS$xf5{ z+xM2Q-s{lxMuG0KQssI8-)|7HdBw(y(&|kjZU-$hpM~r)Sb4j$a7nXnHLLL^Ny{=E z>vnYf&{YDx-_hPm4E_=b_$*!;)o0;;>hv()tX8|g*_3fZY|FAJ4cn@Y98yR~LM<-^ zXhuDN2eJD`gC0gYV{5sKr5B`OXYppjIvpB)OU8h|#g!8@1rfE=DlgOlcz=i`2$Ei) z$+6uQ;tm=KdKl@9;xD0q@4{P+(y1iK%QE%8T;|G2lX~T%EX$wqCTJ!#;NDSK_({xq zY~NgJKz1!kfX0y{fYdZ{fs29Y1fq z!)0x0053Km9E%IO4MHg+?e2C&4^d%gAmHak+J^8J9{OZyr=ev9#mPzKDZGyqe$jp* zAj3BgJcc&~TUDGspAzt}j9jB-)B#l1*|kLX1g&YCl6id-ZyD1GhZ%24_yPsh=M%s; z<+o?V7Z5>vNLpWz85~c^qKgR!Ln9=s>Cm)*x7zOzw#3QLp%>+6D|o9{d=2#1puY#a z!EXy4gQVF}Zjm*467NHX0X=t}k}n5Im&z@t(EcJv1Amd(y&wkvu5rE-_vb@B^3O9Oe}je&$%8R8@IKfUmZ$_a|EV)Yy*%-j@c5d!)(jI&Y_G zFX2s?>@dQ$H0#wT0y-m!iR};3(29c#_=_3G1^%Gp`Dr4A{)B+1*6IZn20QCfbC`j%9cuL5Bk z6_B-v_vnp?4r(Dpua+>R3~guJZ_DgO3RU@Af2C>FxNfs?-2sJpkINP8S*DOEN;60p z4OFcACJYzQZ9H!}CP=-8HL|bYVrcAm%y!p;Tu;;Q{?sS@A0T!s7N5fVKI|oF@d9w4 zD(?`pZUg=$^R`m{eufMdLFWGekzCUL1H=J^P}?=)eBXStNS6QI*{uBgh#0#0A!2Xd z{mUz9zYm{s_~tR-QG@W@i?_Vk%+Bp1-p2*GG)U6^$ICtgxJhaM8ta<%4iny-clq@R z_?#Ge6W+3?szY=APk<*?_Oo-jT!$vzC3_SzuM=VWSjX>{FRzl_(&k)JN>l#Vo4HBP gB?mm08%6#%0ARIQq4zv3*8l(j07*qoM6N<$g3+{p(*OVf From 9b7948b4871b6cbe6f251e59d63d9ace9ba63fff Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:38:32 +0300 Subject: [PATCH 63/84] background for suspended objects --- web/images/disabled_bg.png | Bin 0 -> 194 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/images/disabled_bg.png diff --git a/web/images/disabled_bg.png b/web/images/disabled_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..2eff4f4299b7d151a615c0809000cfecad6319dd GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^tRT$61|)m))t&+=#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPqyAYoVixg*{JWxoo#5JPCIX^cy zHLrxhxhOTUBsE2$JhLQ2!QIn0AiR-J9H>av)5S4_<9c$61FH-V50BIfCN?0IbA;O< a0cgHu8>3QPnzas4A%mx@pUXO@geCxDaxDb_ literal 0 HcmV?d00001 From 2a02e5629cddbfacc2a2d0a2e48a516f058ae573 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:38:47 +0300 Subject: [PATCH 64/84] pause icon --- web/images/pause.png | Bin 0 -> 157 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/images/pause.png diff --git a/web/images/pause.png b/web/images/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..4120a61cb814eb14872bd2fb782d68a2c9663961 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJx0U~c5>$3n-jKx9jP7LeL$-D%~CV9KNF#HF> z1$&oI28wVNctjR6FmMZlFeAgPITAoY_7YEDSN41C{5%>AQBQozfkLvLE{-7_*OOBc r5>_NOG>B=$9zFmBM;e%U{5Top)ERryd75Sb6*73b`njxgN@xNAC}Sw6 literal 0 HcmV?d00001 From d160b441c7f99e9437273f5302024597412cc2db Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:41:06 +0300 Subject: [PATCH 65/84] file manager api commands --- bin/v-copy-fs-file | 58 +++++++++++++++++++++++++++++++++++++++++ bin/v-list-fs-directory | 39 +++++++++++++++++++++++++++ bin/v-open-fs-file | 36 +++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100755 bin/v-copy-fs-file create mode 100755 bin/v-list-fs-directory create mode 100755 bin/v-open-fs-file diff --git a/bin/v-copy-fs-file b/bin/v-copy-fs-file new file mode 100755 index 000000000..a3004654b --- /dev/null +++ b/bin/v-copy-fs-file @@ -0,0 +1,58 @@ +#!/bin/bash +# File copier + +user=$1 +file_src=$2 +file_dst=$3 + +# Checking arguments +if [ -z "$file_dst" ]; then + echo "Usage: USER SRC_FILE DST_FILE" + exit 1 +fi + +# Checking users +if [ ! -e "$VESTA/data/users/$user" ]; then + exit 1 +fi + +# Checking homedir +homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :) +if [ -z $homedir ]; then + exit 1 +fi + +# Checking source file +if [ ! -e "$file_src" ]; then + exit 1 +fi + +# Checking source path +rpath=$(readlink -f "$file_src") +if [ -z "$(echo $rpath |grep ^/tmp)" ]; then + exit 1 +fi + +# Checking destination path +rpath=$(readlink -f "$file_dst") +if [ -z "$(echo $rpath |grep ^$homedir)" ]; then + exit 1 +fi + +# Checking dst file permission +if [ -e "$file_dst" ]; then + perms=$(stat --format '%a' $file_dst) +fi + +# Copying file +cp $file_src $file_dst + +# Changing ownership +chown $user:$user $file_dst + +# Changin permissions +if [ ! -z "$perms" ]; then + chmod $perms $file_dst +fi + +exit diff --git a/bin/v-list-fs-directory b/bin/v-list-fs-directory new file mode 100755 index 000000000..a06b4168d --- /dev/null +++ b/bin/v-list-fs-directory @@ -0,0 +1,39 @@ +#!/bin/bash +# File list wrapper + +user=$1 +path=$2 + +# Checking arguments +if [ -z "$user" ]; then + echo "Usage: USER [PATH]" + exit 1 +fi + +# Checking users +if [ ! -e "$VESTA/data/users/$user" ]; then + exit 1 +fi + +# Checking homedir +homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :) +if [ -z $homedir ]; then + exit 1 +fi + +# Checking path +if [ ! -z "$path" ]; then + # Validating absolute path + rpath=$(readlink -f "$path") + if [ -z "$(echo $rpath |grep $homedir)" ]; then + exit 1 + fi +else + path=$homedir +fi + +# Listing files +find "$path" -maxdepth 1 -printf "%y/%m/%TY-%Tm-%Td/%TH:%TM:%TS/%u/%g/%s/%P\n" + + +exit diff --git a/bin/v-open-fs-file b/bin/v-open-fs-file new file mode 100755 index 000000000..d5c8ea3a6 --- /dev/null +++ b/bin/v-open-fs-file @@ -0,0 +1,36 @@ +#!/bin/bash +# File reader + +user=$1 +path=$2 + +# Checking arguments +if [ -z "$path" ]; then + echo "Usage: USER PATH" + exit 1 +fi + +# Checking users +if [ ! -e "$VESTA/data/users/$user" ]; then + exit 1 +fi + +# Checking homedir +homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :) +if [ -z $homedir ]; then + exit 1 +fi + +# Checking path +if [ ! -z "$path" ]; then + # Validating absolute path + rpath=$(readlink -f "$path") + if [ -z "$(echo $rpath |grep $homedir)" ]; then + exit 1 + fi +fi + +cat "$path" + +exit + From a34da7e2432b8477348995e16d117ba99739bc41 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:41:21 +0300 Subject: [PATCH 66/84] new icon for webmail --- web/images/mail.png | Bin 0 -> 236 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/images/mail.png diff --git a/web/images/mail.png b/web/images/mail.png new file mode 100644 index 0000000000000000000000000000000000000000..1281299b94a8d479d84a346d2b84b43086d3088b GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRM!3HF?&tBaM5-9M9EM{Qf76xHPhFNnYfPxCi z9znhg3{|QO3=Pc;3}1kB%S8r;+;|3t7dZ?JHr)&i(h<$i*(-o*i#%N%Ln>~yTrlK1 zmdKI;Vst06V%(?f?J) literal 0 HcmV?d00001 From 0797ddfddb1ec695f69c074a666a2b0fcb704c88 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:44:06 +0300 Subject: [PATCH 67/84] Improved css style --- web/css/jquery-custom-dialogs.css | 12 +- web/css/main.css | 411 ++++++++++++++++++++++++------ 2 files changed, 337 insertions(+), 86 deletions(-) diff --git a/web/css/jquery-custom-dialogs.css b/web/css/jquery-custom-dialogs.css index f1a4fa752..f0cb265ab 100644 --- a/web/css/jquery-custom-dialogs.css +++ b/web/css/jquery-custom-dialogs.css @@ -35,7 +35,7 @@ ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #e6e6e6;} +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #999;} /*! @@ -58,7 +58,7 @@ .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 { background: #505050; color: #444; font-size: 10pt; font-weight: bold;} +.ui-widget-header { background: #777; color: #444; font-size: 10pt; font-weight: bold;} .ui-widget-header a { color: #222222; } /* Interaction Cues @@ -75,14 +75,14 @@ /* Icons ----------------------------------*/ -/* states and images */ +/* 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; } @@ -376,8 +376,8 @@ * 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 { filter:chroma(color=#000000); cursor: pointer; color: #555; background-color: #ececec; border: 1px solid #e0e0e0; border-radius: 3px 3px 3px 3px; font-weight: bold; font-size: 14px; padding: 2px 16px; width: 108px; height: 34px; } -.ui-button:hover { border: 1px solid #f79b44; background-color: #f79b44; color: #fff;} +.ui-button { filter:chroma(color=#000000); cursor: pointer; color: #fff; background-color: #f79b44; border: 1px solid #f79b44; border-radius: 3px 3px 3px 3px; font-weight: bold; font-size: 14px; padding: 2px 16px; width: 108px; height: 34px; } +.ui-button:hover { border: 1px solid #9e9e9e; background-color: #9e9e9e; color: #fff;} .ui-button:active { background-color: #ccc; color: #fff; border: 1px solid #ccc; } .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 */ diff --git a/web/css/main.css b/web/css/main.css index b2a114e83..4e2c6ecfb 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1,6 +1,6 @@ body { font-family: Arial, Helvetica, sans-serif; - background-color: #e1e8e8; + background-color: #75b0c5; margin: 0; padding: 0; border: 0; @@ -19,6 +19,9 @@ td { padding: 0; } +label { + cursor: pointer; +} .hidden { display: none; @@ -26,13 +29,33 @@ td { .top { width: 1000px; - position: fixed; background: #fff; - border-bottom: 1px solid #e1e8e8; } +.top.small .submenu{ + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10); +} + + +.top .nav-logo .logo-container{ + background-color: #fff; + width: 167px; +} + +.top.small-logo .nav-logo .logo-container{ + position: fixed; +} +.top.small-logo .nav-logo img{ + margin: 29px 0 -4px 10px; + padding: 0 0 10px; +} + + .top-menu { height: 24px; background-color: #505050; + width: 1000px; + position: fixed; + z-index: 10; } .top-link { @@ -51,9 +74,9 @@ td { background-color: #f79b44; } -.top-link:active{ +.top-link:active { color: #333; - background-color: #f1f1f1; + background-color: #eee; } .top-selected-link { @@ -65,7 +88,7 @@ td { line-height: 22px; padding: 0 20px 2px; color: #333; - background-color: #f0f0f0; + background-color: #eee; } .top-selected-link:hover { @@ -75,7 +98,7 @@ td { .top-selected-link:active { color: #2361a1; - background-color: #f1f1f1; + background-color: #eee; } .top-user { @@ -93,7 +116,7 @@ td { color: #fff; } -.top-user:active{ +.top-user:active { color: #fff; background-color: #f79b44; } @@ -120,12 +143,21 @@ td { background-color: #999; } +.main-menu{ + display: block; + float: left; + margin-bottom: 1px; +} + .nav-logo { float: left; - height: 111px; + height: 139px; width: 167px; - margin: 0; - border-bottom: 1px solid #e1e8e8; + margin: 0 0 0px; +} + +.nav-logo img{ + margin: 56px 0 0 10px; } .nav-lnk { @@ -145,59 +177,96 @@ td { width: 119px; float:left; cursor: pointer; - border-bottom: 1px solid #e1e8e8; + padding-bottom: 2px; } .nav-block:hover { height:108px; - border-bottom: 4px solid #f79b44; + padding-bottom: 0; } .nav-selected-block { + padding-bottom: 0; font-family: Arial, Helvetica, sans-serif; margin: 0; - color: #2361a1; + color: #4a82be; height: 108px; width: 119px; float: left; - border-bottom: 4px solid #777777; cursor: pointer; } .nav-selected-block:hover { height:108px; - border-bottom: 4px solid #f79b44; } .nav-selected-block:active { color: #f79b44; } -.nav-header { - padding: 14px 0 0 6px; - margin: 0; - letter-spacing: -1.0px; - font-size: 16pt; - font-weight: bold; +.top .nav-block .marker, +.top .nav-selected-block .marker { + -webkit-transition: background .1s ease-in-out; + -moz-transition: background .1s ease-in-out; + -o-transition: background .1s ease-in-out; + transition: background .1s ease-in-out; + padding: 0; + height: 4px; + margin: 12px 0 0 0; + width: 100%; + background-color: #fff; } -.nav-selected-header { - padding: 14px 0 0 6px; - margin: 0; - letter-spacing: -1.0px; +.top .nav-selected-block .marker { + background-color: #777; + border-bottom: 1px solid #777; +} + +.top.small .marker{ + position: fixed; + top: 66px; + width: 119px; +} + +.nav-block:hover .marker{ + background-color: #f79b44; + border-bottom: 1px solid #f79b44; +} + +.nav-selected-block:hover .marker{ + background-color: #f79b44; + border-bottom: 1px solid #f79b44; +} + +.nav-header, .nav-selected-header { + background-color: #FFF; font-size: 16pt; font-weight: bold; + height: 27px; + letter-spacing: -1px; + margin: 0; + padding: 16px 0 0 6px; + position: fixed; + top: 24px; + width: 113px; + z-index: 10; +} + +.top.small .nav-header, .top.small .nav-selected-header{ + height: 38px; } .nav-counters { padding: 1px 0 0 6px; - margin: 0; + margin: 65px 0 0 0; height: 58px; line-height: 1.4em; font-size: 9pt; font-family: Arial, Helvetica, sans-serif; color: #333; decoration: none; + overflow: hidden; + opacity: 0.8; } .submenu { @@ -205,6 +274,19 @@ td { vertical-align: middle; float: left; width: 1000px; + border-bottom: 1px solid #e1e8e8; + border-top: 1px solid #e1e8e8; + background-color: #fff; + margin-bottom: -1px; +} + +.top.small .submenu{ + position: fixed; + top: 82px; +} + +.submenu .wrapper{ + padding: 11px 10px 14px 10px; } .submenu-button-block { @@ -226,7 +308,7 @@ td { } .submenu-button-select { - width: 20px; + width: 28px; height: 28px; cursor: pointer; color: #555; @@ -273,16 +355,26 @@ td { } .submenu-button-main:hover { - border: 1px solid #999; - background-color: #999; + border: 1px solid #aaa; + background-color: #adaeae; + + -webkit-transition: background .1s ease-in-out; + -moz-transition: background .1s ease-in-out; + -o-transition: background .1s ease-in-out; + transition: background .1s ease-in-out; } .submenu-button-select:hover { - border: 1px solid #f79b44; + border: 1px solid #adaeae; + background-color: #adaeae; + color: #fff; } .submenu-button-search:hover { - border: 1px solid #f79b44; + border: 1px solid #adaeae; + background-color: #adaeae; + color: #fff; + } .submenu-button-main:active { @@ -308,7 +400,7 @@ td { } .submenu-select-link { - color: #6A6A6A; + color: #6a6a6a; display: block; float: left; font-size: 8pt; @@ -331,21 +423,34 @@ td { .submenu-select-dropdown { font-family:Arial, Helvetica, sans-serif; font-size: 9pt; - color: #333333; + color: #333; display: block; float: left; height: 28px; margin: 0 4px 0 0; min-width: 138px; - background-color: #FFFFFF; - border: 1px solid #CCCCCC; + background-color: #fff; + border: 1px solid #ccc; border-radius: 3px 3px 3px 3px; padding: 4px 5px; } + +.submenu-select-dropdown:hover { + border: 1px solid #909090; +} + +.submenu-select-dropdown:focus { + border: 1px solid #f79b44; + background-color: #fffcd2; + color: #333; +} + + .submenu-select-dropdown option { padding: 5px 5px 5px 8px; } + .submenu-search-block { display: block; text-align: right; @@ -366,11 +471,13 @@ td { } .submenu-search-field:hover { - border: 1px solid #f79b44; + border: 1px solid #909090; } .submenu-search-field:focus { border: 1px solid #f79b44; + background-color: #FFFCD2; + color: #333; } .bottom { @@ -404,11 +511,11 @@ td { } .vst { - padding: 4px 4px 0 4px; + padding: 5px 7px 0 7px; margin: 0; text-decoration: none; color: #999; - font-size: 12pt; + font-size: 11pt; float: left; } @@ -422,11 +529,11 @@ td { } .vst-selected { - padding: 4px 4px 0 4px; + padding: 5px 7px 0 7px; margin: 0; text-decoration: none; color: #2361a1; - font-size: 12pt; + font-size: 11pt; float: left; } @@ -449,21 +556,18 @@ td { font-size: 12pt; text-align: left; vertical-align:top; - margin: 0; + margin: 1px 0 0 0; behavior:url("/css/csshover3.htc"); + background-color: #fff } .data a { text-decoration: none; } -.data-row:hover { - margin: 0; - background-color: #f0f0f0; -} -.data-row:active { - background-color: #f7f7d8; +.data-row.selected, .data-row.selected.suspended{ + background-color: #e4e9e9; } .datarowhover { @@ -530,7 +634,7 @@ td { .data-date { letter-spacing: 0.3em; font-size: 8pt; - color: #6A6A6A + color: #6a6a6a } .data-active { @@ -550,26 +654,36 @@ td { height: 16px; border-left: 1px solid #d3d3d3; font-size: 8pt; - padding: 2px 12px 1px 6px; + padding: 6px 11px 2px; letter-spacing: 0.1em; - color: #2361a1; + color: #3e7c91; text-decoration: none; cursor: pointer; } +.data-controls.edit{ + font-weight: bold; + letter-spacing: 0; +} + .data-controls:hover { color: #fff; background-color: #f79b44; } .data-controls:active { - background-color: #999 + background-color: #999; } + .data-controls img { border: 0px; } +.ch-toggle { + cursor: pointer; +} + .data-count { font-family: Arial, Helvetica, sans-serif; color: #505050; @@ -599,6 +713,14 @@ td { padding: 1px 0 2px 0; } +.suspended .domain { + color: #777; +} + +.domain.hostname { + font-size: 16pt; +} + .cron { color: #222; font-size: 18px; @@ -675,17 +797,17 @@ td { .vst-ok { font-size: 12pt; - color: #62a358; + color: #33691e; padding: 4px; } -.vst-ok a{ - color: #58934f; - text-decoration: none; +.vst-ok a { + color: #33691e; } -.vst-ok a:hover{ - text-decoration: underline; +.vst-ok a:hover { + background: #f79b44; + color: #fff; } .vst-error { @@ -713,11 +835,13 @@ td { } .vst-textinput:hover { - border: 1px solid #f79b44; + border: 1px solid #909090; } .vst-textinput:focus { border: 1px solid #f79b44; + background-color: #fffcd2; + color: #333; } .vst-textinput:disabled { @@ -737,17 +861,23 @@ td { } .vst-input:hover { - border: 1px solid #f79b44; + border: 1px solid #909090; } .vst-input:focus { border: 1px solid #f79b44; + background-color: #fffcd2; + color: #333; } .vst-input:disabled { background-color: #f1f1f1; } +.vst-input.long{ + width: 580px; +} + .vst-list { font-family:Arial, Helvetica, sans-serif; font-size: 12pt; @@ -767,7 +897,7 @@ td { padding: 5px; font-size: 12pt; border: 1px solid #f7f6ed; - margin: 2px 6px 0 0; + margin: 2px 6px 0 3px; } .vst-checkbox:hover { @@ -775,23 +905,23 @@ td { } .button { - filter:chroma(color=#000000); + filter:chroma(color=#000); cursor: pointer; border-radius: 3px 3px 3px 3px; - font-size: 14px; + font-size: 13px; font-weight: bold; - padding: 2px 16px; + padding: 1px 16px 3px 16px; width: 108px; height: 34px; - color: #555; - background-color: #fff; - border: 1px solid #ccc; + color: #fafafa; + border: 1px solid #f79b44; + background-color: #f79b44; } .button:hover { color: #fff; - border: 1px solid #f79b44; - background-color: #f79b44; + border: 1px solid #999; + background-color: #999; } .button:active { @@ -800,7 +930,7 @@ td { } .login-button { - filter:chroma(color=#000000); + filter:chroma(color=#000); cursor: pointer; border-radius: 3px 3px 3px 3px; font-size: 14px; @@ -809,14 +939,13 @@ td { width: 108px; height: 34px; color: #fff; - background-color: #999; - border: 1px solid #999; + background-color: #f79b44; + border: 1px solid #f79b44; } .login-button:hover { - color: #fff; - border: 1px solid #f79b44; - background-color: #f79b44; + border: 1px solid #adaeae; + background-color: #adaeae; } .login-button:active { @@ -864,7 +993,7 @@ td { background-color: #777; } -.fixed{ +.fixed { position: fixed; border: none; top: -3px; @@ -872,7 +1001,7 @@ td { background-color: #fff; } -*html .fixed{ +*html .fixed { position:absolute; position:fixed; _position:absolute; @@ -880,7 +1009,7 @@ td { _top:expression( eval(document.body.scrollTop) + 'px' ); } -#vstobjects{ +#vstobjects { padding-top: 193px; min-height: 372px; } @@ -911,7 +1040,7 @@ td { padding: 0 26px 0 0; } -.vestacp{ +.vestacp { font-size: 8pt; color: #505050; text-align: right; @@ -919,10 +1048,132 @@ td { .error { font-size: 10pt; - color: #dE6c5d; + color: #de6c5d; } .hint { font-size: 14pt; color: #7fa1cb; } + +.step-top { + padding-top: 42px; +} + +.step-bottom { + padding-bottom: 20px; +} + +.step-left { + padding-left: 50px; +} + +.input-label { + padding-top: 20px; +} + +.additional-control { + margin-left: 20px; + color: #2361a1; + border-bottom: 1px solid #f79b44; + font-size: 10pt; + letter-spacing: 0.1em; + cursor: pointer; +} + +.additional-control:hover { + color: #7fa1cb; +} + +.additional-control:active { + color: #fff; + background-color: #f79b44; +} + +.ftp-path-prefix { + color: #848483; + font-size: 13px; +} + +.ftp-path-value { + color: #333; + font-size: 13px; + font-weight: bold; +} + +.data .suspended { + background: url(/images/disabled_bg.png); +} + +.timer-container .refresh-timer { + border: 2px solid #c0d4a6; + border-radius: 14px; + height: 14px; + width: 14px; + margin: 10px; + float: left; + margin: 7px 10px 0 0; +} + +.timer-container .refresh-timer.paused{ + border: 2px solid #9f9f9f; +} + +.timer-container .refresh-timer.paused .loader-half.right, +.timer-container .refresh-timer.paused .loader-half.dark{ + background-color: #9F9F9F; +} + +.timer-container .loader-half { + border-radius: 0 14px 14px 0; + height: 14px; + width: 7px; + float: left; +} + +.timer-container .loader-half.left { + border-radius: 14px 0 0 14px; + background-color: #fff; +} + +.timer-container .loader-half.right { + margin-left: 7px; + background-color: #c0d4a6; +} + +.timer-container .loader-half.dark{ + background-color: #c0d4a6; +} + +.timer-container .movement{ + float: left; + width: 14px; + height: 14px; + position: absolute; +} + +.timer-container .movement.left { + z-index: 10; +} + +.timer-container .movement.right{ + transform: rotate(180deg); + -webkit-transform: rotate(180deg); +} + +.timer-container .timer-button{ + cursor: pointer; + text-decotation: underline; + margin: 11px 0 0 38px; + width: 15px; + float: left; + height: 10px; +} + +.timer-container .timer-button.pause{ + background: url(/images/pause.png) no-repeat ; +} + +.timer-container .timer-button.play{ + background: url(/images/start.png) no-repeat; +} From 393d97fdfc49ce7d7eb350c7ac7de6bfecf9ccdc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:48:20 +0300 Subject: [PATCH 68/84] Multiple FTP Account Support --- web/js/pages/add.web.js | 157 ++++++++++++++++++++++++++++++++++----- web/js/pages/edit.web.js | 131 +++++++++++++++++++++++++++++--- web/js/templates.js | 6 +- 3 files changed, 262 insertions(+), 32 deletions(-) diff --git a/web/js/pages/add.web.js b/web/js/pages/add.web.js index 8b06b14a0..d350a4375 100644 --- a/web/js/pages/add.web.js +++ b/web/js/pages/add.web.js @@ -1,37 +1,158 @@ -// -// -// Updates ftp username dynamically, showing its prefix App.Actions.WEB.update_ftp_username_hint = function(elm, hint) { if (hint.trim() == '') { $(elm).parent().find('.hint').html(''); - } - // remove prefix from value in order to eliminate duplicates + } + + hint = hint.replace(/[^\w\d]/gi, ''); + if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) { hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length); } - + $(elm).parent().find('.v-ftp-user').val(hint); $(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint); } -// -// listener that triggers ftp user hint updating App.Listeners.WEB.keypress_ftp_username = function() { - var ref = $('input[name="v_ftp_user"]'); - var current_val = ref.val(); - if (current_val.trim() != '') { - App.Actions.DB.update_ftp_username_hint(ref, current_val); - } - - ref.bind('keypress input', function(evt) { + var ftp_user_inputs = $('.v-ftp-user'); + $.each(ftp_user_inputs, function(i, ref) { + var ref = $(ref); + var current_val = ref.val(); + if (current_val.trim() != '') { + App.Actions.WEB.update_ftp_username_hint(ref, current_val); + } + + ref.bind('keypress', function(evt) { + clearTimeout(window.frp_usr_tmt); + window.frp_usr_tmt = setTimeout(function() { + var elm = $(evt.target); + App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val()); + }, 100); + }); + }); +} + +App.Listeners.WEB.keypress_domain_name = function() { + $('#v_domain').bind('keypress', function(evt) { clearTimeout(window.frp_usr_tmt); window.frp_usr_tmt = setTimeout(function() { - var elm = $(evt.target); - App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val()); + //var elm = $(evt.target); + //App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val()); + var domain = $('.ftp-path-prefix').text(GLOBAL.FTP_USER_PREPATH + '/' + $('#v_domain').val()); }, 100); }); } +// +// + +App.Actions.WEB.update_ftp_path_hint = function(elm, hint) { + if (hint.trim() == '') { + $(elm).parent().find('.v-ftp-path-hint').html(''); + } + + if (hint[0] != '/') { + hint = '/' + hint; + } + hint = hint.replace(/\/(\/+)/g, '/'); + + $(elm).parent().find('.v-ftp-path-hint').text(hint); +} + +App.Listeners.WEB.keypress_ftp_path = function() { + var ftp_path_inputs = $('.v-ftp-path'); + $.each(ftp_path_inputs, function(i, ref) { + var ref = $(ref); + var current_val = ref.val(); + if (current_val.trim() != '') { + App.Actions.WEB.update_ftp_path_hint(ref, current_val); + } + + ref.bind('keypress', function(evt) { + clearTimeout(window.frp_usr_tmt); + window.frp_usr_tmt = setTimeout(function() { + var elm = $(evt.target); + App.Actions.WEB.update_ftp_path_hint(elm, $(elm).val()); + }, 100); + }); + }); +} + +// +// +App.Actions.WEB.add_ftp_user_form = function() { + var ref = $('#templates').find('.ftptable').clone(true); + var index = $('.data-col2 .ftptable').length + 1; + + ref.find('input').each(function(i, elm) { + var attr_value = $(elm).attr('name').replace('%INDEX%', index); + $(elm).attr('name', attr_value); + }); + + ref.find('.ftp-user-number').text(index); + + $('.data-col2 .ftptable:last').after(ref); + + var index = 1; + $('.data-col2 .ftp-user-number:visible').each(function(i, o) { + $(o).text(index); + index += 1; + }); +} + +App.Actions.WEB.remove_ftp_user = function(elm) { + var ref = $(elm).parents('.ftptable'); + ref.remove(); + + var index = 1; + $('.data-col2 .ftp-user-number:visible').each(function(i, o) { + $(o).text(index); + index += 1; + }); + + if ($('.ftptable-nrm:visible').length == 0) { + $('.v-add-new-user').hide(); + $('input[name="v_ftp"]').attr('checked', false); + } +} + + +App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) { + if ($(elm).attr('checked')) { + $('.ftptable-nrm, .v-add-new-user, .add-new-ftp-user-button').show(); + $('.ftptable-nrm').each(function(i, elm) { + var login = $(elm).find('.v-ftp-user'); + if (login.val().trim() != '') { + $(elm).find('.v-ftp-user-deleted').val(0); + } + }); + } + else { + $('.ftptable-nrm, .v-add-new-user, .add-new-ftp-user-button').hide(); + $('.ftptable-nrm').each(function(i, elm) { + var login = $(elm).find('.v-ftp-user'); + if (login.val().trim() != '') { + $(elm).find('.v-ftp-user-deleted').val(1); + } + }); + } + + if ($('.ftptable-nrm:visible').length == 0) { + var ref = $('#templates').find('.ftptable').clone(true); + var index = $('.data-col2 .ftptable').length + 1; + + ref.find('input').each(function(i, elm) { + var attr_value = $(elm).attr('name').replace('%INDEX%', index); + $(elm).attr('name', attr_value); + }); + + ref.find('.ftp-user-number').text(index); + + $('.v-add-new-user').parent('tr').prev().find('td').html(ref); + } +} + // // Page entry point -// Trigger listeners App.Listeners.WEB.keypress_ftp_username(); +App.Listeners.WEB.keypress_ftp_path(); +App.Listeners.WEB.keypress_domain_name(); diff --git a/web/js/pages/edit.web.js b/web/js/pages/edit.web.js index fc9be3fcf..5d8ede2f2 100644 --- a/web/js/pages/edit.web.js +++ b/web/js/pages/edit.web.js @@ -1,29 +1,138 @@ App.Actions.WEB.update_ftp_username_hint = function(elm, hint) { if (hint.trim() == '') { $(elm).parent().find('.hint').html(''); - } + } + + hint = hint.replace(/[^\w\d]/gi, ''); + if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) { hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length); } + $(elm).parent().find('.v-ftp-user').val(hint); $(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint); } App.Listeners.WEB.keypress_ftp_username = function() { - var ref = $('input[name="v_ftp_user"]'); - var current_val = ref.val(); - if (current_val.trim() != '') { - App.Actions.DB.update_ftp_username_hint(ref, current_val); + var ftp_user_inputs = $('.v-ftp-user'); + $.each(ftp_user_inputs, function(i, ref) { + var ref = $(ref); + var current_val = ref.val(); + if (current_val.trim() != '') { + App.Actions.WEB.update_ftp_username_hint(ref, current_val); + } + + ref.bind('keypress', function(evt) { + clearTimeout(window.frp_usr_tmt); + window.frp_usr_tmt = setTimeout(function() { + var elm = $(evt.target); + App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val()); + }, 100); + }); + }); +} + +// +// + +App.Actions.WEB.update_ftp_path_hint = function(elm, hint) { + if (hint.trim() == '') { + $(elm).parent().find('.v-ftp-path-hint').html(''); + } + + if (hint[0] != '/') { + hint = '/' + hint; } - ref.bind('keypress', function(evt) { - clearTimeout(window.frp_usr_tmt); - window.frp_usr_tmt = setTimeout(function() { - var elm = $(evt.target); - App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val()); - }, 100); + hint = hint.replace(/\/(\/+)/g, '/'); + + $(elm).parent().find('.v-ftp-path-hint').text(hint); +} + +App.Listeners.WEB.keypress_ftp_path = function() { + var ftp_path_inputs = $('.v-ftp-path'); + $.each(ftp_path_inputs, function(i, ref) { + var ref = $(ref); + var current_val = ref.val(); + if (current_val.trim() != '') { + App.Actions.WEB.update_ftp_path_hint(ref, current_val); + } + + ref.bind('keypress', function(evt) { + clearTimeout(window.frp_usr_tmt); + window.frp_usr_tmt = setTimeout(function() { + var elm = $(evt.target); + App.Actions.WEB.update_ftp_path_hint(elm, $(elm).val()); + }, 100); + }); }); } +// +// +App.Actions.WEB.add_ftp_user_form = function() { + var ref = $('#templates').find('.ftptable').clone(true); + var index = $('.data-col2 .ftptable').length + 1; + + ref.find('input').each(function(i, elm) { + var attr_value = $(elm).attr('name').replace('%INDEX%', index); + $(elm).attr('name', attr_value); + }); + + ref.find('.ftp-user-number').text(index); + + $('.data-col2 .ftptable:last').after(ref); + + var index = 1; + $('.data-col2 .ftp-user-number:visible').each(function(i, o) { + $(o).text(index); + index += 1; + }); +} + +App.Actions.WEB.remove_ftp_user = function(elm) { + var ref = $(elm).parents('.ftptable'); + ref.find('.v-ftp-user-deleted').val('1'); + if (ref.find('.v-ftp-user-is-new').val() == 1) { + ref.remove(); + return true; + } + ref.removeClass('ftptable-nrm'); + ref.hide(); + + var index = 1; + $('.data-col2 .ftp-user-number:visible').each(function(i, o) { + $(o).text(index); + index += 1; + }); + + if ($('.ftptable-nrm:visible').length == 0) { + $('.add-new-ftp-user-button').hide(); + $('input[name="v_ftp"]').attr('checked', false); + } +} + +App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) { + if ($(elm).attr('checked')) { + $('.ftptable-nrm, .v-add-new-user, .add-new-ftp-user-button').show(); + $('.ftptable-nrm').each(function(i, elm) { + var login = $(elm).find('.v-ftp-user'); + if (login.val().trim() != '') { + $(elm).find('.v-ftp-user-deleted').val(0); + } + }); + } + else { + $('.ftptable-nrm, .v-add-new-user, .add-new-ftp-user-button').hide(); + $('.ftptable-nrm').each(function(i, elm) { + var login = $(elm).find('.v-ftp-user'); + if (login.val().trim() != '') { + $(elm).find('.v-ftp-user-deleted').val(1); + } + }); + } +} + // // Page entry point App.Listeners.WEB.keypress_ftp_username(); +App.Listeners.WEB.keypress_ftp_path(); diff --git a/web/js/templates.js b/web/js/templates.js index ee5aeda60..e91f2f799 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -66,7 +66,7 @@ var Templator = function() { 'undefined' == typeof App.Templates._indexes[key] ? App.Templates._indexes[key] = {} : false; 'undefined' == typeof App.Templates._indexes[key][ref_key] ? - App.Templates._indexes[key][ref_key] = {} : false; + App.Templates._indexes[key][ref_key] = {} : false; jQuery(tpl).each(function(index, o) { if (':' == o.charAt(0)) { @@ -84,8 +84,8 @@ var Templator = function() Templator.getTemplate = function(ns, key){ return [ - App.Templates._indexes[ns][key], - App.Templates.html[ns][key].slice(0) + App.Templates._indexes[ns][key], + App.Templates.html[ns][key].slice(0) ]; } // init templator From 6718bdd926aae04b13b01944844a10ed188fb19c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:49:14 +0300 Subject: [PATCH 69/84] Renamed dialog button --- web/js/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/events.js b/web/js/events.js index f183ba831..881eadcfa 100644 --- a/web/js/events.js +++ b/web/js/events.js @@ -102,7 +102,7 @@ VE.helpers.createConfirmationDialog = function(elm, dialog_title, confirmed_loca $(this).dialog("destroy"); }, buttons: { - "Ok": function(event, ui) { + "OK": function(event, ui) { location.href = confirmed_location_url; }, "Cancel": function() { From ff9cb08425ce44254c96537e6bac04a06a250229 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:51:22 +0300 Subject: [PATCH 70/84] scrollable top panel --- web/templates/admin/panel.html | 15 ++++- web/templates/header.html | 114 ++++++++++++++++++++++++++++++++- web/templates/user/panel.html | 15 ++++- 3 files changed, 137 insertions(+), 7 deletions(-) diff --git a/web/templates/admin/panel.html b/web/templates/admin/panel.html index ee9ffef3f..968b5fc0f 100644 --- a/web/templates/admin/panel.html +++ b/web/templates/admin/panel.html @@ -15,9 +15,11 @@ -
+ diff --git a/web/templates/header.html b/web/templates/header.html index 56580bd2a..70fe7ee45 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -41,8 +41,10 @@ var valus= document.getElementById(frmname); if (checked==false) { checked=true; + $('.data-row').addClass("selected"); } else { checked = false; + $('.data-row').removeClass("selected"); } for (var i =0; i < valus.elements.length; i++) { valus.elements[i].checked=checked; @@ -51,8 +53,40 @@ - + \ No newline at end of file diff --git a/web/templates/user/panel.html b/web/templates/user/panel.html index 80d4e8c92..fb6af499d 100644 --- a/web/templates/user/panel.html +++ b/web/templates/user/panel.html @@ -10,9 +10,11 @@
-
+ +
\ No newline at end of file From f42face68d91ea12e8528bdfb454ebe0c8cc6ca4 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:54:18 +0300 Subject: [PATCH 71/84] Multiftp support --- web/add/web/index.php | 591 +++++++++++++++++------------- web/edit/web/index.php | 440 ++++++++++++++-------- web/templates/admin/add_web.html | 274 ++++++++------ web/templates/admin/edit_web.html | 232 ++++++++---- web/templates/user/edit_web.html | 227 ++++++++---- 5 files changed, 1094 insertions(+), 670 deletions(-) diff --git a/web/add/web/index.php b/web/add/web/index.php index 0c13cf58e..63d8d792b 100644 --- a/web/add/web/index.php +++ b/web/add/web/index.php @@ -4,277 +4,350 @@ error_reporting(NULL); ob_start(); session_start(); $TAB = 'WEB'; + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Check POST request +if (!empty($_POST['ok'])) { + + // Check for empty fields + if (empty($_POST['v_domain'])) $errors[] = __('domain'); + if (empty($_POST['v_ip'])) $errors[] = __('ip'); + 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($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Check stats password length + if ((!empty($v_stats)) && (empty($_SESSION['error_msg']))) { + if (!empty($_POST['v_stats_user'])) { + $pw_len = strlen($_POST['v_stats_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); + } + } + + // Default proxy extention list + $v_proxy_ext = 'jpeg, jpg, png, gif, bmp, ico, svg, tif, tiff, css, js, htm, html, ttf, '; + $v_proxy_ext .= 'otf, webp, woff, txt, csv, rtf, doc, docx, xls, xlsx, ppt, pptx, odf, '; + $v_proxy_ext .= 'odp, ods, odt, pdf, psd, ai, eot, eps, ps, zip, tar, tgz, gz, rar, '; + $v_proxy_ext .= 'bz2, 7z, aac, m4a, mp3, mp4, ogg, wav, wma, 3gp, avi, flv, m4v, mkv, '; + $v_proxy_ext .= 'mov, mp4, mpeg, mpg, wmv, exe, iso, dmg, swf'; + + // Set advanced option checkmark + if (empty($_POST['v_proxy'])) $v_adv = 'yes'; + if (!empty($_POST['v_ftp'])) $v_adv = 'yes'; + if ($_POST['v_proxy_ext'] != $v_proxy_ext) $v_adv = 'yes'; + + // Set domain name to lowercase and remove www prefix + $v_domain = preg_replace("/^www\./i", "", $_POST['v_domain']); + $v_domain = escapeshellarg($v_domain); + $v_domain = strtolower($v_domain); + + // Prepare domain values + $v_ip = escapeshellarg($_POST['v_ip']); + if ((!empty($_POST['v_aliases'])) && ($_POST['v_aliases'] != 'www.'.$_POST['v_domain'])) $v_adv = 'yes'; + if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes'; + if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes'; + if ((!empty($_POST['v_ssl_ca'])) || ($_POST['v_stats'] != 'none')) $v_adv = 'yes'; + if (!empty($v_domain)) $v_ftp_user_prepath .= $v_domain; + if (empty($_POST['v_dns'])) $v_dns = 'off'; + if (empty($_POST['v_mail'])) $v_mail = 'off'; + if (empty($_POST['v_proxy'])) $v_proxy = 'off'; + $v_aliases = $_POST['v_aliases']; + $v_elog = $_POST['v_elog']; + $v_ssl = $_POST['v_ssl']; + $v_ssl_crt = $_POST['v_ssl_crt']; + $v_ssl_key = $_POST['v_ssl_key']; + $v_ssl_ca = $_POST['v_ssl_ca']; + $v_ssl_home = $data[$v_domain]['SSL_HOME']; + $v_stats = escapeshellarg($_POST['v_stats']); + $v_stats_user = $data[$v_domain]['STATS_USER']; + $v_stats_password = $data[$v_domain]['STATS_PASSWORD']; + $v_proxy_ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']); + $v_proxy_ext = preg_replace("/,/", " ", $v_proxy_ext); + $v_proxy_ext = preg_replace('/\s+/', ' ',$v_proxy_ext); + $v_proxy_ext = trim($v_proxy_ext); + $v_proxy_ext = str_replace(' ', ", ", $v_proxy_ext); + $v_ftp = $_POST['v_ftp']; + $v_ftp_user = $_POST['v_ftp_user']; + $v_ftp_password = $_POST['v_ftp_password']; + $v_ftp_email = $_POST['v_ftp_email']; + + + // Add web domain + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-web-domain ".$user." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $domain_added = empty($_SESSION['error_msg']); + } + + // Add DNS domain + if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add mail domain + if (($_POST['v_mail'] == 'on') && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-mail-domain ".$user." ".$v_domain, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add domain aliases + if ((!empty($_POST['v_aliases'])) && (empty($_SESSION['error_msg']))) { + $valiases = preg_replace("/\n/", " ", $_POST['v_aliases']); + $valiases = preg_replace("/,/", " ", $valiases); + $valiases = preg_replace('/\s+/', ' ',$valiases); + $valiases = trim($valiases); + $aliases = explode(" ", $valiases); + foreach ($aliases as $alias) { + if ($alias == 'www.'.$_POST['v_domain']) { + $www_alias = 'yes'; + } else { + $alias = escapeshellarg($alias); + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-add-dns-on-web-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } + } + } + + // Delete www. alias if it wasn't found + if ((empty($www_alias)) && (empty($_SESSION['error_msg']))) { + $alias = preg_replace("/^www./i", "", $_POST['v_domain']); + $alias = 'www.'.$alias; + $alias = escapeshellarg($alias); + exec (VESTA_CMD."v-delete-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add proxy support + if (($_POST['v_proxy'] == 'on') && (empty($_SESSION['error_msg']))) { + $ext = str_replace(' ', '', $v_proxy_ext); + $ext = escapeshellarg($ext); + exec (VESTA_CMD."v-add-web-domain-proxy ".$user." ".$v_domain." '' ".$ext." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add SSL certificates + if ((!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { + exec ('mktemp -d', $output, $return_var); + $tmpdir = $output[0]; + unset($output); + + // Save 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); + } + + // Save private 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); + } + + // Save CA bundle + 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); + } + + $v_ssl_home = escapeshellarg($_POST['v_ssl_home']); + exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add web stats + if ((!empty($_POST['v_stats'])) && ($_POST['v_stats'] != 'none' ) && (empty($_SESSION['error_msg']))) { + $v_stats = escapeshellarg($_POST['v_stats']); + exec (VESTA_CMD."v-add-web-domain-stats ".$user." ".$v_domain." ".$v_stats, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add web stats password + if ((!empty($_POST['v_stats_user'])) && (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 ".$user." ".$v_domain." ".$v_stats_user." ".$v_stats_password, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Restart DNS server + if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Restart web server + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-restart-web", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Restart proxy server + if (($_POST['v_proxy'] == 'on') && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-restart-proxy", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + + // Add FTP + if ((!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) { + $v_ftp_users_updated = array(); + foreach ($_POST['v_ftp_user'] as $i => $v_ftp_user_data) { + if ($v_ftp_user_data['is_new'] == 1) { + if ((!empty($v_ftp_user_data['v_ftp_email'])) && (!filter_var($v_ftp_user_data['v_ftp_email'], FILTER_VALIDATE_EMAIL))) $_SESSION['error_msg'] = __('Please enter valid email address.'); + if (empty($v_ftp_user_data['v_ftp_user'])) $errors[] = 'ftp user'; + if (empty($v_ftp_user_data['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'] = __('Field "%s" can not be blank.',$error_msg); + } + + // Validate email + if ((!empty($v_ftp_user_data['v_ftp_email'])) && (!filter_var($v_ftp_user_data['v_ftp_email'], FILTER_VALIDATE_EMAIL))) { + $_SESSION['error_msg'] = __('Please enter valid email address.'); + } + + // Check ftp password length + if ((!empty($v_ftp_user_data['v_ftp']))) { + if (!empty($v_ftp_user_data['v_ftp_user'])) { + $pw_len = strlen($v_ftp_user_data['v_ftp_password']); + if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); + } + } + + $v_ftp_user_data['v_ftp_user'] = preg_replace("/^".$user."_/i", "", $v_ftp_user_data['v_ftp_user']); + $v_ftp_username = $v_ftp_user_data['v_ftp_user']; + $v_ftp_username_full = $user . '_' . $v_ftp_user_data['v_ftp_user']; + $v_ftp_user = escapeshellarg($v_ftp_user_data['v_ftp_user']); + $v_ftp_password = escapeshellarg($v_ftp_user_data['v_ftp_password']); + + if ($domain_added) { + exec (VESTA_CMD."v-add-web-domain-ftp ".$user." ".$v_domain." ".$v_ftp_username." ".$v_ftp_password . " " . $v_ftp_user_data['v_ftp_path'], $output, $return_var); + check_return_code($return_var,$output); + unset($output); + if ((!empty($v_ftp_user_data['v_ftp_email'])) && (empty($_SESSION['error_msg']))) { + $to = $v_ftp_user_data['v_ftp_email']; + $subject = __("FTP login credentials"); + $from = __('MAIL_FROM',$_POST['v_domain']); + $mailtext = __('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$v_ftp_user_data['v_ftp_user'],$v_ftp_user_data['v_ftp_password']); + send_email($to, $subject, $mailtext, $from); + unset($v_ftp_email); + } + } else { + $return_var = -1; + } + + if ($return_var == 0) { + $v_ftp_password = "••••••••"; + $v_ftp_user_data['is_new'] = 0; + } else { + $v_ftp_user_data['is_new'] = 1; + } + + $v_ftp_username = preg_replace("/^".$user."_/", "", $v_ftp_user_data['v_ftp_user']); + $v_ftp_users_updated[] = array( + 'is_new' => $v_ftp_user_data['is_new'], + 'v_ftp_user' => $return_var == 0 ? $v_ftp_username_full : $v_ftp_username, + 'v_ftp_password' => $v_ftp_password, + 'v_ftp_path' => $v_ftp_user_data['v_ftp_path'], + 'v_ftp_email' => $v_ftp_user_data['v_ftp_email'], + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); + continue; + } + } + + if (!empty($_SESSION['error_msg']) && $domain_added) { + $_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); + $_SESSION['flash_error_msg'] = $_SESSION['error_msg']; + $url = '/edit/web/?domain='.strtolower(preg_replace("/^www\./i", "", $_POST['v_domain'])); + header('Location: ' . $url); + exit; + } + } + + // Flush field values on success + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); + unset($v_domain); + unset($v_aliases); + unset($v_ssl); + unset($v_ssl_crt); + unset($v_ssl_key); + unset($v_ssl_ca); + unset($v_stats_user); + unset($v_stats_password); + unset($v_ftp); + } +} + + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); // Panel top_panel($user,$TAB); + +// Define user variables +$v_ftp_user_prepath = $panel[$user]['HOME'] . "/web"; $v_ftp_email = $panel[$user]['CONTACT']; - if (!empty($_POST['ok'])) { - // Check input - if (empty($_POST['v_domain'])) $errors[] = __('domain'); - if (empty($_POST['v_ip'])) $errors[] = __('ip'); - 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_aliases'])) && ($_POST['v_aliases'] != 'www.'.$_POST['v_domain'])) $v_adv = 'yes'; - if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes'; - if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes'; - if ((!empty($_POST['v_ssl_ca'])) || ($_POST['v_stats'] != 'none')) $v_adv = 'yes'; - if (empty($_POST['v_proxy'])) $v_adv = 'yes'; - if (!empty($_POST['v_ftp'])) $v_adv = 'yes'; - $v_proxy_ext = 'jpeg, jpg, png, gif, bmp, ico, svg, tif, tiff, css, js, htm, html, ttf,'; - $v_proxy_ext .= 'otf, webp, woff, txt, csv, rtf, doc, docx, xls, xlsx, ppt, pptx, odf, '; - $v_proxy_ext .= 'odp, ods, odt, pdf, psd, ai, eot, eps, ps, zip, tar, tgz, gz, rar, '; - $v_proxy_ext .= 'bz2, 7z, aac, m4a, mp3, mp4, ogg, wav, wma, 3gp, avi, flv, m4v, mkv, '; - $v_proxy_ext .= 'mov, mp4, mpeg, mpg, wmv, exe, iso, dmg, swf'; - if ($_POST['v_proxy_ext'] != $v_proxy_ext) $v_adv = 'yes'; +// List IP addresses +exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var); +$ips = json_decode(implode('', $output), true); +unset($output); - // Protect input - $v_domain = preg_replace("/^www\./i", "", $_POST['v_domain']); - $v_domain = escapeshellarg($v_domain); - $v_domain = strtolower($v_domain); - $v_ip = escapeshellarg($_POST['v_ip']); - if (empty($_POST['v_dns'])) $v_dns = 'off'; - if (empty($_POST['v_mail'])) $v_mail = 'off'; - if (empty($_POST['v_proxy'])) $v_proxy = 'off'; - $v_aliases = $_POST['v_aliases']; - $v_elog = $_POST['v_elog']; - $v_ssl = $_POST['v_ssl']; - $v_ssl_crt = $_POST['v_ssl_crt']; - $v_ssl_key = $_POST['v_ssl_key']; - $v_ssl_ca = $_POST['v_ssl_ca']; - $v_ssl_home = $data[$v_domain]['SSL_HOME']; - $v_stats = escapeshellarg($_POST['v_stats']); - $v_stats_user = $data[$v_domain]['STATS_USER']; - $v_stats_password = $data[$v_domain]['STATS_PASSWORD']; - $v_proxy_ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']); - $v_proxy_ext = preg_replace("/,/", " ", $v_proxy_ext); - $v_proxy_ext = preg_replace('/\s+/', ' ',$v_proxy_ext); - $v_proxy_ext = trim($v_proxy_ext); - $v_proxy_ext = str_replace(' ', ", ", $v_proxy_ext); - $v_ftp = $_POST['v_ftp']; - $v_ftp_user = $_POST['v_ftp_user']; - $v_ftp_password = $_POST['v_ftp_password']; - $v_ftp_email = $_POST['v_ftp_email']; +// List web stat engines +exec (VESTA_CMD."v-list-web-stats json", $output, $return_var); +$stats = json_decode(implode('', $output), true); +unset($output); - // Validate email - if ((!empty($_POST['v_ftp_email'])) && (!filter_var($_POST['v_ftp_email'], FILTER_VALIDATE_EMAIL))) { - $_SESSION['error_msg'] = __('Please enter valid email address.'); - } +// Display body +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html'); - // Check ftp password length - if ((!empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) { - if (!empty($_POST['v_ftp_user'])) { - $pw_len = strlen($_POST['v_ftp_password']); - if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); - } - } - - // Check stats password length - if ((!empty($v_stats)) && (empty($_SESSION['error_msg']))) { - if (!empty($_POST['v_stats_user'])) { - $pw_len = strlen($_POST['v_stats_password']); - if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg); - } - } - - // 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'] = __('Field "%s" can not be blank.',$error_msg); - } - - if (empty($_SESSION['error_msg'])) { - // Add WEB - exec (VESTA_CMD."v-add-web-domain ".$user." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - - // Add DNS - if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Add Mail - if (($_POST['v_mail'] == 'on') && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-mail-domain ".$user." ".$v_domain, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Add Aliases - if ((!empty($_POST['v_aliases'])) && (empty($_SESSION['error_msg']))) { - $valiases = preg_replace("/\n/", " ", $_POST['v_aliases']); - $valiases = preg_replace("/,/", " ", $valiases); - $valiases = preg_replace('/\s+/', ' ',$valiases); - $valiases = trim($valiases); - $aliases = explode(" ", $valiases); - foreach ($aliases as $alias) { - if ($alias == 'www.'.$_POST['v_domain']) { - $www_alias = 'yes'; - } else { - $alias = escapeshellarg($alias); - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-add-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); - check_return_code($return_var,$output); - } - unset($output); - if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-dns-on-web-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - } - } - } - if ((empty($www_alias)) && (empty($_SESSION['error_msg']))) { - $alias = preg_replace("/^www./i", "", $_POST['v_domain']); - $alias = 'www.'.$alias; - $alias = escapeshellarg($alias); - exec (VESTA_CMD."v-delete-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $output, $return_var); - check_return_code($return_var,$output); - } - - - // Add proxy - if (($_POST['v_proxy'] == 'on') && (empty($_SESSION['error_msg']))) { - $ext = str_replace(' ', '', $v_proxy_ext); - $ext = escapeshellarg($ext); - exec (VESTA_CMD."v-add-web-domain-proxy ".$user." ".$v_domain." '' ".$ext." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Add SSL - if (!empty($_POST['v_ssl'])) { - exec ('mktemp -d', $output, $return_var); - $tmpdir = $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); - } - - $v_ssl_home = escapeshellarg($_POST['v_ssl_home']); - exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - // Add WebStats - if ((!empty($_POST['v_stats'])) && ($_POST['v_stats'] != 'none' ) && (empty($_SESSION['error_msg']))) { - $v_stats = escapeshellarg($_POST['v_stats']); - exec (VESTA_CMD."v-add-web-domain-stats ".$user." ".$v_domain." ".$v_stats, $output, $return_var); - check_return_code($return_var,$output); - unset($output); - - if ((!empty($_POST['v_stats_user'])) && (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 ".$user." ".$v_domain." ".$v_stats_user." ".$v_stats_password, $output, $return_var); - check_return_code($return_var,$output); - unset($v_stats_user); - unset($v_stats_password); - unset($output); - } - } - - - // Add FTP - if ((!empty($_POST['v_ftp'])) && (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 ".$user." ".$v_domain." ".$v_ftp_user." ".$v_ftp_password, $output, $return_var); - check_return_code($return_var,$output); - if (empty($_SESSION['error_msg'])) { - if (!empty($v_ftp_email)) { - $to = $_POST['v_ftp_email']; - $subject = __("FTP login credentials"); - $hostname = exec('hostname'); - $from = __('MAIL_FROM',$hostname); - $mailtext .= __('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']); - send_email($to, $subject, $mailtext, $from); - } - } - unset($v_ftp); - unset($v_ftp_user); - unset($v_ftp_password); - unset($output); - } - - if (($_POST['v_dns'] == 'on') && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-restart-dns", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-restart-web", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-restart-proxy", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - } - - if (empty($_SESSION['error_msg'])) { - unset($output); - $_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); - unset($v_domain); - unset($v_aliases); - unset($v_ssl); - unset($v_ssl_crt); - unset($v_ssl_key); - unset($v_ssl_ca); - } - } - } - - 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-stats json", $output, $return_var); - $stats = json_decode(implode('', $output), true); - unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html'); - unset($_SESSION['error_msg']); - unset($_SESSION['ok_msg']); -//} +// Flush session messages +unset($_SESSION['error_msg']); +unset($_SESSION['ok_msg']); // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/web/index.php b/web/edit/web/index.php index a607e5465..fad416202 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -4,17 +4,11 @@ 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? +// Check domain argument if (empty($_GET['domain'])) { header("Location: /list/web/"); exit; @@ -25,73 +19,77 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { $user=escapeshellarg($_GET['user']); } -// Check domain +// List domain $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var); -check_return_code($return_var,$output); -if (empty($_SESSION['error_msg'])) { - $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_proxy = $data[$v_domain]['PROXY']; - $v_proxy_template = $data[$v_domain]['PROXY']; - $v_proxy_ext = str_replace(',', ', ', $data[$v_domain]['PROXY_EXT']); - $v_stats = $data[$v_domain]['STATS']; - $v_stats_user = $data[$v_domain]['STATS_USER']; - if (!empty($v_stats_user)) $v_stats_password = "••••••••"; - $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']; +$data = json_decode(implode('', $output), true); +unset($output); - 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-templates-proxy json", $output, $return_var); - $proxy_templates = json_decode(implode('', $output), true); - unset($output); - - exec (VESTA_CMD."v-list-web-stats json", $output, $return_var); - $stats = json_decode(implode('', $output), true); +// Parse domain +$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']; } - - -// Action +$v_ssl_home = $data[$v_domain]['SSL_HOME']; +$v_proxy = $data[$v_domain]['PROXY']; +$v_proxy_template = $data[$v_domain]['PROXY']; +$v_proxy_ext = str_replace(',', ', ', $data[$v_domain]['PROXY_EXT']); +$v_stats = $data[$v_domain]['STATS']; +$v_stats_user = $data[$v_domain]['STATS_USER']; +if (!empty($v_stats_user)) $v_stats_password = "••••••••"; +$v_ftp_user = $data[$v_domain]['FTP_USER']; +if (!empty($v_ftp_user)) $v_ftp_password = "••••••••"; +$v_ftp_user_prepath = $data[$v_domain]['DOCUMENT_ROOT']; +$v_ftp_user_prepath = str_replace('/public_html', '', $v_ftp_user_prepath, $occurance = 1); $v_ftp_email = $panel[$user]['CONTACT']; +$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']; + +// List ip addresses +exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var); +$ips = json_decode(implode('', $output), true); +unset($output); + +// List web templates +exec (VESTA_CMD."v-list-web-templates json", $output, $return_var); +$templates = json_decode(implode('', $output), true); +unset($output); + +// List proxy templates +exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); +$proxy_templates = json_decode(implode('', $output), true); +unset($output); + +// List web stat engines +exec (VESTA_CMD."v-list-web-stats json", $output, $return_var); +$stats = json_decode(implode('', $output), true); +unset($output); + +// Check POST request if (!empty($_POST['save'])) { $v_domain = escapeshellarg($_POST['v_domain']); - // IP + // Change web 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); @@ -99,27 +97,36 @@ if (!empty($_POST['save'])) { $restart_web = 'yes'; $restart_proxy = 'yes'; unset($output); + } + + // Chane dns domain IP + if (empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var); - if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) { - unset($output); + unset($output); + if ($return_var == 0 ) { exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); check_return_code($return_var,$output); - $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); - check_return_code($return_var,$output); - $restart_dns = 'yes'; - } unset($output); + $restart_dns = 'yes'; } } - // Template - if (( $_SESSION['user'] == 'admin') && ($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) { + // Change dns ip for each alias + if (empty($_SESSION['error_msg'])) { + foreach($valiases as $v_alias ){ + exec (VESTA_CMD."v-list-dns-domain ".$v_username." '".$v_alias."' json", $output, $return_var); + unset($output); + if ($return_var == 0 ) { + exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." '".$v_alias."' ".$v_ip, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $restart_dns = 'yes'; + } + } + } + + // Change template (admin only) + if (($v_template != $_POST['v_template']) && ( $_SESSION['user'] == 'admin') && (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); check_return_code($return_var,$output); @@ -127,7 +134,7 @@ if (!empty($_POST['save'])) { $restart_web = 'yes'; } - // Aliases + // Change aliases if (empty($_SESSION['error_msg'])) { $waliases = preg_replace("/\n/", " ", $_POST['v_aliases']); $waliases = preg_replace("/,/", " ", $waliases); @@ -151,9 +158,9 @@ if (!empty($_POST['save'])) { if ($return_var == 0) { exec (VESTA_CMD."v-delete-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var); check_return_code($return_var,$output); + unset($output); $restart_dns = 'yes'; } - unset($output); } } } @@ -173,15 +180,15 @@ if (!empty($_POST['save'])) { if ($return_var == 0) { exec (VESTA_CMD."v-add-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var); check_return_code($return_var,$output); + unset($output); $restart_dns = 'yes'; } } - unset($output); } } } - // Proxy + // Delete proxy support if ((!empty($v_proxy)) && (empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { exec (VESTA_CMD."v-delete-web-domain-proxy ".$v_username." ".$v_domain." 'no'", $output, $return_var); check_return_code($return_var,$output); @@ -189,6 +196,8 @@ if (!empty($_POST['save'])) { unset($v_proxy); $restart_proxy = 'yes'; } + + // Change proxy template / Update extention list if ((!empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { $ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']); $ext = preg_replace("/,/", " ", $ext); @@ -205,6 +214,8 @@ if (!empty($_POST['save'])) { $restart_proxy = 'yes'; } } + + // Add proxy support if ((empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { $v_proxy_template = $_POST['v_proxy_template']; if (!empty($_POST['v_proxy_ext'])) { @@ -221,7 +232,7 @@ if (!empty($_POST['save'])) { $restart_proxy = 'yes'; } - // SSL + // Delete SSL certificate 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); check_return_code($return_var,$output); @@ -230,6 +241,8 @@ if (!empty($_POST['save'])) { $restart_web = 'yes'; $restart_proxy = 'yes'; } + + // Change SSL certificate 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); @@ -269,15 +282,8 @@ if (!empty($_POST['save'])) { $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); - check_return_code($return_var,$output); - $v_ssl_home = $_POST['v_ssl_home']; - unset($output); - } - } + + // Add SSL certificate 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'; @@ -329,19 +335,34 @@ if (!empty($_POST['save'])) { } } - // Web Stats + // Change document root for ssl domain + 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); + check_return_code($return_var,$output); + $v_ssl_home = $_POST['v_ssl_home']; + unset($output); + } + } + + // Delete 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); check_return_code($return_var,$output); unset($output); $v_stats = ''; } + + // Change web stats engine 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); check_return_code($return_var,$output); unset($output); } + + // Add web stats 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); @@ -349,7 +370,7 @@ if (!empty($_POST['save'])) { unset($output); } - // Web Stats Auth + // Delete web stats authorization 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); check_return_code($return_var,$output); @@ -357,6 +378,8 @@ if (!empty($_POST['save'])) { $v_stats_user = ''; $v_stats_password = ''; } + + // Change web stats user or 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'); @@ -378,6 +401,8 @@ if (!empty($_POST['save'])) { $v_stats_password = "••••••••"; } } + + // Add web stats authorization 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'); @@ -401,112 +426,203 @@ if (!empty($_POST['save'])) { } } - // Delete 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); - check_return_code($return_var,$output); - unset($output); - $v_ftp= ''; - $v_ftp_user = ''; - $v_ftp_password = ''; - } - - // Change FTP Account - 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; + // Change ftp accounts + if (!empty($_POST['v_ftp_user'])) { + $v_ftp_users_updated = array(); + foreach ($_POST['v_ftp_user'] as $i => $v_ftp_user_data) { + $v_ftp_user_data['v_ftp_user'] = preg_replace("/^".$user."_/i", "", $v_ftp_user_data['v_ftp_user']); + if ($v_ftp_user_data['is_new'] == 1) { + if ((!empty($v_ftp_user_data['v_ftp_email'])) && (!filter_var($v_ftp_user_data['v_ftp_email'], FILTER_VALIDATE_EMAIL))) $_SESSION['error_msg'] = __('Please enter valid email address.'); + if (empty($v_ftp_user_data['v_ftp_user'])) $errors[] = 'ftp user'; + if (empty($v_ftp_user_data['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'] = __('Field "%s" can not be blank.',$error_msg); } - } - $_SESSION['error_msg'] = __('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); - check_return_code($return_var,$output); - unset($output); - $v_ftp= ''; - $v_ftp_user = $user."_".preg_replace("/^".$user."_/", "", $_POST['v_ftp_user']); - $v_ftp_password = "••••••••"; - } - } - // Add FTP Account - 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; + $v_ftp_username = $v_ftp_user_data['v_ftp_user']; + $v_ftp_username_full = $user . '_' . $v_ftp_user_data['v_ftp_user']; + $v_ftp_user = escapeshellarg($v_ftp_username); + $v_ftp_password = escapeshellarg($v_ftp_user_data['v_ftp_password']); + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-add-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_password . " " . $v_ftp_user_data['v_ftp_path'], $output, $return_var); + check_return_code($return_var,$output); + if ((!empty($v_ftp_user_data['v_ftp_email'])) && (empty($_SESSION['error_msg']))) { + $to = $v_ftp_user_data['v_ftp_email']; + $subject = __("FTP login credentials"); + $hostname = exec('hostname'); + $from = __('MAIL_FROM',$hostname); + $mailtext = __('FTP_ACCOUNT_READY',$_GET['domain'],$user,$v_ftp_username,$v_ftp_user_data['v_ftp_password']); + send_email($to, $subject, $mailtext, $from); + unset($v_ftp_email); + } + unset($output); } + + if ($return_var == 0) { + $v_ftp_password = "••••••••"; + $v_ftp_user_data['is_new'] = 0; + } + else { + $v_ftp_user_data['is_new'] = 1; + } + + $v_ftp_users_updated[] = array( + 'is_new' => empty($_SESSION['error_msg']) ? 0 : 1, + 'v_ftp_user' => $v_ftp_username_full, + 'v_ftp_password' => $v_ftp_password, + 'v_ftp_path' => $v_ftp_user_data['v_ftp_path'], + 'v_ftp_email' => $v_ftp_user_data['v_ftp_email'], + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); + + continue; } - $_SESSION['error_msg'] = __('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); - check_return_code($return_var,$output); - if ((!empty($_POST['v_ftp_email'])) && (empty($_SESSION['error_msg']))) { - $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); + + + if ($v_ftp_user_data['delete'] == 1) { + $v_ftp_username = $user . '_' . $v_ftp_user_data['v_ftp_user']; + exec (VESTA_CMD."v-delete-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_username, $output, $return_var); + check_return_code($return_var,$output); + unset($output); + + continue; } + + // Change FTP Account + if (empty($v_ftp_user_data['v_ftp_user'])) $errors[] = __('ftp user'); + if (empty($v_ftp_user_data['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'] = __('Field "%s" can not be blank.',$error_msg); + } + + $v_ftp_username = $user . '_' . $v_ftp_user_data['v_ftp_user']; //preg_replace("/^".$user."_/", "", $v_ftp_user_data['v_ftp_user']); + $v_ftp_username = escapeshellarg($v_ftp_username); + $v_ftp_user_data['v_ftp_password'] = escapeshellarg(trim($v_ftp_user_data['v_ftp_password'])); + exec (VESTA_CMD."v-change-web-domain-ftp-path ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_user_data['v_ftp_path'], $output, $return_var); + if ($v_ftp_user_data['v_ftp_password'] != "••••••••" && !empty($v_ftp_user_data['v_ftp_password'])) { + exec (VESTA_CMD."v-change-web-domain-ftp-password ".$v_username." ".$v_domain." ".$v_ftp_username." ".$v_ftp_user_data['v_ftp_password'], $output, $return_var); + } + check_return_code($return_var, $output); unset($output); - $v_ftp_user = $user."_".$_POST['v_ftp_user']; + $v_ftp_password = "••••••••"; + + $v_ftp_users_updated[] = array( + 'is_new' => 0, + 'v_ftp_user' => $v_ftp_username, + 'v_ftp_password' => $v_ftp_password, + 'v_ftp_path' => $v_ftp_user_data['v_ftp_path'], + 'v_ftp_email' => $v_ftp_user_data['v_ftp_email'], + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); } } - // Restart web + // Restart web server if (!empty($restart_web) && (empty($_SESSION['error_msg']))) { exec (VESTA_CMD."v-restart-web", $output, $return_var); check_return_code($return_var,$output); unset($output); } - // Restart proxy + // Restart proxy server if (!empty($restart_proxy) && (empty($_SESSION['error_msg']))) { exec (VESTA_CMD."v-restart-proxy", $output, $return_var); check_return_code($return_var,$output); unset($output); } - // Restart dns + // Restart dns server if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) { exec (VESTA_CMD."v-restart-dns", $output, $return_var); check_return_code($return_var,$output); unset($output); } + // Set success message if (empty($_SESSION['error_msg'])) { $_SESSION['ok_msg'] = __('Changes has been saved.'); } } + + +$v_ftp_users_raw = explode(':', $v_ftp_user); +$v_ftp_users_paths_raw = explode(':', $data[$v_domain]['FTP_PATH']); +$v_ftp_users = array(); +foreach ($v_ftp_users_raw as $v_ftp_user_index => $v_ftp_user_val) { + if (empty($v_ftp_user_val)) { + continue; + } + $v_ftp_users[] = array( + 'is_new' => 0, + 'v_ftp_user' => $v_ftp_user_val, + 'v_ftp_password' => $v_ftp_password, + 'v_ftp_path' => (isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : ''), + 'v_ftp_email' => $v_ftp_email, + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); +} + +if (empty($v_ftp_users)) { + $v_ftp_user = null; + $v_ftp_users[] = array( + 'is_new' => 1, + 'v_ftp_user' => '', + 'v_ftp_password' => '', + 'v_ftp_path' => (isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : ''), + 'v_ftp_email' => '', + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); +} + +// set default pre path for newly created users +$v_ftp_pre_path_new_user = $v_ftp_user_prepath; +if (isset($v_ftp_users_updated)) { + $v_ftp_users = $v_ftp_users_updated; + if (empty($v_ftp_users_updated)) { + $v_ftp_user = null; + $v_ftp_users[] = array( + 'is_new' => 1, + 'v_ftp_user' => '', + 'v_ftp_password' => '', + 'v_ftp_path' => (isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : ''), + 'v_ftp_email' => '', + 'v_ftp_pre_path' => $v_ftp_user_prepath + ); + } +} + +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); + +// Panel +top_panel($user,$TAB); + +// Display body if ($_SESSION['user'] == 'admin') { include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_web.html'); } else { include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_web.html'); } + +// Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); - // Footer include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/templates/admin/add_web.html b/web/templates/admin/add_web.html index 6f50d67a5..b8522c1ab 100644 --- a/web/templates/admin/add_web.html +++ b/web/templates/admin/add_web.html @@ -42,7 +42,7 @@ document.v_add_web.v_stats_password.value = webrandom; } - function FTPrandom() { + function FTPrandom(elm) { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var string_length = 10; var ftprandomstring = ''; @@ -50,7 +50,7 @@ var rnum = Math.floor(Math.random() * chars.length); ftprandomstring += chars.substring(rnum,rnum+1); } - document.v_add_web.v_ftp_password.value = ftprandomstring; + $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring); } function elementHideShow(elementToHideOrShow){ @@ -75,7 +75,7 @@ - @@ -85,7 +85,7 @@ - @@ -107,34 +107,24 @@ - - - - - - - - -
+
+
- + +
- > + +
- -
- > -
+
- @@ -144,25 +134,20 @@ - - - -
+
- -
- onclick="javascript:elementHideShow('proxytable');"> + +
- - @@ -170,26 +155,21 @@ - - - -
+
+
- / + + /
- onclick="javascript:elementHideShow('ssltable');"> -
- - - - - - - - @@ -234,7 +214,7 @@ - @@ -256,20 +236,15 @@ - - - - - - - - - @@ -36,7 +39,7 @@ document.v_edit_web.v_stats_password.value = webrandom; } - function FTPrandom() { + function FTPrandom(elm) { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var string_length = 10; var ftprandomstring = ''; @@ -44,7 +47,8 @@ var rnum = Math.floor(Math.random() * chars.length); ftprandomstring += chars.substring(rnum,rnum+1); } - document.v_edit_web.v_ftp_password.value = ftprandomstring; + + $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring); } function elementHideShow(elementToHideOrShow){ @@ -72,7 +76,7 @@
+
+
+
+
+
+
+ ()
+
+
- + +
- onclick="javascript:elementHideShow('statstable');"> -
+ - @@ -279,73 +254,104 @@ -
+
+ /
- +
- + +
- onclick="javascript:elementHideShow('ftptable');"> -
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
-
- -
- -
- / -
- - -
- class="ftptable ftptable-nrm" name="v_add_domain_ftp"> +
+ # () + + +
+
+ +
+ name="v_ftp_user[][v_ftp_user]" > + +
+ / +
+ + +
+ + +
+ +
+ + +
+ - - @@ -354,7 +360,71 @@
+ +
+ + + diff --git a/web/templates/admin/edit_web.html b/web/templates/admin/edit_web.html index 3ef861501..dd2696ce5 100644 --- a/web/templates/admin/edit_web.html +++ b/web/templates/admin/edit_web.html @@ -10,12 +10,15 @@
→ ".$_SESSION['ok_msg'].""; + } if (!empty($_SESSION['error_msg'])) { echo " → ".$_SESSION['error_msg'].""; - } else { - if (!empty($_SESSION['ok_msg'])) { - echo " → ".$_SESSION['ok_msg'].""; - } + } + if (!empty($_SESSION['flash_error_msg'])) { + echo " / FTP USER ".$_SESSION['flash_error_msg'].""; + unset($_SESSION['flash_error_msg']); } ?> - @@ -82,7 +86,7 @@ - @@ -105,7 +109,7 @@ - @@ -115,7 +119,7 @@ - @@ -136,20 +140,15 @@ - - - - -
+
+
+
+
- + +
- onclick="javascript:elementHideShow('proxytable');"> -
+ - @@ -173,7 +172,7 @@ - @@ -186,21 +185,16 @@ - - - - - @@ -36,7 +39,7 @@ document.v_edit_web.v_stats_password.value = webrandom; } - function FTPrandom() { + function FTPrandom(elm) { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var string_length = 10; var ftprandomstring = ''; @@ -44,7 +47,8 @@ var rnum = Math.floor(Math.random() * chars.length); ftprandomstring += chars.substring(rnum,rnum+1); } - document.v_edit_web.v_ftp_password.value = ftprandomstring; + + $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring); } function elementHideShow(elementToHideOrShow){ @@ -72,7 +76,7 @@
+
+
- / + + /
- onclick="javascript:elementHideShow('ssltable');"> -
+ - @@ -218,7 +212,7 @@ - @@ -228,7 +222,7 @@ - @@ -238,7 +232,7 @@ - @@ -251,7 +245,7 @@ - @@ -273,20 +267,15 @@ - - - - - - - - - + + + +
+
+
+
+ ()
+
- + +
- onclick="javascript:elementHideShow('statstable');"> -
+ - @@ -296,80 +285,106 @@ -
+
+ /
- +
- + +
- onclick="javascript:elementHideShow('ftptable');"> -
- + + $ftp_user): ?> + +
- - + + + - - - - -
- - ' . __('Prefix will be automaticaly added to username',$user."_") . '' ?> + + # () + +
- +
+ +
+ name="v_ftp_user[][v_ftp_user]" >
- / + + /
- + - + +
- + +
+ +
+ +
+ + +
- - @@ -378,7 +393,74 @@
+ +
+ + + + diff --git a/web/templates/user/edit_web.html b/web/templates/user/edit_web.html index 1b0998feb..80e67bb47 100644 --- a/web/templates/user/edit_web.html +++ b/web/templates/user/edit_web.html @@ -10,12 +10,15 @@
→ ".$_SESSION['ok_msg'].""; + } if (!empty($_SESSION['error_msg'])) { echo " → ".$_SESSION['error_msg'].""; - } else { - if (!empty($_SESSION['ok_msg'])) { - echo " → ".$_SESSION['ok_msg'].""; - } + } + if (!empty($_SESSION['flash_error_msg'])) { + echo "
→ ".$_SESSION['flash_error_msg'].""; + unset($_SESSION['flash_error_msg']); } ?>
- @@ -82,7 +86,7 @@ - @@ -105,7 +109,7 @@ - @@ -115,17 +119,12 @@ - - - - -
+
+
+
- + +
- onclick="javascript:elementHideShow('proxytable');"> -
+ - - - - -
@@ -141,21 +140,16 @@
- / + + /
- onclick="javascript:elementHideShow('ssltable');"> -
+ - @@ -164,7 +158,7 @@ - @@ -183,7 +177,7 @@ - @@ -193,7 +187,7 @@ - @@ -206,7 +200,7 @@ - @@ -228,20 +222,15 @@ - - - - -
+
+
+
+ ()
+
- + +
- onclick="javascript:elementHideShow('statstable');"> -
+ - @@ -251,7 +240,7 @@ - @@ -264,67 +253,95 @@ - - - - + + + +
+
+ /
- + +
- onclick="javascript:elementHideShow('ftptable');"> -
- + + + + $ftp_user): ?> + +
- - + + + - - - - -
- - ' . __('Prefix will be automaticaly added to username',$user."_") . '' ?> + + # () + +
- +
+ +
+ name="v_ftp_user[][v_ftp_user]" >
- / + + /
- + - + +
- + +
+ +
+ +
+ + +
- - @@ -333,7 +350,73 @@
+ +
+ + + From bf7058f8b6fb1181d6e44a9f99e8c9894f228fbd Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 30 Jul 2014 15:56:19 +0300 Subject: [PATCH 72/84] Fixed syntax errors --- web/inc/i18n/hu.php | 6 +- web/templates/admin/add_cron.html | 18 +++--- web/templates/admin/add_db.html | 22 +++---- web/templates/admin/add_dns.html | 20 +++--- web/templates/admin/add_dns_rec.html | 14 ++--- web/templates/admin/add_ip.html | 29 ++++----- web/templates/admin/add_mail.html | 33 +++------- web/templates/admin/add_mail_acc.html | 32 ++++------ web/templates/admin/add_package.html | 38 ++++++------ web/templates/admin/add_user.html | 22 +++---- .../admin/edit_backup_exclusions.html | 16 ++--- web/templates/admin/edit_cron.html | 20 +++--- web/templates/admin/edit_db.html | 18 +++--- web/templates/admin/edit_dns.html | 16 ++--- web/templates/admin/edit_dns_rec.html | 16 ++--- web/templates/admin/edit_ip.html | 61 ++++++++++--------- web/templates/admin/edit_mail.html | 35 +++-------- web/templates/admin/edit_mail_acc.html | 36 ++++------- web/templates/admin/edit_package.html | 38 ++++++------ web/templates/admin/edit_user.html | 24 ++++---- web/templates/admin/list_backup.html | 4 +- web/templates/admin/list_backup_detail.html | 2 +- .../admin/list_backup_exclusions.html | 2 +- web/templates/admin/list_cron.html | 6 +- web/templates/admin/list_db.html | 8 +-- web/templates/admin/list_dns.html | 4 +- web/templates/admin/list_dns_rec.html | 2 +- web/templates/admin/list_ip.html | 2 +- web/templates/admin/list_log.html | 2 +- web/templates/admin/list_mail.html | 8 +-- web/templates/admin/list_mail_acc.html | 4 +- web/templates/admin/list_packages.html | 6 +- web/templates/admin/list_rrd.html | 17 +++++- web/templates/admin/list_search.html | 4 +- web/templates/admin/list_services.html | 22 ++++--- web/templates/admin/list_stats.html | 6 +- web/templates/admin/list_updates.html | 2 +- web/templates/admin/list_user.html | 8 +-- web/templates/admin/list_web.html | 21 +++++-- web/templates/user/edit_dns.html | 16 ++--- web/templates/user/edit_user.html | 14 ++--- web/templates/user/list_cron.html | 4 +- web/templates/user/list_db.html | 8 +-- web/templates/user/list_dns.html | 4 +- web/templates/user/list_dns_rec.html | 2 +- web/templates/user/list_mail.html | 8 +-- web/templates/user/list_mail_acc.html | 4 +- web/templates/user/list_search.html | 4 +- web/templates/user/list_stats.html | 6 +- web/templates/user/list_user.html | 8 +-- web/templates/user/list_web.html | 10 +-- 51 files changed, 356 insertions(+), 376 deletions(-) diff --git a/web/inc/i18n/hu.php b/web/inc/i18n/hu.php index 25b52d700..f8ae15d40 100644 --- a/web/inc/i18n/hu.php +++ b/web/inc/i18n/hu.php @@ -17,7 +17,7 @@ $LANG['hu'] = array( 'Log in' => 'Belépés', 'Log out' => 'Kilépés', - 'USER' => 'FELHASZNÁLÓ', + 'USER' => 'USER', 'WEB' => 'WEB', 'DNS' => 'DNS', 'MAIL' => 'MAIL', @@ -142,7 +142,7 @@ $LANG['hu'] = array( 'Databases' => 'Adatbázis', 'User Directories' => 'Felhasználói könyvtárak', 'Template' => 'Sablon', - 'Web Template' => 'Apache sablon, + 'Web Template' => 'Apache sablon', 'Proxy Template' => 'Nginx sablon', 'DNS Template' => 'DNS sablon', 'Web Domains' => 'Web Domainek', @@ -398,7 +398,7 @@ $LANG['hu'] = array( 'LOGGED_IN_AS' => 'Belépve, mint %s', 'Error' => 'Hiba', 'Invalid username or password' => 'Hibás felhasználónév vagy jelszó', - 'Invalid username or code' => 'Hibás felhasználónév vagy kód + 'Invalid username or code' => 'Hibás felhasználónév vagy kód', 'Passwords not match' => 'A jelszavak nem egyeznek meg', 'Please enter valid email address.' => 'Kérlek valós e-mail címet adj meg!', 'Field "%s" can not be blank.' => 'A(z) "%s" mező nem lehet üres.', diff --git a/web/templates/admin/add_cron.html b/web/templates/admin/add_cron.html index c988cba9b..ac998b9c1 100644 --- a/web/templates/admin/add_cron.html +++ b/web/templates/admin/add_cron.html @@ -34,7 +34,7 @@
- @@ -44,7 +44,7 @@ - @@ -54,7 +54,7 @@ - @@ -64,7 +64,7 @@ - @@ -74,7 +74,7 @@ - @@ -84,22 +84,22 @@ -
+
+
+
+
+
+
- > + >
- - diff --git a/web/templates/admin/add_db.html b/web/templates/admin/add_db.html index 438824ab3..b864043b4 100644 --- a/web/templates/admin/add_db.html +++ b/web/templates/admin/add_db.html @@ -54,12 +54,12 @@
+ +
- - @@ -70,7 +70,7 @@ - @@ -81,17 +81,17 @@ - - @@ -109,7 +109,7 @@ - @@ -128,7 +128,7 @@ - @@ -174,7 +174,7 @@ - @@ -186,10 +186,10 @@
+
+
+
+ /
- +
+
+
+
+
- - diff --git a/web/templates/admin/add_dns.html b/web/templates/admin/add_dns.html index c7d042594..c78393d3a 100644 --- a/web/templates/admin/add_dns.html +++ b/web/templates/admin/add_dns.html @@ -45,7 +45,7 @@
+ +
- @@ -55,7 +55,7 @@ - @@ -65,15 +65,15 @@ - -
+
+
+
- +
+ - @@ -83,7 +83,7 @@ - @@ -93,7 +93,7 @@ - @@ -123,10 +123,10 @@
+ ()
+ TTL
+
- - diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html index 4fb6ad71b..f79eb0b2d 100644 --- a/web/templates/admin/add_dns_rec.html +++ b/web/templates/admin/add_dns_rec.html @@ -34,7 +34,7 @@
+ +
- @@ -44,7 +44,7 @@ - @@ -55,7 +55,7 @@ - @@ -78,7 +78,7 @@ - @@ -88,7 +88,7 @@ - @@ -100,10 +100,10 @@
+
+
+
+
+ ()
- - diff --git a/web/templates/admin/add_ip.html b/web/templates/admin/add_ip.html index 2957bd6c4..6bb0ec5fe 100644 --- a/web/templates/admin/add_ip.html +++ b/web/templates/admin/add_ip.html @@ -45,7 +45,7 @@
+ +
- @@ -55,7 +55,7 @@ - @@ -65,7 +65,7 @@ - @@ -83,25 +83,20 @@ - - - - -
+
+
+
- + +
- onclick="javascript:elementHideShow('usrtable');"> -
+ - - - @@ -127,7 +122,7 @@ - @@ -141,10 +136,10 @@
+
+
+ ()
+ ()
- - diff --git a/web/templates/admin/add_mail.html b/web/templates/admin/add_mail.html index 3c839b482..3f284b7dc 100644 --- a/web/templates/admin/add_mail.html +++ b/web/templates/admin/add_mail.html @@ -34,7 +34,7 @@
+ +
- @@ -44,42 +44,27 @@ - - - - - - - - - - - -
+
- + +
- > + +
- -
- > -
- -
- > + +
- - diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html index bbf943e62..65afefeab 100644 --- a/web/templates/admin/add_mail_acc.html +++ b/web/templates/admin/add_mail_acc.html @@ -55,7 +55,7 @@
+ +
- @@ -65,7 +65,7 @@ - @@ -75,25 +75,25 @@ - - -
+
+
+ /
- +
+
+ - @@ -103,7 +103,7 @@ - @@ -113,7 +113,7 @@ - @@ -123,26 +123,20 @@ - - - - -
+ ()
+ ()
+ ()
- + +
- > -
- - diff --git a/web/templates/admin/add_package.html b/web/templates/admin/add_package.html index 56777f656..833b088e2 100644 --- a/web/templates/admin/add_package.html +++ b/web/templates/admin/add_package.html @@ -35,7 +35,7 @@
+ +
- @@ -45,7 +45,7 @@ - @@ -68,7 +68,7 @@ - @@ -91,7 +91,7 @@ - @@ -114,7 +114,7 @@ - @@ -137,7 +137,7 @@ - @@ -147,7 +147,7 @@ - @@ -157,7 +157,7 @@ - @@ -167,7 +167,7 @@ - @@ -177,7 +177,7 @@ - @@ -187,7 +187,7 @@ - @@ -197,7 +197,7 @@ - @@ -207,7 +207,7 @@ - @@ -217,7 +217,7 @@ - @@ -227,7 +227,7 @@ - @@ -237,7 +237,7 @@ - @@ -247,7 +247,7 @@ - @@ -274,10 +274,10 @@
+
+
+
+
+
+
+ ()
+
+ ()
+
+ ()
+
+
+
+ ()
+ ()
+
- - diff --git a/web/templates/admin/add_user.html b/web/templates/admin/add_user.html index b645e7ac9..2913a9497 100644 --- a/web/templates/admin/add_user.html +++ b/web/templates/admin/add_user.html @@ -53,7 +53,7 @@
+ +
- @@ -63,17 +63,17 @@ - @@ -83,7 +83,7 @@ - @@ -107,7 +107,7 @@ - @@ -133,7 +133,7 @@ - @@ -143,7 +143,7 @@ - @@ -153,7 +153,7 @@ - @@ -166,10 +166,10 @@
+
+ /
- +
+
+
+
+
+
- - diff --git a/web/templates/admin/edit_backup_exclusions.html b/web/templates/admin/edit_backup_exclusions.html index 770966eb5..e2f974d78 100644 --- a/web/templates/admin/edit_backup_exclusions.html +++ b/web/templates/admin/edit_backup_exclusions.html @@ -38,7 +38,7 @@
+ +
- @@ -48,7 +48,7 @@ - @@ -58,7 +58,7 @@ - @@ -68,7 +68,7 @@ - @@ -78,7 +78,7 @@ - @@ -88,7 +88,7 @@ - @@ -100,10 +100,10 @@
+
+
+
+
+
+
- - diff --git a/web/templates/admin/edit_cron.html b/web/templates/admin/edit_cron.html index 9a6cd1bcb..786180a0b 100644 --- a/web/templates/admin/edit_cron.html +++ b/web/templates/admin/edit_cron.html @@ -40,7 +40,7 @@
+ +
- @@ -50,7 +50,7 @@ - @@ -60,7 +60,7 @@ - @@ -70,7 +70,7 @@ - @@ -80,7 +80,7 @@ - @@ -90,22 +90,22 @@ -
+
+
+
+
+
+
- > + >
- - @@ -113,4 +113,4 @@
+ +
- + \ No newline at end of file diff --git a/web/templates/admin/edit_db.html b/web/templates/admin/edit_db.html index 8a7af352d..96111abdd 100644 --- a/web/templates/admin/edit_db.html +++ b/web/templates/admin/edit_db.html @@ -61,7 +61,7 @@
- @@ -72,7 +72,7 @@ - @@ -83,17 +83,17 @@ - @@ -103,7 +103,7 @@ - @@ -113,7 +113,7 @@ - @@ -125,10 +125,10 @@
+
+
+ /
- +
+
+
- - diff --git a/web/templates/admin/edit_dns.html b/web/templates/admin/edit_dns.html index 017ffca65..ff28fc8e5 100644 --- a/web/templates/admin/edit_dns.html +++ b/web/templates/admin/edit_dns.html @@ -40,7 +40,7 @@
+ +
- @@ -50,7 +50,7 @@ - @@ -60,7 +60,7 @@ - @@ -81,7 +81,7 @@ - @@ -91,7 +91,7 @@ - @@ -101,7 +101,7 @@ - @@ -113,10 +113,10 @@
+
+
+
+ ()
+ SOA
+ TTL
- - diff --git a/web/templates/admin/edit_dns_rec.html b/web/templates/admin/edit_dns_rec.html index ad900fa75..b9e5f97c8 100644 --- a/web/templates/admin/edit_dns_rec.html +++ b/web/templates/admin/edit_dns_rec.html @@ -40,7 +40,7 @@
+ +
- @@ -51,7 +51,7 @@ - @@ -61,7 +61,7 @@ - @@ -71,7 +71,7 @@ - @@ -81,7 +81,7 @@ - @@ -91,7 +91,7 @@ - @@ -104,10 +104,10 @@
+
+
+
+
+ ()
+ ()
- - diff --git a/web/templates/admin/edit_ip.html b/web/templates/admin/edit_ip.html index 49e97b1c5..a166a2d14 100644 --- a/web/templates/admin/edit_ip.html +++ b/web/templates/admin/edit_ip.html @@ -52,7 +52,7 @@
+ +
- @@ -62,7 +62,7 @@ - @@ -72,7 +72,7 @@ - @@ -82,35 +82,36 @@ - - - - - - - - - @@ -120,7 +121,7 @@ - @@ -133,10 +134,10 @@
+
+
+
- + +
- + + + + + + + + +
+ +
+ +
- -
- -
+ ()
+ ()
- - @@ -144,4 +145,4 @@
+ +
- + \ No newline at end of file diff --git a/web/templates/admin/edit_mail.html b/web/templates/admin/edit_mail.html index 4f4e82006..e9317d1c2 100644 --- a/web/templates/admin/edit_mail.html +++ b/web/templates/admin/edit_mail.html @@ -40,7 +40,7 @@
- @@ -50,37 +50,22 @@ - - - - - - - - - - - - - @@ -92,10 +77,10 @@
+
- + +
- > + +
- + +
- > -
- -
- > -
+
- - diff --git a/web/templates/admin/edit_mail_acc.html b/web/templates/admin/edit_mail_acc.html index c427685b1..1ca35090a 100644 --- a/web/templates/admin/edit_mail_acc.html +++ b/web/templates/admin/edit_mail_acc.html @@ -62,7 +62,7 @@
+ +
- @@ -74,17 +74,17 @@ - @@ -94,7 +94,7 @@ - @@ -104,7 +104,7 @@ - @@ -114,27 +114,17 @@ - - - - - - - - -
+
+ /
- + ()
+ ()
+ ()
- + +
- > + +
- -
- onclick="javascript:elementHideShow('autoreplytable');"> -
+
@@ -152,10 +142,10 @@
- - diff --git a/web/templates/admin/edit_package.html b/web/templates/admin/edit_package.html index 079d637b5..e7248659e 100644 --- a/web/templates/admin/edit_package.html +++ b/web/templates/admin/edit_package.html @@ -40,7 +40,7 @@
+ +
- @@ -51,7 +51,7 @@ - @@ -74,7 +74,7 @@ - @@ -97,7 +97,7 @@ - @@ -120,7 +120,7 @@ - @@ -143,7 +143,7 @@ - @@ -153,7 +153,7 @@ - @@ -163,7 +163,7 @@ - @@ -173,7 +173,7 @@ - @@ -183,7 +183,7 @@ - @@ -193,7 +193,7 @@ - @@ -203,7 +203,7 @@ - @@ -213,7 +213,7 @@ - @@ -223,7 +223,7 @@ - @@ -233,7 +233,7 @@ - @@ -243,7 +243,7 @@ - @@ -253,7 +253,7 @@ - @@ -280,10 +280,10 @@
+
+
+
+
+
+
+ ()
+
+ ()
+
+ ()
+
+
+
+ ()
+ ()
+
- - diff --git a/web/templates/admin/edit_user.html b/web/templates/admin/edit_user.html index c1b93a3c5..bec90e90d 100644 --- a/web/templates/admin/edit_user.html +++ b/web/templates/admin/edit_user.html @@ -52,7 +52,7 @@
+ +
- @@ -62,17 +62,17 @@ - @@ -82,7 +82,7 @@ - @@ -103,7 +103,7 @@ - @@ -127,7 +127,7 @@ - @@ -137,7 +137,7 @@ - @@ -147,7 +147,7 @@ - @@ -168,7 +168,7 @@ - @@ -195,10 +195,10 @@
+
+ /
- +
+
+
+
+
+
+
- - diff --git a/web/templates/admin/list_backup.html b/web/templates/admin/list_backup.html index 3fb26ed11..b532f6b4e 100644 --- a/web/templates/admin/list_backup.html +++ b/web/templates/admin/list_backup.html @@ -1,6 +1,6 @@
+ +
-