|
|
@@ -131,53 +131,32 @@ function cwp7_CreateAccount($params) {
|
|
|
}
|
|
|
|
|
|
function cwp7_TerminateAccount($params) {
|
|
|
- logModuleCall(
|
|
|
- 'cwp7',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- 'Debug',
|
|
|
- ''
|
|
|
- );
|
|
|
- return 'Error: debug';
|
|
|
-
|
|
|
-// return 'success';
|
|
|
+ $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
+ $response = $cwp7->deleteAccount(array('user' => $params['username'], 'email' => $params['clientsdetails']['email']));
|
|
|
+ if($response['status'] != 'OK') {
|
|
|
+ return 'Error: ' . $response['msj'];
|
|
|
+ }
|
|
|
+ return 'success';
|
|
|
}
|
|
|
+
|
|
|
function cwp7_SuspendAccount($params) {
|
|
|
-/* if ($params["server"] == 1) {
|
|
|
- $postvars = array('key' => $params["serveraccesshash"],'action' => 'susp','user' => $params["username"]);
|
|
|
- $postdata = http_build_query($postvars);
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':2304/v1/account');
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- curl_setopt($curl, CURLOPT_POST, true);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
|
|
|
- $answer = curl_exec($curl);
|
|
|
+ $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
+ $response = $cwp7->suspendAccount($params['username']);
|
|
|
+ if($response['status'] != 'OK') {
|
|
|
+ return 'Error: ' . $response['msj'];
|
|
|
}
|
|
|
- if(strpos($answer,"OK")!==false){$result='success';}else{$result=json_decode($answer,true); $result=$result['msj'];}
|
|
|
- logModuleCall('cwpwhmcs','SuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account/'.$postdata,$result);
|
|
|
- return $result; */
|
|
|
return 'success';
|
|
|
}
|
|
|
+
|
|
|
function cwp7_UnsuspendAccount($params) {
|
|
|
-/* if ($params["server"] == 1) {
|
|
|
- $postvars = array('key' => $params["serveraccesshash"],'action' => 'unsp','user' => $params["username"]);
|
|
|
- $postdata = http_build_query($postvars);
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':2304/v1/account');
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- curl_setopt($curl, CURLOPT_POST, true);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
|
|
|
- $answer = curl_exec($curl);
|
|
|
+ $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
+ $response = $cwp7->unsuspendAccount($params['username']);
|
|
|
+ if($response['status'] != 'OK') {
|
|
|
+ return 'Error: ' . $response['msj'];
|
|
|
}
|
|
|
- if(strpos($answer,"OK")!==false){$result='success';}else{$result=json_decode($answer,true); $result=$result['msj'];}
|
|
|
- logModuleCall('cwpwhmcs','UnsuspendAccount','https://' . $params["serverhostname"] . ':2304/v1/account'.$postdata,$result);
|
|
|
- return $result; */
|
|
|
return 'success';
|
|
|
}
|
|
|
+
|
|
|
function cwp7_ClientArea($params){
|
|
|
/* $postvars = array('key' => $params["serveraccesshash"], 'action' => 'list', 'user' => $params["username"], 'timer' => 5);
|
|
|
$postdata = http_build_query($postvars);
|
|
|
@@ -222,20 +201,15 @@ function cwp7_LoginLink($params) {
|
|
|
echo "<a href=\"{$linkautologin}\" target=\"_blank\" style=\"color:#cc0000\">Control Panel</a>"; */
|
|
|
}
|
|
|
function cwp7_ChangePassword($params){
|
|
|
-/* $postvars = array('key' => $params["serveraccesshash"],'acction' => 'udp','user' => $params["username"], 'pass' =>$params["password"]);
|
|
|
- $postdata = http_build_query($postvars);
|
|
|
- $curl = curl_init();
|
|
|
- curl_setopt($curl, CURLOPT_URL, 'https://'. $params["serverhostname"] . ':2304/v1/changepass');
|
|
|
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- curl_setopt($curl, CURLOPT_POST, true);
|
|
|
- curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
|
|
|
- $answer = curl_exec($curl);
|
|
|
- if(strpos($answer,"OK")!==false){$result='success';}else{$result=json_decode($answer,true); $result=$result['msj'];}
|
|
|
- logModuleCall('cwpwhmcs','ChangePassword','https://' . $params["serverhostname"] . ':2304/v1/changepass'.$postdata,$result);
|
|
|
- return $result; */
|
|
|
- return 'success';
|
|
|
+ logModuleCall(
|
|
|
+ 'cwp7',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ 'Debug',
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ return 'Error: Debug';
|
|
|
+// return 'success';
|
|
|
}
|
|
|
function cwp7_ChangePackage($params){
|
|
|
/* $postvars = array("key" => $params["serveraccesshash"],"action"=>'udp','user' => $params["username"],'package'=>$params["configoption1"].'@');
|