|
@@ -15,16 +15,35 @@ if (!defined('WHMCS')) {
|
|
|
die('This file cannot be accessed directly');
|
|
die('This file cannot be accessed directly');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function cwp7_ConfigOptions() {
|
|
function cwp7_ConfigOptions() {
|
|
|
|
|
+ $whmcs = App::self();
|
|
|
|
|
+ $serverGroupID = $whmcs->get_req_var('servergroup');
|
|
|
|
|
+ $serverIDObj = Capsule::table('tblservergroupsrel')
|
|
|
|
|
+ ->select('serverid')
|
|
|
|
|
+ ->where('groupid', '=', $serverGroupID)
|
|
|
|
|
+ ->get();
|
|
|
|
|
+ $serverIDArray = $serverIDObj->serverid();
|
|
|
|
|
+ $server = Capsule::table('tblservers')
|
|
|
|
|
+ ->select('ipaddress', 'username', 'password')
|
|
|
|
|
+ ->where('id', $serverIDArray)
|
|
|
|
|
+ ->where('active', '=', 1)
|
|
|
|
|
+ ->get();
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'cwp7',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $server,
|
|
|
|
|
+ 'Debug',
|
|
|
|
|
+ $serverIDObj
|
|
|
|
|
+ );
|
|
|
$configarray = array(
|
|
$configarray = array(
|
|
|
- "PACKAGE-NUMBER" => array( "Type" => "text", "Description" => "Package ID", "Default" => "1"),
|
|
|
|
|
|
|
+ "Package" => array( "Type" => "text", "Description" => "Package ID", "Default" => "1"),
|
|
|
"inode" => array( "Type" => "text" , "Description" => "Max of inode", "Default" => "0",),
|
|
"inode" => array( "Type" => "text" , "Description" => "Max of inode", "Default" => "0",),
|
|
|
"nofile" => array( "Type" => "text", "Description" => "Max of nofile", "Default" => "100", ),
|
|
"nofile" => array( "Type" => "text", "Description" => "Max of nofile", "Default" => "100", ),
|
|
|
"nproc" => array( "Type" => "text" , "Description" => "Nproc limit - 40 suggested", "Default" => "40",),
|
|
"nproc" => array( "Type" => "text" , "Description" => "Nproc limit - 40 suggested", "Default" => "40",),
|
|
|
);
|
|
);
|
|
|
return $configarray;
|
|
return $configarray;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function cwp7_CreateAccount($params) {
|
|
function cwp7_CreateAccount($params) {
|
|
|
if ($params["server"] == 1) {
|
|
if ($params["server"] == 1) {
|
|
|
$postvars = array(
|
|
$postvars = array(
|
|
@@ -106,8 +125,7 @@ function cwp7_UnsuspendAccount($params) {
|
|
|
logModuleCall('cwpwhmcs','UnsuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account'.$postdata,$result);
|
|
logModuleCall('cwpwhmcs','UnsuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account'.$postdata,$result);
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
-function cwp7_ClientArea($params)
|
|
|
|
|
-{
|
|
|
|
|
|
|
+function cwp7_ClientArea($params){
|
|
|
$postvars = array('key' => $params["serveraccesshash"], 'action' => 'list', 'user' => $params["username"], 'timer' => 5);
|
|
$postvars = array('key' => $params["serveraccesshash"], 'action' => 'list', 'user' => $params["username"], 'timer' => 5);
|
|
|
$postdata = http_build_query($postvars);
|
|
$postdata = http_build_query($postvars);
|
|
|
$curl = curl_init();
|
|
$curl = curl_init();
|