Skip to content

Commit aa8be61

Browse files
committed
Merge pull request hestiacp#349 from kotso/master
HTTP on 8083 and WHMCS module fixes
2 parents 5d16423 + 1d12eb4 commit aa8be61

File tree

4 files changed

+66
-12
lines changed

4 files changed

+66
-12
lines changed

install/debian/whmcs-module.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function vesta_CreateAccount($params) {
4343
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
4444
$answer = curl_exec($curl);
4545

46+
logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
47+
4648
// Enable ssh access
4749
if(($answer == 'OK') && ($params["configoption2"] == 'on')) {
4850
$postvars = array(
@@ -62,6 +64,8 @@ function vesta_CreateAccount($params) {
6264
curl_setopt($curl, CURLOPT_POST, true);
6365
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
6466
$answer = curl_exec($curl);
67+
68+
logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
6569
}
6670

6771
// Add domain
@@ -84,6 +88,8 @@ function vesta_CreateAccount($params) {
8488
curl_setopt($curl, CURLOPT_POST, true);
8589
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
8690
$answer = curl_exec($curl);
91+
92+
logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
8793
}
8894
}
8995

@@ -92,8 +98,8 @@ function vesta_CreateAccount($params) {
9298
} else {
9399
$result = $answer;
94100
}
95-
return $result;
96101

102+
return $result;
97103
}
98104

99105
function vesta_TerminateAccount($params) {
@@ -122,14 +128,15 @@ function vesta_TerminateAccount($params) {
122128
$answer = curl_exec($curl);
123129
}
124130

131+
logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
132+
125133
if($answer == 'OK') {
126134
$result = "success";
127135
} else {
128136
$result = $answer;
129137
}
130138

131139
return $result;
132-
133140
}
134141

135142
function vesta_SuspendAccount($params) {
@@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) {
158165
$answer = curl_exec($curl);
159166
}
160167

168+
logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
169+
161170
if($answer == 'OK') {
162171
$result = "success";
163172
} else {
164173
$result = $answer;
165174
}
166175

176+
return $result;
167177
}
168178

169179
function vesta_UnsuspendAccount($params) {
@@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) {
192202
$answer = curl_exec($curl);
193203
}
194204

205+
logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
206+
195207
if($answer == 'OK') {
196208
$result = "success";
197209
} else {
198210
$result = $answer;
199211
}
200212

213+
return $result;
201214
}
202215

203216
function vesta_ChangePassword($params) {
@@ -227,13 +240,15 @@ function vesta_ChangePassword($params) {
227240
$answer = curl_exec($curl);
228241
}
229242

243+
logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
244+
230245
if($answer == 'OK') {
231246
$result = "success";
232247
} else {
233248
$result = $answer;
234249
}
250+
235251
return $result;
236-
237252
}
238253

239254
function vesta_ChangePackage($params) {
@@ -263,13 +278,15 @@ function vesta_ChangePackage($params) {
263278
$answer = curl_exec($curl);
264279
}
265280

281+
logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
282+
266283
if($answer == 'OK') {
267284
$result = "success";
268285
} else {
269286
$result = $answer;
270287
}
271-
return $result;
272288

289+
return $result;
273290
}
274291

275292
function vesta_ClientArea($params) {

install/rhel/whmcs-module.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function vesta_CreateAccount($params) {
4343
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
4444
$answer = curl_exec($curl);
4545

46+
logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
47+
4648
// Enable ssh access
4749
if(($answer == 'OK') && ($params["configoption2"] == 'on')) {
4850
$postvars = array(
@@ -62,6 +64,8 @@ function vesta_CreateAccount($params) {
6264
curl_setopt($curl, CURLOPT_POST, true);
6365
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
6466
$answer = curl_exec($curl);
67+
68+
logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
6569
}
6670

6771
// Add domain
@@ -84,6 +88,8 @@ function vesta_CreateAccount($params) {
8488
curl_setopt($curl, CURLOPT_POST, true);
8589
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
8690
$answer = curl_exec($curl);
91+
92+
logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
8793
}
8894
}
8995

@@ -92,8 +98,8 @@ function vesta_CreateAccount($params) {
9298
} else {
9399
$result = $answer;
94100
}
95-
return $result;
96101

102+
return $result;
97103
}
98104

99105
function vesta_TerminateAccount($params) {
@@ -122,14 +128,15 @@ function vesta_TerminateAccount($params) {
122128
$answer = curl_exec($curl);
123129
}
124130

131+
logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
132+
125133
if($answer == 'OK') {
126134
$result = "success";
127135
} else {
128136
$result = $answer;
129137
}
130138

131139
return $result;
132-
133140
}
134141

135142
function vesta_SuspendAccount($params) {
@@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) {
158165
$answer = curl_exec($curl);
159166
}
160167

168+
logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
169+
161170
if($answer == 'OK') {
162171
$result = "success";
163172
} else {
164173
$result = $answer;
165174
}
166175

176+
return $result;
167177
}
168178

169179
function vesta_UnsuspendAccount($params) {
@@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) {
192202
$answer = curl_exec($curl);
193203
}
194204

205+
logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
206+
195207
if($answer == 'OK') {
196208
$result = "success";
197209
} else {
198210
$result = $answer;
199211
}
200212

213+
return $result;
201214
}
202215

203216
function vesta_ChangePassword($params) {
@@ -227,13 +240,15 @@ function vesta_ChangePassword($params) {
227240
$answer = curl_exec($curl);
228241
}
229242

243+
logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
244+
230245
if($answer == 'OK') {
231246
$result = "success";
232247
} else {
233248
$result = $answer;
234249
}
250+
235251
return $result;
236-
237252
}
238253

239254
function vesta_ChangePackage($params) {
@@ -263,13 +278,15 @@ function vesta_ChangePackage($params) {
263278
$answer = curl_exec($curl);
264279
}
265280

281+
logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
282+
266283
if($answer == 'OK') {
267284
$result = "success";
268285
} else {
269286
$result = $answer;
270287
}
271-
return $result;
272288

289+
return $result;
273290
}
274291

275292
function vesta_ClientArea($params) {

install/ubuntu/whmcs-module.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function vesta_CreateAccount($params) {
4343
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
4444
$answer = curl_exec($curl);
4545

46+
logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
47+
4648
// Enable ssh access
4749
if(($answer == 'OK') && ($params["configoption2"] == 'on')) {
4850
$postvars = array(
@@ -62,6 +64,8 @@ function vesta_CreateAccount($params) {
6264
curl_setopt($curl, CURLOPT_POST, true);
6365
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
6466
$answer = curl_exec($curl);
67+
68+
logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
6569
}
6670

6771
// Add domain
@@ -84,6 +88,8 @@ function vesta_CreateAccount($params) {
8488
curl_setopt($curl, CURLOPT_POST, true);
8589
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
8690
$answer = curl_exec($curl);
91+
92+
logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
8793
}
8894
}
8995

@@ -92,8 +98,8 @@ function vesta_CreateAccount($params) {
9298
} else {
9399
$result = $answer;
94100
}
95-
return $result;
96101

102+
return $result;
97103
}
98104

99105
function vesta_TerminateAccount($params) {
@@ -122,14 +128,15 @@ function vesta_TerminateAccount($params) {
122128
$answer = curl_exec($curl);
123129
}
124130

131+
logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
132+
125133
if($answer == 'OK') {
126134
$result = "success";
127135
} else {
128136
$result = $answer;
129137
}
130138

131139
return $result;
132-
133140
}
134141

135142
function vesta_SuspendAccount($params) {
@@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) {
158165
$answer = curl_exec($curl);
159166
}
160167

168+
logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
169+
161170
if($answer == 'OK') {
162171
$result = "success";
163172
} else {
164173
$result = $answer;
165174
}
166175

176+
return $result;
167177
}
168178

169179
function vesta_UnsuspendAccount($params) {
@@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) {
192202
$answer = curl_exec($curl);
193203
}
194204

205+
logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
206+
195207
if($answer == 'OK') {
196208
$result = "success";
197209
} else {
198210
$result = $answer;
199211
}
200212

213+
return $result;
201214
}
202215

203216
function vesta_ChangePassword($params) {
@@ -227,13 +240,15 @@ function vesta_ChangePassword($params) {
227240
$answer = curl_exec($curl);
228241
}
229242

243+
logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
244+
230245
if($answer == 'OK') {
231246
$result = "success";
232247
} else {
233248
$result = $answer;
234249
}
250+
235251
return $result;
236-
237252
}
238253

239254
function vesta_ChangePackage($params) {
@@ -263,13 +278,15 @@ function vesta_ChangePackage($params) {
263278
$answer = curl_exec($curl);
264279
}
265280

281+
logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'.$postdata,$answer);
282+
266283
if($answer == 'OK') {
267284
$result = "success";
268285
} else {
269286
$result = $answer;
270287
}
271-
return $result;
272288

289+
return $result;
273290
}
274291

275292
function vesta_ClientArea($params) {

src/rpm/conf/nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ http {
8282
root /usr/local/vesta/web;
8383
charset utf-8;
8484

85+
// Fix error "The plain HTTP request was sent to HTTPS port"
86+
error_page 497 https://$host:$server_port$request_uri;
87+
8588
ssl on;
8689
ssl_certificate /usr/local/vesta/ssl/certificate.crt;
8790
ssl_certificate_key /usr/local/vesta/ssl/certificate.key;

0 commit comments

Comments
 (0)