From bb145d234a17800f8e43545899c8df9b363391a5 Mon Sep 17 00:00:00 2001 From: Cameron McDonald Date: Mon, 15 Dec 2014 10:49:37 -0600 Subject: [PATCH 01/13] Cut blank lines when counting domains for IP addresses to prevent reporting 1 for an IP that has zero. --- bin/v-update-sys-ip-counters | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-sys-ip-counters b/bin/v-update-sys-ip-counters index dd51f9e9a..13f7a7c31 100755 --- a/bin/v-update-sys-ip-counters +++ b/bin/v-update-sys-ip-counters @@ -45,7 +45,7 @@ for ip in $ip_list; do # Calculate usage ip_usage=$(grep -H $ip $VESTA/data/users/*/web.conf) - web_domains=$(echo "$ip_usage"| wc -l) + web_domains=$(echo "$ip_usage" | sed '/^$/' | wc -l) sys_users=$(echo "$ip_usage" | cut -f7 -d/ | sort -u |\ tr '\n' ',' | sed "s/,$//g") From ea1a9b23c482335ce9ab2453ea6b4f24eb683007 Mon Sep 17 00:00:00 2001 From: Cameron McDonald Date: Mon, 15 Dec 2014 10:57:55 -0600 Subject: [PATCH 02/13] added critical missing "d" from sed command. doh! --- bin/v-update-sys-ip-counters | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-sys-ip-counters b/bin/v-update-sys-ip-counters index 13f7a7c31..bafeed130 100755 --- a/bin/v-update-sys-ip-counters +++ b/bin/v-update-sys-ip-counters @@ -45,7 +45,7 @@ for ip in $ip_list; do # Calculate usage ip_usage=$(grep -H $ip $VESTA/data/users/*/web.conf) - web_domains=$(echo "$ip_usage" | sed '/^$/' | wc -l) + web_domains=$(echo "$ip_usage" | sed '/^$/d' | wc -l) sys_users=$(echo "$ip_usage" | cut -f7 -d/ | sort -u |\ tr '\n' ',' | sed "s/,$//g") From c426be582a111062beab5a013024238a08564c98 Mon Sep 17 00:00:00 2001 From: Leonid Suprun Date: Mon, 26 Jan 2015 11:59:09 +0300 Subject: [PATCH 03/13] apt-get, not yum --- install/vst-install-debian.sh | 4 ++-- install/vst-install-ubuntu.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index a188c0653..c4e4620b8 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -26,7 +26,7 @@ help() { -f, --force Force installation -i, --disable-iptables Disable iptables support -b, --disable-fail2ban Disable fail2ban protection - -n, --noupdate Do not run yum update command + -n, --noupdate Do not run apt-get upgrade command -s, --hostname Set server hostname -e, --email Set email address -p, --password Set admin password instead of generating it @@ -78,7 +78,7 @@ while getopts "hfibdnqe:m:p:s:" Option; do f) force='yes' ;; # Force install i) disable_iptables='yes' ;; # Disable iptables b) disable_fail2ban='yes' ;; # Disable fail2ban - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade s) servername=$OPTARG ;; # Server hostname e) email=$OPTARG ;; # Set email p) vpass=$OPTARG ;; # Admin password diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 7f05f58df..dfc64ff7e 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -25,7 +25,7 @@ help() { -f, --force Force installation -i, --disable-iptables Disable iptables support -b, --disable-fail2ban Disable fail2ban protection - -n, --noupdate Do not run yum update command + -n, --noupdate Do not run apt-get upgrade command -s, --hostname Set server hostname -e, --email Set email address -p, --password Set admin password instead of generating it @@ -77,7 +77,7 @@ while getopts "hfibdnqe:m:p:s:" Option; do f) force='yes' ;; # Force install i) disable_iptables='yes' ;; # Disable iptables b) disable_fail2ban='yes' ;; # Disable fail2ban - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade s) servername=$OPTARG ;; # Server hostname e) email=$OPTARG ;; # Set email p) vpass=$OPTARG ;; # Admin password From c1195d1f30f8e50b62be677d765be1dd4d7d3972 Mon Sep 17 00:00:00 2001 From: Leonid Suprun Date: Mon, 26 Jan 2015 12:32:37 +0300 Subject: [PATCH 04/13] Clarify "user admin exists" message --- install/vst-install-debian.sh | 6 +++--- install/vst-install-rhel.sh | 6 +++--- install/vst-install-ubuntu.sh | 6 +++--- install/vst-install.sh | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index c4e4620b8..d5e8110a0 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -126,11 +126,11 @@ if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then exit 1 fi -# Check admin user account +# Check admin group if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then - echo "Error: user admin exists" + echo "Error: group admin exists" echo - echo 'Please remove admin user account before proceeding.' + echo 'Please remove admin group before proceeding.' echo 'If you want to do it automatically run installer with -f option:' echo "Example: bash $0 --force" exit 1 diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index ab1692a81..218c08401 100644 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -124,11 +124,11 @@ if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then exit 1 fi -# Check admin user account +# Check admin group if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then - echo "Error: user admin exists" + echo "Error: group admin exists" echo - echo 'Please remove admin user account before proceeding.' + echo 'Please remove admin group before proceeding.' echo 'If you want to do it automatically run installer with -f option:' echo "Example: bash $0 --force" exit 1 diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index dfc64ff7e..6d1319569 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -123,11 +123,11 @@ if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" != 'yes' ]; then exit 1 fi -# Check admin user account +# Check admin group if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" != 'yes' ]; then - echo "Error: user admin exists" + echo "Error: group admin exists" echo - echo 'Please remove admin user account before proceeding.' + echo 'Please remove admin group before proceeding.' echo 'If you want to do it automatically run installer with -f option:' echo "Example: bash $0 --force" exit 1 diff --git a/install/vst-install.sh b/install/vst-install.sh index 864b671d2..9c064ab01 100644 --- a/install/vst-install.sh +++ b/install/vst-install.sh @@ -27,11 +27,11 @@ if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ -z "$1" ]; then exit 1 fi -# Check admin user account +# Check admin group if [ ! -z "$(grep ^admin: /etc/group)" ] && [ -z "$1" ]; then echo "Error: group admin exists" echo - echo 'Please remove admin user account before proceeding.' + echo 'Please remove admin group before proceeding.' echo 'If you want to do it automatically run installer with -f option:' echo "Example: bash $0 --force" exit 1 From 2e78f1e3c971f7371e69d6ca15a9cf4ce5a796b8 Mon Sep 17 00:00:00 2001 From: kotso Date: Wed, 25 Mar 2015 00:38:51 +0400 Subject: [PATCH 05/13] Fixed error when connecting to 8083 over HTTP Fixed error "400 The plain HTTP request was sent to HTTPS port" By putting custom error page on http error coder 497 that redirects http uri to https uri --- src/rpm/conf/nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpm/conf/nginx.conf b/src/rpm/conf/nginx.conf index 7a3d2fd0e..bf3618969 100644 --- a/src/rpm/conf/nginx.conf +++ b/src/rpm/conf/nginx.conf @@ -82,6 +82,9 @@ http { root /usr/local/vesta/web; charset utf-8; + // Fix error "The plain HTTP request was sent to HTTPS port" + error_page 497 https://$host:$server_port$request_uri; + ssl on; ssl_certificate /usr/local/vesta/ssl/certificate.crt; ssl_certificate_key /usr/local/vesta/ssl/certificate.key; From 63e37289993a4e43bb9b94213ae608706c6d7b51 Mon Sep 17 00:00:00 2001 From: kotso Date: Wed, 25 Mar 2015 01:23:28 +0400 Subject: [PATCH 06/13] Fixed Multiple bugs in WHMCS module Added module debug logging Fixed simple bugs in function result codes returns --- install/ubuntu/whmcs-module.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/install/ubuntu/whmcs-module.php b/install/ubuntu/whmcs-module.php index b3b1710ee..6775ac016 100644 --- a/install/ubuntu/whmcs-module.php +++ b/install/ubuntu/whmcs-module.php @@ -43,6 +43,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { $postvars = array( @@ -62,6 +64,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } // Add domain @@ -84,6 +88,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } } @@ -92,8 +98,8 @@ function vesta_CreateAccount($params) { } else { $result = $answer; } - return $result; + return $result; } function vesta_TerminateAccount($params) { @@ -122,6 +128,8 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { @@ -129,7 +137,6 @@ function vesta_TerminateAccount($params) { } return $result; - } function vesta_SuspendAccount($params) { @@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_UnsuspendAccount($params) { @@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_ChangePassword($params) { @@ -227,13 +240,15 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; - } function vesta_ChangePackage($params) { @@ -263,13 +278,15 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } - return $result; + return $result; } function vesta_ClientArea($params) { From e690ee5048f0d502e535d985c0b1369969af468e Mon Sep 17 00:00:00 2001 From: kotso Date: Wed, 25 Mar 2015 01:32:10 +0400 Subject: [PATCH 07/13] Updated changes in other distribution folders I think this file should be stored in some other folder. No need to keep same copy of file in 3 different folders. This file is not OS specific. --- install/debian/whmcs-module.php | 25 +++++++++++++++++++++---- install/rhel/whmcs-module.php | 25 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/install/debian/whmcs-module.php b/install/debian/whmcs-module.php index b3b1710ee..6775ac016 100644 --- a/install/debian/whmcs-module.php +++ b/install/debian/whmcs-module.php @@ -43,6 +43,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { $postvars = array( @@ -62,6 +64,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } // Add domain @@ -84,6 +88,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } } @@ -92,8 +98,8 @@ function vesta_CreateAccount($params) { } else { $result = $answer; } - return $result; + return $result; } function vesta_TerminateAccount($params) { @@ -122,6 +128,8 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { @@ -129,7 +137,6 @@ function vesta_TerminateAccount($params) { } return $result; - } function vesta_SuspendAccount($params) { @@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_UnsuspendAccount($params) { @@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_ChangePassword($params) { @@ -227,13 +240,15 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; - } function vesta_ChangePackage($params) { @@ -263,13 +278,15 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } - return $result; + return $result; } function vesta_ClientArea($params) { diff --git a/install/rhel/whmcs-module.php b/install/rhel/whmcs-module.php index b3b1710ee..6775ac016 100644 --- a/install/rhel/whmcs-module.php +++ b/install/rhel/whmcs-module.php @@ -43,6 +43,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { $postvars = array( @@ -62,6 +64,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } // Add domain @@ -84,6 +88,8 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); + + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); } } @@ -92,8 +98,8 @@ function vesta_CreateAccount($params) { } else { $result = $answer; } - return $result; + return $result; } function vesta_TerminateAccount($params) { @@ -122,6 +128,8 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { @@ -129,7 +137,6 @@ function vesta_TerminateAccount($params) { } return $result; - } function vesta_SuspendAccount($params) { @@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_UnsuspendAccount($params) { @@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; } function vesta_ChangePassword($params) { @@ -227,13 +240,15 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } + return $result; - } function vesta_ChangePackage($params) { @@ -263,13 +278,15 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + if($answer == 'OK') { $result = "success"; } else { $result = $answer; } - return $result; + return $result; } function vesta_ClientArea($params) { From 1d12eb46d429d8f4c17786cef82464a1e074fd62 Mon Sep 17 00:00:00 2001 From: kotso Date: Wed, 25 Mar 2015 14:45:44 +0400 Subject: [PATCH 08/13] PHP syntax errors fix --- install/debian/whmcs-module.php | 16 ++++++++-------- install/rhel/whmcs-module.php | 16 ++++++++-------- install/ubuntu/whmcs-module.php | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/install/debian/whmcs-module.php b/install/debian/whmcs-module.php index 6775ac016..1cb250611 100644 --- a/install/debian/whmcs-module.php +++ b/install/debian/whmcs-module.php @@ -43,7 +43,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { @@ -65,7 +65,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } // Add domain @@ -89,7 +89,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } } @@ -128,7 +128,7 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -165,7 +165,7 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -202,7 +202,7 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -240,7 +240,7 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -278,7 +278,7 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; diff --git a/install/rhel/whmcs-module.php b/install/rhel/whmcs-module.php index 6775ac016..1cb250611 100644 --- a/install/rhel/whmcs-module.php +++ b/install/rhel/whmcs-module.php @@ -43,7 +43,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { @@ -65,7 +65,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } // Add domain @@ -89,7 +89,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } } @@ -128,7 +128,7 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -165,7 +165,7 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -202,7 +202,7 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -240,7 +240,7 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -278,7 +278,7 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; diff --git a/install/ubuntu/whmcs-module.php b/install/ubuntu/whmcs-module.php index 6775ac016..1cb250611 100644 --- a/install/ubuntu/whmcs-module.php +++ b/install/ubuntu/whmcs-module.php @@ -43,7 +43,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); // Enable ssh access if(($answer == 'OK') && ($params["configoption2"] == 'on')) { @@ -65,7 +65,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } // Add domain @@ -89,7 +89,7 @@ function vesta_CreateAccount($params) { curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); - logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); } } @@ -128,7 +128,7 @@ function vesta_TerminateAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -165,7 +165,7 @@ function vesta_SuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -202,7 +202,7 @@ function vesta_UnsuspendAccount($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -240,7 +240,7 @@ function vesta_ChangePassword($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; @@ -278,7 +278,7 @@ function vesta_ChangePackage($params) { $answer = curl_exec($curl); } - logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer); + logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer); if($answer == 'OK') { $result = "success"; From 0bed9eb16451e835fad067407e7d6f8c5141f75f Mon Sep 17 00:00:00 2001 From: Victor Isadov Date: Fri, 10 Apr 2015 00:03:55 +0300 Subject: [PATCH 09/13] Chains select output in foreach instead of hardcoding it --- web/templates/admin/add_firewall_banlist.html | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/web/templates/admin/add_firewall_banlist.html b/web/templates/admin/add_firewall_banlist.html index 9f8a6fd56..427fabfb0 100644 --- a/web/templates/admin/add_firewall_banlist.html +++ b/web/templates/admin/add_firewall_banlist.html @@ -51,15 +51,28 @@ - + From f496229b5824bc186781721f4b816e61fb63f65e Mon Sep 17 00:00:00 2001 From: crackdepirate Date: Fri, 10 Apr 2015 19:56:47 -0400 Subject: [PATCH 10/13] updated line 111, little typo error. --- install/rhel/exim.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/rhel/exim.conf b/install/rhel/exim.conf index 0f9830168..d75192e7c 100644 --- a/install/rhel/exim.conf +++ b/install/rhel/exim.conf @@ -108,7 +108,7 @@ acl_check_rcpt: require message = relay not permitted domains = +local_domains : +relay_to_domains - deny message = smtp auth requried + deny message = smtp auth required sender_domains = +local_domains !authenticated = * From 1cbc5540497e8f4d7f5ed26f9197fd8270b6020c Mon Sep 17 00:00:00 2001 From: crackdepirate Date: Fri, 10 Apr 2015 19:58:18 -0400 Subject: [PATCH 11/13] updated line 111, little typo error. --- install/debian/exim4.conf.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/debian/exim4.conf.template b/install/debian/exim4.conf.template index 742f0409e..64cd03fca 100644 --- a/install/debian/exim4.conf.template +++ b/install/debian/exim4.conf.template @@ -108,7 +108,7 @@ acl_check_rcpt: require message = relay not permitted domains = +local_domains : +relay_to_domains - deny message = smtp auth requried + deny message = smtp auth required sender_domains = +local_domains !authenticated = * From 9c33bf9e6676f0a0bb84997458f888f2402e4d9c Mon Sep 17 00:00:00 2001 From: crackdepirate Date: Fri, 10 Apr 2015 19:59:28 -0400 Subject: [PATCH 12/13] updated line 111, little typo error. --- install/ubuntu/exim4.conf.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/ubuntu/exim4.conf.template b/install/ubuntu/exim4.conf.template index 742f0409e..64cd03fca 100644 --- a/install/ubuntu/exim4.conf.template +++ b/install/ubuntu/exim4.conf.template @@ -108,7 +108,7 @@ acl_check_rcpt: require message = relay not permitted domains = +local_domains : +relay_to_domains - deny message = smtp auth requried + deny message = smtp auth required sender_domains = +local_domains !authenticated = * From d3390d7ad02b96a7fb2d6cad8af88588b3350410 Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Thu, 16 Apr 2015 14:30:45 -0400 Subject: [PATCH 13/13] Add/edit package unlim patch; --- web/js/pages/add.package.js | 20 +++++++++++++++++--- web/js/pages/edit.package.js | 20 +++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/web/js/pages/add.package.js b/web/js/pages/add.package.js index 2d71a6cca..6aa773db0 100644 --- a/web/js/pages/add.package.js +++ b/web/js/pages/add.package.js @@ -11,9 +11,14 @@ App.Actions.PACKAGE.disable_unlimited = function(elm, source_elm) { if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') { var prev_value = $(elm).data('prev_value').trim(); $(elm).val(prev_value); + if (App.Helpers.isUnlimitedValue(prev_value)) { + $(elm).val('0'); + } } else { - $(elm).val('0'); + if (App.Helpers.isUnlimitedValue($(elm).val())) { + $(elm).val('0'); + } } $(elm).attr('disabled', false); $(source_elm).css('opacity', '0.5'); @@ -38,16 +43,25 @@ App.Listeners.PACKAGE.checkbox_unlimited_feature = function() { App.Listeners.PACKAGE.init = function() { $('.unlim-trigger').each(function(i, elm) { var ref = $(elm).prev('.vst-input'); - if ($(ref).val().trim() == App.Constants.UNLIM_VALUE || $(ref).val().trim() == App.Constants.UNLIM_TRANSLATED_VALUE) { - $(ref).val('0'); + if (App.Helpers.isUnlimitedValue($(ref).val())) { App.Actions.PACKAGE.enable_unlimited(ref, elm); } else { + $(ref).data('prev_value', $(ref).val()); App.Actions.PACKAGE.disable_unlimited(ref, elm); } }); } +App.Helpers.isUnlimitedValue = function(value) { + var value = value.trim(); + if (value == App.Constants.UNLIM_VALUE || value == App.Constants.UNLIM_TRANSLATED_VALUE) { + return true; + } + + return false; +} + // // Page entry point // Trigger listeners diff --git a/web/js/pages/edit.package.js b/web/js/pages/edit.package.js index 63178e861..b1f2cb345 100644 --- a/web/js/pages/edit.package.js +++ b/web/js/pages/edit.package.js @@ -11,9 +11,14 @@ App.Actions.PACKAGE.disable_unlimited = function(elm, source_elm) { if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') { var prev_value = $(elm).data('prev_value').trim(); $(elm).val(prev_value); + if (App.Helpers.isUnlimitedValue(prev_value)) { + $(elm).val('0'); + } } else { - $(elm).val('0'); + if (App.Helpers.isUnlimitedValue($(elm).val())) { + $(elm).val('0'); + } } $(elm).attr('disabled', false); $(source_elm).css('opacity', '0.5'); @@ -38,16 +43,25 @@ App.Listeners.PACKAGE.checkbox_unlimited_feature = function() { App.Listeners.PACKAGE.init = function() { $('.unlim-trigger').each(function(i, elm) { var ref = $(elm).prev('.vst-input'); - if ($(ref).val().trim() == App.Constants.UNLIM_VALUE || $(ref).val().trim() == App.Constants.UNLIM_TRANSLATED_VALUE) { - $(ref).val('0'); + if (App.Helpers.isUnlimitedValue($(ref).val())) { App.Actions.PACKAGE.enable_unlimited(ref, elm); } else { + $(ref).data('prev_value', $(ref).val()); App.Actions.PACKAGE.disable_unlimited(ref, elm); } }); } +App.Helpers.isUnlimitedValue = function(value) { + var value = value.trim(); + if (value == App.Constants.UNLIM_VALUE || value == App.Constants.UNLIM_TRANSLATED_VALUE) { + return true; + } + + return false; +} + // // Page entry point // Trigger listeners