andre 3 лет назад
Родитель
Сommit
20b2fef0d4
1 измененных файлов с 22 добавлено и 4 удалено
  1. 22 4
      cwp7.php

+ 22 - 4
cwp7.php

@@ -15,16 +15,35 @@ if (!defined('WHMCS')) {
 	die('This file cannot be accessed directly');
 }
 
-
 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(
-		"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",),
 		"nofile" => array( "Type" => "text", "Description" => "Max of nofile", "Default" => "100", ),
 		"nproc" => array( "Type" => "text" , "Description" => "Nproc limit - 40 suggested", "Default" => "40",),
 	);
 	return $configarray;
 }
+
 function cwp7_CreateAccount($params) {
 	if ($params["server"] == 1) {
 		$postvars = array(
@@ -106,8 +125,7 @@ function cwp7_UnsuspendAccount($params) {
 	logModuleCall('cwpwhmcs','UnsuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account'.$postdata,$result);
 	return $result;
 }
-function cwp7_ClientArea($params)
-{
+function cwp7_ClientArea($params){
 	$postvars = array('key' => $params["serveraccesshash"], 'action' => 'list', 'user' => $params["username"], 'timer' => 5);
 	$postdata = http_build_query($postvars);
 	$curl = curl_init();