Small tweaks
This commit is contained in:
@@ -39,7 +39,7 @@ class ModuleFunctions extends Module
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$server = $params['serverid'] ?: false;
|
$server = $params['serverid'] ?: false;
|
||||||
$cp = $this->getCP($server, $server ? false : true);
|
$cp = $this->getCP($server, !$server);
|
||||||
|
|
||||||
if (!$cp) {
|
if (!$cp) {
|
||||||
return 'No Control server found.';
|
return 'No Control server found.';
|
||||||
@@ -82,7 +82,7 @@ class ModuleFunctions extends Module
|
|||||||
[
|
[
|
||||||
"name" => $user->firstname . ' ' . $user->lastname,
|
"name" => $user->firstname . ' ' . $user->lastname,
|
||||||
"email" => $user->email,
|
"email" => $user->email,
|
||||||
"extRelationId" => $user->id
|
"extRelationId" => $user->id,
|
||||||
]
|
]
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -96,7 +96,6 @@ class ModuleFunctions extends Module
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 'Error processing user account.';
|
return 'Error processing user account.';
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = json_decode($data);
|
$data = json_decode($data);
|
||||||
@@ -192,7 +191,9 @@ class ModuleFunctions extends Module
|
|||||||
* Allows changing of the package of a server
|
* Allows changing of the package of a server
|
||||||
*
|
*
|
||||||
* @author https://github.com/BlinkohHost/virtfusion-whmcs-module
|
* @author https://github.com/BlinkohHost/virtfusion-whmcs-module
|
||||||
|
*
|
||||||
* @param $params
|
* @param $params
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function changePackage($params)
|
public function changePackage($params)
|
||||||
@@ -218,6 +219,7 @@ class ModuleFunctions extends Module
|
|||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
return $data->msg;
|
return $data->msg;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 'Update package request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
return 'Update package request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
||||||
}
|
}
|
||||||
@@ -256,7 +258,6 @@ class ModuleFunctions extends Module
|
|||||||
Database::deleteSystemService($params['serviceid']);
|
Database::deleteSystemService($params['serviceid']);
|
||||||
$this->updateWhmcsServiceParamsOnDestroy($params['serviceid']);
|
$this->updateWhmcsServiceParamsOnDestroy($params['serviceid']);
|
||||||
return 'success';
|
return 'success';
|
||||||
break;
|
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
@@ -269,11 +270,9 @@ class ModuleFunctions extends Module
|
|||||||
} else {
|
} else {
|
||||||
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 'Termination request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
return 'Termination request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'Service not found. Termination routine has already been run?';
|
return 'Service not found. Termination routine has already been run?';
|
||||||
@@ -307,7 +306,6 @@ class ModuleFunctions extends Module
|
|||||||
|
|
||||||
case 204:
|
case 204:
|
||||||
return 'success';
|
return 'success';
|
||||||
break;
|
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
@@ -321,7 +319,6 @@ class ModuleFunctions extends Module
|
|||||||
} else {
|
} else {
|
||||||
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case 423:
|
case 423:
|
||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
return $data->msg;
|
return $data->msg;
|
||||||
@@ -329,7 +326,6 @@ class ModuleFunctions extends Module
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
return 'Suspend request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
return 'Suspend request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'Service not found.';
|
return 'Service not found.';
|
||||||
@@ -358,10 +354,8 @@ class ModuleFunctions extends Module
|
|||||||
$this->updateWhmcsServiceParamsOnServerObject($params['serviceid'], $data);
|
$this->updateWhmcsServiceParamsOnServerObject($params['serviceid'], $data);
|
||||||
|
|
||||||
return 'success';
|
return 'success';
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return 'Request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
return 'Request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'Service not found.';
|
return 'Service not found.';
|
||||||
@@ -386,7 +380,6 @@ class ModuleFunctions extends Module
|
|||||||
|
|
||||||
case 204:
|
case 204:
|
||||||
return 'success';
|
return 'success';
|
||||||
break;
|
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
@@ -399,15 +392,14 @@ class ModuleFunctions extends Module
|
|||||||
} else {
|
} else {
|
||||||
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
return '404 was returned from the web service without the msg property. The service may be currently unavailable.';
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case 423:
|
case 423:
|
||||||
if (property_exists($data, 'msg')) {
|
if (property_exists($data, 'msg')) {
|
||||||
return $data->msg;
|
return $data->msg;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 'Unsuspend request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
return 'Unsuspend request failed. The web service reported HTTP code ' . $request->getRequestInfo('http_code');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'Service not found';
|
return 'Service not found';
|
||||||
|
|||||||
Reference in New Issue
Block a user