From 5d0ac56fa87a9ef95731013f8a04423fa7a07b45 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 30 Dec 2012 14:27:24 +0200 Subject: [PATCH 01/27] UI improvement from Dmitry Naumov --- web/templates/admin/list_dns.html | 2 +- web/templates/admin/list_dns_rec.html | 7 +++++++ web/templates/admin/list_mail.html | 2 +- web/templates/admin/list_mail_acc.html | 8 ++++++++ web/templates/header.html | 21 +++++++++------------ web/templates/user/list_dns.html | 2 +- web/templates/user/list_dns_rec.html | 8 ++++++++ web/templates/user/list_mail.html | 2 +- web/templates/user/list_mail_acc.html | 8 ++++++++ 9 files changed, 44 insertions(+), 16 deletions(-) diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index 348068aa9..621603092 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -54,7 +54,7 @@ - +
list records list records add record edit diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index 71b3a28b7..b1cf4f026 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -30,6 +30,13 @@
+ + + + +
+ Listing +
$value) { diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index abfdab333..4d77283e3 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -58,7 +58,7 @@
- + diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index 8fe8d50b0..4c0647399 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -30,6 +30,14 @@
list accounts list accounts add account " target="_blank"> open webmail edit
+ + + + +
+ Listing +
+ $value) { diff --git a/web/templates/header.html b/web/templates/header.html index 1d1447c31..10eedcf57 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -34,7 +34,7 @@ .top { - background: #555; + background: #444; color: #cce4f0; padding: 0; margin-left: auto; @@ -85,14 +85,10 @@ .nav-lnk { text-decoration: none; - color: #555; + color: #444; float:left; } - .nav-lnk:hover { - color: #333; - } - .nav-lnk:active { color: #ccc; } @@ -372,24 +368,24 @@ } .username { - color: #555555; + color: #555; font-size: 16pt; line-height: 1.2em; } .domain { - color: #555555; + color: #555; font-size: 16pt; line-height: 0.8em; } .cron { - color: #555555; + color: #555; font-size: 18px; } .log { - color: #555555; + color: #555; font-size: 12pt; } @@ -477,6 +473,7 @@ } .vst-text { + color: #555; font-size: 12pt; } @@ -484,7 +481,7 @@ background-color: #FFFFFF; border: 1px solid #999999; border-radius: 3px 3px 3px 3px; - color: #555555; + color: #555; font-size: 18px; padding: 6px; width: 360px; @@ -503,7 +500,7 @@ background-color: #FFFFFF; border: 1px solid #999999; border-radius: 3px 3px 3px 3px; - color: #555555; + color: #555; font-size: 14pt; padding: 6px; width: 360px; diff --git a/web/templates/user/list_dns.html b/web/templates/user/list_dns.html index 363468a48..64c457497 100644 --- a/web/templates/user/list_dns.html +++ b/web/templates/user/list_dns.html @@ -52,7 +52,7 @@
- +
list records list records add record edit diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 83ec89d6d..337ff6128 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -28,6 +28,14 @@
+ + + + +
+ Listing +
+ $value) { diff --git a/web/templates/user/list_mail.html b/web/templates/user/list_mail.html index 30c8f71f3..35103c385 100644 --- a/web/templates/user/list_mail.html +++ b/web/templates/user/list_mail.html @@ -56,7 +56,7 @@
- + diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html index 80166f241..7e26f2bf3 100644 --- a/web/templates/user/list_mail_acc.html +++ b/web/templates/user/list_mail_acc.html @@ -28,6 +28,14 @@
list accounts list accounts add account " target="_blank"> open webmail edit
+ + + + +
+ Listing +
+ $value) { From 356c4b2da3c931b475fb626d4837a4c9dde1c7dc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 30 Dec 2012 21:55:38 +0200 Subject: [PATCH 02/27] commented out smpam check in exim --- install/0.9.7/rhel/exim.conf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install/0.9.7/rhel/exim.conf b/install/0.9.7/rhel/exim.conf index a97cc2495..545cdb5eb 100644 --- a/install/0.9.7/rhel/exim.conf +++ b/install/0.9.7/rhel/exim.conf @@ -56,9 +56,9 @@ acl_check_mail: 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 +# 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}} @@ -70,11 +70,11 @@ acl_check_mail: 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 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 From 18c7501ed37f1757f94b52c813ac854469981812 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 30 Dec 2012 23:19:33 +0200 Subject: [PATCH 03/27] more contrast on vst-text --- web/templates/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/templates/header.html b/web/templates/header.html index 10eedcf57..5e664a16b 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -473,7 +473,7 @@ } .vst-text { - color: #555; + color: #333; font-size: 12pt; } From ed4ae4530e9d5ff972dfca3da056a76b4248484c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 31 Dec 2012 00:05:28 +0200 Subject: [PATCH 04/27] send database credentials to email --- web/add/db/index.php | 20 ++++++++++++++++++++ web/templates/admin/add_db.html | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/web/add/db/index.php b/web/add/db/index.php index e23f205ed..104d1db5c 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -28,6 +28,7 @@ top_panel($user,$TAB); $v_password = escapeshellarg($_POST['v_password']); $v_type = $_POST['v_type']; $v_charset = $_POST['v_charset']; + if (empty($_POST['v_notify'])) $v_notify = 'off'; // Check for errors if (!empty($errors[0])) { @@ -53,6 +54,25 @@ top_panel($user,$TAB); unset($v_password); unset($output); } else { + if (empty($v_notify)) { + list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]); + if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/"; + if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/"; + + $to = $panel[$user]['CONTACT']; + $subject = "Database Credentials"; + $hostname = exec('hostname'); + $from = "Vesta Control Panel "; + $mailtext = "Hello ".$panel[$user]['FNAME']." ".$panel[$user]['LNAME'].",\n"; + $mailtext .= "your ".$_POST['v_type']." database has been created successfully.\n\n"; + $mailtext .= "database: ".$user."_".$_POST['v_database']."\n"; + $mailtext .= "username: ".$user."_".$_POST['v_dbuser']."\n"; + $mailtext .= "password: ".$_POST['v_password']."\n\n"; + $mailtext .= $db_admin_link."\n\n"; + + $mailtext .= "--\nVesta Control Panel\n"; + send_email($to, $subject, $mailtext, $from); + } $_SESSION['ok_msg'] = "OK: database ".$user."_".$_POST['v_database']." has been created successfully."; unset($v_database); unset($v_dbuser); diff --git a/web/templates/admin/add_db.html b/web/templates/admin/add_db.html index e978bd549..cb6b41492 100644 --- a/web/templates/admin/add_db.html +++ b/web/templates/admin/add_db.html @@ -162,6 +162,15 @@ + + + + +
+ Send credentials to +
+ > +
From 22274b2b11ef9a08a3063d4a8bcd3738ced99d91 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 31 Dec 2012 12:58:57 +0200 Subject: [PATCH 05/27] switched roundcube driver to sockets --- install/0.9.7/rhel/roundcube-driver.php | 40 ++++++++++++++----------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/install/0.9.7/rhel/roundcube-driver.php b/install/0.9.7/rhel/roundcube-driver.php index 22877047a..0fb2c4bed 100644 --- a/install/0.9.7/rhel/roundcube-driver.php +++ b/install/0.9.7/rhel/roundcube-driver.php @@ -25,25 +25,31 @@ class rcube_vesta_password $vesta_port = '8083'; } - $request = 'email='.$_SESSION['username'].'&'; - $request .= 'password='.$curpass.'&'; - $request .= 'new='.$passwd.'&'; + $postvars = array( + 'email' => $_SESSION['username'], + 'password' => $curpass, + 'new' => $passwd + ); + + $postdata = http_build_query($postvars); + + $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL; + $send .= 'Host: ' . $vesta_host . PHP_EOL; + $send .= 'User-Agent: PHP Script' . PHP_EOL; + $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL; + $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL; + $send .= 'Connection: close' . PHP_EOL; + $send .= PHP_EOL; + $send .= $postdata . PHP_EOL . PHP_EOL; + + $fp = fsockopen('ssl://' . $vesta_host, $vesta_port); + fputs($fp, $send); + $result = fread($fp, 2048); + fclose($fp); - $context = stream_context_create(array( - 'http' => array( - 'method' => 'POST', - 'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL, - 'content' => $request, - ), - )); - - $result = file_get_contents( - $file = "https://".$vesta_host.":".$vesta_port."/reset/mail/?", - $use_include_path = false, - $context); - - if ($result == 'ok'){ + if(strpos($result, 'ok') && !strpos($html, 'error')) + { return PASSWORD_SUCCESS; } else { From dd9b517d31c1a933bb6333b1913656f1e253d3b3 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 31 Dec 2012 15:01:59 +0200 Subject: [PATCH 06/27] fix table margin for ie --- web/templates/admin/list_dns_rec.html | 4 +++- web/templates/admin/list_mail_acc.html | 5 +++-- web/templates/user/list_dns_rec.html | 5 +++-- web/templates/user/list_mail_acc.html | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index b1cf4f026..07df2c66f 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -30,13 +30,15 @@
- +
+
Listing
+
$value) { diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index 4c0647399..c00a349f5 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -30,14 +30,15 @@
- +
+
Listing
- +
$value) { diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 337ff6128..45d2a58c1 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -28,14 +28,15 @@
- +
+
Listing
- +
$value) { diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html index 7e26f2bf3..349d85b3d 100644 --- a/web/templates/user/list_mail_acc.html +++ b/web/templates/user/list_mail_acc.html @@ -28,14 +28,15 @@
- +
+
Listing
- +
$value) { From 939e5907d25bf02b527c402ca4303e85889b355a Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 1 Jan 2013 20:38:17 +0200 Subject: [PATCH 07/27] bugfix for wrong stats calculation --- bin/v-update-user-stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-user-stats b/bin/v-update-user-stats index 1ddf95654..366c4a5cd 100755 --- a/bin/v-update-user-stats +++ b/bin/v-update-user-stats @@ -68,7 +68,7 @@ TOTAL_U_BACKUPS=0 for user in $user_list; do USER_DATA=$VESTA/data/users/$user source $USER_DATA/user.conf - next_month=$(date +'%m/01' -d '+ 1 month') + next_month=$(date +'%m/01/%y' -d '+ 1 month') DATE=$(date -d "$next_month -1day" +%F) # Compiling report string From 858dfe028078cd48dbf32bc5cca7c37204cd1e18 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 1 Jan 2013 20:57:43 +0200 Subject: [PATCH 08/27] pathc for ftp username bug which was found by imperio --- web/edit/web/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index f453fb5ba..1245082ac 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -505,7 +505,7 @@ top_panel($user,$TAB); $_SESSION['error_msg'] = $error; } unset($output); - $v_ftp_user = $user."_".$_POST['v_ftp_user']; + $v_ftp_user = $_POST['v_ftp_user']; $v_ftp_password = "••••••••"; } } From 26b96e11cd39de68fb317a4485adb89be1511566 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jan 2013 00:08:27 +0200 Subject: [PATCH 09/27] bugfix for domalias ownership check --- func/domain.sh | 114 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 102 insertions(+), 12 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index 3ac064766..fe76eabbf 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -48,28 +48,118 @@ is_dns_template_valid() { is_domain_new() { type="$1" dom=${2-$domain} - web="$(grep -w $dom $VESTA/data/users/*/web.conf)" - dns="$(grep DOMAIN='$dom' $VESTA/data/users/*/dns.conf)" - mail="$(grep DOMAIN='$dom' $VESTA/data/users/*/mail.conf)" - if [ -n "$web" ] || [ -n "$dns" ] || [ -n "$mail" ]; then - if [ ! -z "$(grep -w $dom $USER_DATA/*.conf)" ]; then - c1=$(grep "'$dom'" $USER_DATA/$type.conf) - c2=$(grep "'$dom," $USER_DATA/$type.conf) - c3=$(grep ",$dom," $USER_DATA/$type.conf) - c4=$(grep ",$dom'" $USER_DATA/$type.conf) + web=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/web.conf) + dns=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf) + mail=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf) - if [ -n "$c1" ] || [ -n "$c2" ] || [ -n "$c3" ] || [ -n "$c4" ] - then + # Check web domain + if [ ! -z "$web" ] && [ "$type" == 'web' ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$web" ]; then + web_user=$(echo "$web" |cut -f 7 -d /) + if [ "$web_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi + + # Check dns domain + if [ ! -z "$dns" ] && [ "$type" == 'dns' ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$dns" ]; then + dns_user=$(echo "$dns" |cut -f 7 -d /) + if [ "$dns_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi + + # Check mail domain + if [ ! -z "$mail" ] && [ "$type" == 'mail' ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$mail" ]; then + mail_user=$(echo "$mail" |cut -f 7 -d /) + if [ "$mail_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi + + # Check web aliases + web_alias=$(grep -w $dom $VESTA/data/users/*/web.conf) + if [ ! -z "$web_alias" ]; then + c1=$(grep "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c2=$(grep "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c3=$(grep ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c4=$(grep ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) + if [ ! -z "$c1" ] && [ "$type" != "web" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$c1" ]; then + c1_user=$(echo "$c1" |cut -f 7 -d /) + if [ "$c1_user" != "$user" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi - else + fi + + if [ ! -z "$c2" ] && [ "$type" != "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi + if [ ! -z "$c2" ]; then + c2_user=$(echo "$c2" |cut -f 7 -d /) + if [ "$c2_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi + + if [ ! -z "$c3" ] && [ "$type" != "web" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$c3" ]; then + c3_user=$(echo "$c3" |cut -f 7 -d /) + if [ "$c3_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi + + if [ ! -z "$c4" ] && [ "$type" != "web" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + if [ ! -z "$c4" ]; then + c1_user=$(echo "$c4" |cut -f 7 -d /) + if [ "$c4_user" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS + fi + fi fi } From 0ef19bf3a183ef2741c811cdbdbe9ba63b37b440 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jan 2013 13:27:43 +0200 Subject: [PATCH 10/27] added option for disabling remi repo --- install/vst-install.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/install/vst-install.sh b/install/vst-install.sh index f301bf6cc..056ac32ce 100644 --- a/install/vst-install.sh +++ b/install/vst-install.sh @@ -10,9 +10,9 @@ VERSION='0.9.7' YUM_REPO='/etc/yum.repos.d/vesta.repo' arch=$(uname -i) -tools="screen mc libpng libjpeg curl curl libmcrypt libmcrypt mhash mhash - freetype openssl flex libxml2 ImageMagick sqlite sqlite pcre pcre sudo bc - mailx lsof ntp tar whois telnet rsync" +tools="screen mc libpng libjpeg curl libmcrypt mhash zip unzip freetype ntp + openssl flex libxml2 ImageMagick sqlite pcre sudo bc jwhois mailx lsof + tar telnet rsync" rpms="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid ftp webalizer awstats mysql mysql-server php php-bcmath php-cli php-common @@ -40,6 +40,7 @@ release=$(grep -o "[0-9]" /etc/redhat-release |head -n1) help() { echo "usage: $0 [OPTIONS] + -d, --disable-remi Disable remi -e, --email Define email address -h, --help Print this help and exit -f, --force Force installation" @@ -51,6 +52,7 @@ for arg; do delim="" case "$arg" in --help) args="${args}-h " ;; + --disable-remi) args="${args}-d " ;; --force) args="${args}-f " ;; --email) args="${args}-e " ;; *) [[ "${arg:0:1}" == "-" ]] || delim="\"" @@ -60,8 +62,9 @@ done eval set -- "$args" # Getopt -while getopts "hfe:" Option; do +while getopts "dhfe:" Option; do case $Option in + d) disable_remi='yes' ;; # Disable remi repo h) help ;; # Help e) email=$OPTARG ;; # Contact email f) force=yes ;; # Force install @@ -249,8 +252,12 @@ if [ -e '/root/.my.cnf' ]; then mv -f /root/.my.cnf fi -# Vesta packages -yum -y --enablerepo=remi install $rpms +# Install Vesta packages +if [ -z "$disable_remi" ]; then + yum -y --enablerepo=remi install $rpms +else + yum -y install $rpms +fi if [ $? -ne 0 ]; then echo 'Error: yum install failed' exit 1 @@ -501,6 +508,8 @@ sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php wget $CHOST/$VERSION/httpd-webmail.conf -O /etc/httpd/conf.d/roundcubemail.conf wget $CHOST/$VERSION/roundcube-main.conf -O /etc/roundcubemail/main.inc.php wget $CHOST/$VERSION/roundcube-db.conf -O /etc/roundcubemail/db.inc.php +wget $CHOST/$VERSION/roundcube-driver.php -O /usr/share/roundcubemail/plugins/password/vesta.php +wget $CHOST/$VERSION/roundcube-pw.conf -O /usr/share/roundcubemail/plugins/password/config.inc.php r="$(gen_pass)" mysql -e "CREATE DATABASE roundcube" From ca23ae66d2f3645f57f62a5af334ed8356ae2888 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jan 2013 18:06:46 +0200 Subject: [PATCH 11/27] additional improvements for domain verification --- bin/v-add-dns-on-web-alias | 15 ++++++++--- func/domain.sh | 52 +++++++++++++++----------------------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/bin/v-add-dns-on-web-alias b/bin/v-add-dns-on-web-alias index 7b9e2f7d5..1c0077c7e 100755 --- a/bin/v-add-dns-on-web-alias +++ b/bin/v-add-dns-on-web-alias @@ -49,15 +49,21 @@ get_domain_values 'web' # Check if it a simple domain if [ $(echo -e "${dom_alias//\./\n}" | wc -l) -le 2 ]; then if [ ! -e "$USER_DATA/dns/$dom_alias.conf" ]; then - $BIN/v-add-dns-domain $user $dom_alias $IP '' '' '' '' '' $restart + $BIN/v-add-dns-domain \ + $user $dom_alias $IP '' '' '' '' '' $restart > /dev/null fi else # Check subdomain sub=$(echo "$dom_alias" | cut -f1 -d . -s) dom=$(echo "$dom_alias" | sed -e "s/^$sub.//" ) if [ ! -e "$USER_DATA/dns/$dom.conf" ]; then - $BIN/v-add-dns-domain $user $dom $IP '' '' '' '' '' $restart - $BIN/v-add-dns-domain-record $user $dom "$sub" A $IP '' '' $restart + $BIN/v-add-dns-domain \ + $user $dom $IP '' '' '' '' '' $restart > /dev/null + + if [ $? -eq 0 ]; then + $BIN/v-add-dns-domain-record \ + $user $dom "$sub" A $IP '' '' $restart + fi else if [ "$sub" == '*' ]; then rec=$(grep -w "RECORD='\*'" $USER_DATA/dns/$dom.conf) @@ -65,7 +71,8 @@ else rec=$(grep -w "RECORD='$sub'" $USER_DATA/dns/$dom.conf) fi if [ -z "$rec" ]; then - $BIN/v-add-dns-domain-record $user $dom "$sub" A $IP '' '' $restart + $BIN/v-add-dns-domain-record \ + $user $dom "$sub" A $IP '' '' $restart > /dev/null fi fi fi diff --git a/func/domain.sh b/func/domain.sh index fe76eabbf..a62cc1b41 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -105,60 +105,48 @@ is_domain_new() { c2=$(grep "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) c3=$(grep ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) c4=$(grep ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) - if [ ! -z "$c1" ] && [ "$type" != "web" ]; then + if [ ! -z "$c1" ] && [ "$type" == "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi - if [ ! -z "$c1" ]; then - c1_user=$(echo "$c1" |cut -f 7 -d /) - if [ "$c1_user" != "$user" ]; then - echo "Error: domain $dom exist" - log_event "$E_EXISTS" "$EVENT" - exit $E_EXISTS - fi + if [ ! -z "$c1" ] && [ "$c1" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS fi - if [ ! -z "$c2" ] && [ "$type" != "web" ]; then + if [ ! -z "$c2" ] && [ "$type" == "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi - if [ ! -z "$c2" ]; then - c2_user=$(echo "$c2" |cut -f 7 -d /) - if [ "$c2_user" != "$user" ]; then - echo "Error: domain $dom exist" - log_event "$E_EXISTS" "$EVENT" - exit $E_EXISTS - fi + if [ ! -z "$c2" ] && [ "$c2" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS fi - if [ ! -z "$c3" ] && [ "$type" != "web" ]; then + if [ ! -z "$c3" ] && [ "$type" == "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi - if [ ! -z "$c3" ]; then - c3_user=$(echo "$c3" |cut -f 7 -d /) - if [ "$c3_user" != "$user" ]; then - echo "Error: domain $dom exist" - log_event "$E_EXISTS" "$EVENT" - exit $E_EXISTS - fi + if [ ! -z "$c3" ] && [ "$c3" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS fi - if [ ! -z "$c4" ] && [ "$type" != "web" ]; then + if [ ! -z "$c4" ] && [ "$type" == "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi - if [ ! -z "$c4" ]; then - c1_user=$(echo "$c4" |cut -f 7 -d /) - if [ "$c4_user" != "$user" ]; then - echo "Error: domain $dom exist" - log_event "$E_EXISTS" "$EVENT" - exit $E_EXISTS - fi + if [ ! -z "$c4" ] && [ "$c4" != "$user" ]; then + echo "Error: domain $dom exist" + log_event "$E_EXISTS" "$EVENT" + exit $E_EXISTS fi fi } From 729c38416433c73930b46cc075d32f1851e80100 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Jan 2013 13:34:29 +0200 Subject: [PATCH 12/27] added verification for not uniq ftp user account --- bin/v-add-web-domain-ftp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 52e15038d..5c273b221 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -43,8 +43,14 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain" # Action # #----------------------------------------------------------# -# Get domain values get_domain_values 'web' +check_ftp_user=$(grep "^$ftp_user:" /etc/passwd) +if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then + echo "Error: ftp user $ftp_user already exists" + log_event "$E_EXISTS $EVENT" + exit $E_EXISTS +fi + if [ ! -z "$FTP_USER" ]; then /usr/sbin/userdel $FTP_USER fi From d86e5e1c82453f62984092cf8277900659f6e4f4 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 10 Jan 2013 00:57:49 +0200 Subject: [PATCH 13/27] added dash as a valid character --- func/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 697ef4ff7..a3ba87f33 100644 --- a/func/main.sh +++ b/func/main.sh @@ -556,7 +556,7 @@ validate_format_email() { # Username validate_format_username() { - if ! [[ "$1" =~ ^[a-zA-Z0-9]+([\.|_][a-zA-Z0-9]+)?$ ]]; then + if ! [[ "$1" =~ ^[a-zA-Z0-9]+([\.|_|-][a-zA-Z0-9]+)?$ ]]; then echo "Error: $2 $1 is not valid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID From 994c40901078e48fe939536f7b366e29c2e44a1d Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 10 Jan 2013 11:59:25 +0200 Subject: [PATCH 14/27] proper perms for fcgid --- bin/v-rebuild-web-domains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains index 5534b3c53..9598ed109 100755 --- a/bin/v-rebuild-web-domains +++ b/bin/v-rebuild-web-domains @@ -78,7 +78,7 @@ for domain in $(shell_list) ; do chmod 551 $HOMEDIR/$user/web/$domain chmod 771 $HOMEDIR/$user/web/$domain/private - chmod 771 $HOMEDIR/$user/web/$domain/cgi-bin + chmod 751 $HOMEDIR/$user/web/$domain/cgi-bin chmod 771 $HOMEDIR/$user/web/$domain/public_html chmod 771 $HOMEDIR/$user/web/$domain/public_shtml chmod 771 $HOMEDIR/$user/web/$domain/document_errors From c9dca4e2cf26baf3cfeb85f49d3b2584edebac53 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 11 Jan 2013 00:21:37 +0200 Subject: [PATCH 15/27] less history to improve listing speed --- func/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index a3ba87f33..48ff7bf24 100644 --- a/func/main.sh +++ b/func/main.sh @@ -64,7 +64,7 @@ log_history() { touch $log if [ '99' -lt "$(wc -l $log |cut -f 1 -d ' ')" ]; then - tail -n 99 $log > $log.moved + tail -n 49 $log > $log.moved mv -f $log.moved $log chmod 660 $log fi From 1e2732c9785c58d327d209fb386543272dfef381 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 11 Jan 2013 01:11:28 +0200 Subject: [PATCH 16/27] list system services --- bin/v-list-sys-services | 205 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100755 bin/v-list-sys-services diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services new file mode 100755 index 000000000..f04eb3d74 --- /dev/null +++ b/bin/v-list-sys-services @@ -0,0 +1,205 @@ +#!/bin/bash +# info: list system config +# options: [FORMAT] +# +# The function for obtaining the list of system parameters. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +format=${1-shell} + +# Includes +source $VESTA/conf/vesta.conf +source $VESTA/func/main.sh + +get_srv_state() { + srv=$1 + proc_name=${2-$1} + + # Check service status + /etc/init.d/$srv status > /dev/null 2>&1 + if [ $? -eq 0 ]; then + state='running' + + # Calculate cpu and memory usage + cpu=0 + mem=0 + for pid in $(/sbin/pidof $proc_name); do + pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}') + pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ') + cpu=$((cpu + pid_cpu)) + mem=$((mem + pid_mem)) + done + mem=$((mem / 1024)) + + # Get pid date + if [ ! -z $pid ] && [ -e "/proc/$pid/cmdline" ]; then + mtime=$(stat -c "%Y" /proc/$pid/cmdline) + ptime=$(date -d @$mtime +%T) + pdate=$(date -d @$mtime +%F) + fi + else + # Service is stopped + state='stopped' + mem=0 + cpu=0 + ptime="$TIME" + pdate="$DATE" + fi +} + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Save current proccess list +tmp_file=$(mktemp) +ps aux | awk '{print $2" "$3}' | cut -f 1 -d '.' > $tmp_file + +# Proxy +service=$PROXY_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service +fi +str="NAME='$service' SYSTEM='proxy' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# Web +service=$WEB_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + if [ "$service" == 'apache' ]; then + service='httpd' + fi + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='web' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# DNS +service=$DNS_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + if [ "$service" == 'bind' ]; then + service='named' + fi + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='dns' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# MAIL +service=$MAIL_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='mail' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# IMAP +service=$IMAP_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='imap' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# ANTIVIRUS +service=$ANTIVIRUS_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + if [ "$ANTIVIRUS_SYSTEM" = 'clamav' ]; then + service='clamd' + fi + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='antivirus' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# ANTISPAM +service=$ANTISPAM_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service spamd +fi +str="$str\nNAME='$service' SYSTEM='antispam' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# DB +service=$DB_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + for db in ${DB_SYSTEM//,/ }; do + service="$db" + if [ "$service" == 'mysql' ] && [ ! -e "/etc/init.d/$service" ]; then + service='mysqld' + fi + get_srv_state $service + str="$str\nNAME='$service' SYSTEM='db' STATE='$state' CPU='$cpu'" + str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + done +else + str="$str\nNAME='$service' SYSTEM='db' STATE='$state' CPU='$cpu''" + str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" +fi + +# FTP +service=$FTP_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='ftp' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# CRON +service=$CRON_SYSTEM +spnd='yes' +if [ ! -z "$service" ] && [ "$service" != 'no' ]; then + spnd='no' + get_srv_state $service +fi +str="$str\nNAME='$service' SYSTEM='ftp' STATE='$state' CPU='$cpu'" +str="$str MEM='$mem' SUSPENDED='$spnd' TIME='$ptime' DATE='$pdate'" + +# Defining config + +echo -e "$str" > $tmp_file +conf=$tmp_file + +# Defining fileds to select +fields="\$NAME \$SYSTEM \$STATE \$CPU \$MEM \$SUSPENDED \$TIME \$DATE" + +# Listing services +case $format in + json) json_list ;; + plain) nohead=1; shell_list ;; + shell) fields='$NAME $STATE $CPU $MEM $SUSPENDED $TIME $DATE' + shell_list | column -t ;; + *) check_args '1' '0' 'USER [FORMAT]' +esac + +rm -f $tmp_file + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit From 169bd25e08b5ffc5c1d632353d1579cda4270efe Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 13 Jan 2013 13:16:06 +0200 Subject: [PATCH 17/27] replaced underlines in rebuild script --- bin/v-rebuild-user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-rebuild-user b/bin/v-rebuild-user index ee71c53a7..bf73475d4 100755 --- a/bin/v-rebuild-user +++ b/bin/v-rebuild-user @@ -143,7 +143,7 @@ fi if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then touch $USER_DATA/db.conf chmod 660 $USER_DATA/db.conf - echo "v_update_datbases_disk $user" >> $VESTA/data/queue/disk.pipe + echo "v-update-datbases-disk $user" >> $VESTA/data/queue/disk.pipe fi if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'no' ]; then From a900cba77ca779031a4e899d4629a9603378a9e7 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 13 Jan 2013 18:03:35 +0200 Subject: [PATCH 18/27] switching from addhandler to sethandler --- install/0.9.7/rhel/templates/web/apache_phpcgi.stpl | 9 +++++---- install/0.9.7/rhel/templates/web/apache_phpcgi.tpl | 9 +++++---- install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl | 9 +++++---- install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl | 9 +++++---- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl b/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl index 4a4a386c0..b56dbc37a 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl +++ b/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl @@ -12,12 +12,13 @@ CustomLog /var/log/httpd/domains/%domain%.log combined %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log - AllowOverride AuthConfig FileInfo Indexes Limit SSLRequireSSL - Options +Includes -Indexes %cgi_option% - php_admin_flag engine off + AllowOverride All + Options +Includes -Indexes +ExecCGI Action phpcgi-script /cgi-bin/php - AddHandler phpcgi-script .php + + SetHandler phpcgi-script + AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl b/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl index ce58bf2b8..4fd56c33a 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl +++ b/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl @@ -12,11 +12,12 @@ CustomLog /var/log/httpd/domains/%domain%.log combined %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log - AllowOverride AuthConfig FileInfo Indexes Limit - Options +Includes -Indexes %cgi_option% - php_admin_flag engine off + AllowOverride All + Options +Includes -Indexes +ExecCGI Action phpcgi-script /cgi-bin/php - AddHandler phpcgi-script .php + + SetHandler phpcgi-script + AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl b/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl index 1fd9c8cdd..76548ddd9 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl +++ b/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl @@ -12,11 +12,12 @@ CustomLog /var/log/httpd/domains/%domain%.log combined %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log - AllowOverride AuthConfig FileInfo Indexes Limit SSLRequireSSL - Options +Includes -Indexes %cgi_option% - php_admin_flag engine off - AddHandler fcgid-script .php + AllowOverride All + Options +Includes -Indexes +ExecCGI + + SetHandler fcgid-script + FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php diff --git a/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl b/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl index 2bca8ac76..2ae2a212f 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl +++ b/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl @@ -12,10 +12,11 @@ CustomLog /var/log/httpd/domains/%domain%.log combined %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log - AllowOverride AuthConfig FileInfo Indexes Limit - Options +Includes -Indexes %cgi_option% - php_admin_flag engine off - AddHandler fcgid-script .php + AllowOverride All + Options +Includes -Indexes +ExecCGI + + SetHandler fcgid-script + FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php From cdf891e1520be6758d770466c6689f4176194466 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 13 Jan 2013 18:13:49 +0200 Subject: [PATCH 19/27] enable short_open_tag support --- install/vst-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/vst-install.sh b/install/vst-install.sh index 056ac32ce..7b5cf1764 100644 --- a/install/vst-install.sh +++ b/install/vst-install.sh @@ -412,6 +412,9 @@ chmod 640 /var/log/httpd/error_log chmod 640 /var/log/httpd/suexec.log chmod 751 /var/log/httpd/domains +# Enable short_open_tag in php config +sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php.ini + # Nginx if [ -e '/etc/nginx/nginx.conf' ]; then mv /etc/nginx/nginx.conf $vst_backups/nginx/ From db426ff50d75b44bed4085f8372636d6182b7b5b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 13 Jan 2013 19:04:09 +0200 Subject: [PATCH 20/27] bugfix for existring domain bug --- func/domain.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index a62cc1b41..42ded59ce 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -49,9 +49,9 @@ is_domain_new() { type="$1" dom=${2-$domain} - web=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/web.conf) - dns=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf) - mail=$(grep "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf) + web=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/web.conf) + dns=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf) + mail=$(grep -H "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf) # Check web domain if [ ! -z "$web" ] && [ "$type" == 'web' ]; then @@ -101,10 +101,10 @@ is_domain_new() { # Check web aliases web_alias=$(grep -w $dom $VESTA/data/users/*/web.conf) if [ ! -z "$web_alias" ]; then - c1=$(grep "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) - c2=$(grep "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) - c3=$(grep ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) - c4=$(grep ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c1=$(grep -H "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c2=$(grep -H "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c3=$(grep -H ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /) + c4=$(grep -H ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /) if [ ! -z "$c1" ] && [ "$type" == "web" ]; then echo "Error: domain $dom exist" log_event "$E_EXISTS" "$EVENT" From a326960d54cddf1701bd6808d56a21344caa3612 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 14 Jan 2013 18:43:02 +0200 Subject: [PATCH 21/27] more contrast color scheme --- web/images/logo.png | Bin 5953 -> 5014 bytes web/templates/admin/list_rrd.html | 8 +-- web/templates/admin/list_stats.html | 2 +- web/templates/admin/panel.html | 16 ++--- web/templates/footer.html | 10 +--- web/templates/header.html | 89 +++++++++++++++------------- web/templates/user/panel.html | 16 ++--- 7 files changed, 70 insertions(+), 71 deletions(-) diff --git a/web/images/logo.png b/web/images/logo.png index bbabeeeded9ab348104f3c154b3f4f4b31b19131..19acb5a434eb45303ede3cb50d287a499a734b54 100644 GIT binary patch delta 2288 zcmV-zY2c{!AV3xRCwC#oPTH?RTjrTF(n{8C<)CXWQinJTp})&CtWI) zF7;)JR9uv%mX=C`l2GZQC^i*EP!to3N};qQv{)>PHf05IQS58k;-VmZ5Gcw9Yl^`K z!Ac&*V4x7Pf6RCAdVA;Ro7c46IWWAr^W)Ck`@QF!?>YC*Yg&I=S|XSKAGs;-f*kN% zZeUsQyVBdYXH{eG|*$5>jTDsS2ZAVS#}Li zCVjw8U=|qB?`~kV&UXRN0RzBV;8Ww?)xg%g`>!9sH#h)%&|$_`>bGbeU#H)l+OGop zfQ1~AYZLG;tL%RRdH~n~bO^koI{q1O8E8@YTVNaTjx{)*%^|rq0B;k>7l1hdIB)pk zN&QxVJEig88X9{6_`6L0Eby8JhD+;nS>~{8y$IM@{oW(TpJp`%kaf3fkEIOz}MRPM9w}Fh#!9dn{@qd;CA`ymvwBLH2)Cr z2=EXvrE(jvS1#c+a3t#Gc09V(bSaetZ7*p6Pv7Vue|oB%NW(9NoO?;+?HS;6fxq53 z-y&1p6JWkS0-hAhzXTlC;Mu1A4KdztSk~vP!)mysRc`4d@V$Wd2f!S#6k|K?sB>6# zn%A9_f|!4DJmxdZZ8)Ia{`rwCP5M4*AOhuRh~MpXbovDWYn$&*;2Ypq;77TNo&Yi! zrK#qAcf|Gm0?2+w(K;Sghk5^5b$ZG1Zeu#%>bN(FHF5!N?zh$hc(Y>XH6mhv0`3O> zC;*GP=8SdUjLiK}nb&7!_CExkkk20g_5)8D0C#@?F90V}`1MK%7;!o;jY*#{H2Zjr zK~^*rVIsx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sd+ zY?i!f)+`N=#C<5)EZy8T13wV6dsZ0y@08=6XrB*>tQG$}D&#N2R)=LtDk;?l&2qTK zzmI51dnz&(p361852+vDA+#z7UubAb#Bw6yB z0_I6E#~Wq)Ibr;&#%>fVkxRBIwzC+=Ok902#{j96foWgHR5l7b-BM%=w;K8lFtKnY`RW>(U7V z{;XPXy+~n9{B5SvbWAyKqjKJU3G;p-u3%TOJv%qQge%T{xE>OP9GKIC1++b+T{ob( zfG*{JBMw38QLK@E{v(RU9(4HLAv=H9W2k@XGq8OhZdZ~U8qag<^3U*A#nf|mNGv{# z`F+?6qQz0*hthb5FzW#3hl71GC{_vJlf{4?OL#eT;bumsZsg(LK1D@}mqnQjQ_GvV zINPFsrn_H4sK;c)Wqh+wNLJ>%vvKk7eZtVy4-tC`dAKwN@q~x-)9p;mwp4$<6)%BU zPE^Mhyo^rWNWJee^}fqi)1Jc?zPTUxnL>E(1|HI~bK9}`{wtj}h$lTHQ*K;F>MBVa zpK0a7Ogqt-uYy*&08e9ZIa<#blQ*%d?F_Zvh@K1ID_Y(oOn$$xcvbGPFyWRe8c%o_ zpK0TKsGWGigWHuf2SCEZ{6c?CMYGEdI6xv<#l&nY)$RpuYCcDuH7fpnTuVF&$JO=@Z>9nsz|v22Z%3t7@J;B8iTHuv-$qUYnQ~# z>x8gn{{7)j@#SMErOoNIX+_RVbTKj8>ZA;+A|()`^4FW+a+Y3^3g8
diff --git a/web/templates/admin/list_stats.html b/web/templates/admin/list_stats.html index a46ba1b01..8fdd43470 100644 --- a/web/templates/admin/list_stats.html +++ b/web/templates/admin/list_stats.html @@ -4,7 +4,7 @@
- href='/list/stats/'>Overall Statistics + href='/list/stats/'>Overall Statistics
- - - - - - - + + + + + + + -
PackagesIP AdressesRRD GraphicsStatisticsHistory LogLog outPackagesIP AdressesRRD GraphicsStatisticsHistory LogLog out
+
@@ -16,7 +8,7 @@ VE.core.register($('.main')); }); - +
diff --git a/web/templates/header.html b/web/templates/header.html index 5e664a16b..a9bdbcc9f 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -22,7 +22,10 @@ .main { background: #ffffff; + padding: 0 0 12px 0; box-shadow: 0 0 2px 2px #d7d7d7; + border-bottom: 1px solid #cccccc; + border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; - - - - - - - + + + + + + + - + +
StatisticsHistory LogLog outStatisticsHistory LogLog out
+
+ +
+ + + $value) { + ++$i; + if ($data[$key]['STATE'] == 'running') { + $status = 'active'; + $action = 'stop'; + } else { + $status = 'suspended'; + $action = 'start'; + } + + $cpu = $data[$key]['CPU'] / 10; + $cpu = number_format($cpu, 1); + if ($cpu == '0.0') $cpu = 0; + ?> + + + + + + + +
+ + + +
+
+ + + + + + +
restart
+ + + + + + + + + + + +
+ +
+ + + + +
+ +
+
+ + + + + +
+ CPU: + + % +
+
+ + + + + +
+ Memory: + + mb +
+
+ + + + + +
+ Run Time: + + +
+
+
+ + +
diff --git a/web/templates/header.html b/web/templates/header.html index 5bb1e34f6..f85516a41 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -311,7 +311,7 @@ .data-suspended { font-size: 8pt; letter-spacing: 0.1em; - color: #de6c5d; + color: #de5543; padding: 0 0 13 18; }