|
|
@@ -174,14 +174,19 @@ function cwp7_ClientArea($params){
|
|
|
logModuleCall('cwpwhmcs', 'cwp7_LoginLink', 'https://' . $params["serverhostname"] . ':2304/v1/user_session' . $postdata, $answer);
|
|
|
|
|
|
return "<a href=\"{$linkautologin}\" target=\"_blank\" style=\"color:#cc0000\">Login to Control Panel</a>"; */
|
|
|
-
|
|
|
+ return array(
|
|
|
+ 'tabOverviewReplacementTemplate' => 'templates/clientarea',
|
|
|
+ 'vars' => $clientInfo,
|
|
|
+ );
|
|
|
}
|
|
|
+
|
|
|
function cwp7_AdminLink($params) {
|
|
|
$code = '<form action="https://'.$params["serverhostname"].':2031" method="post" target="_blank">
|
|
|
<input type="submit" value="Login to Control Panel" />
|
|
|
</form>';
|
|
|
return $code;
|
|
|
}
|
|
|
+
|
|
|
function cwp7_LoginLink($params) {
|
|
|
/* $postvars = array('key' => $params["serveraccesshash"],'action' => 'list','user' => $params["username"],'timer'=>5);
|
|
|
$postdata = http_build_query($postvars);
|
|
|
@@ -200,36 +205,25 @@ function cwp7_LoginLink($params) {
|
|
|
|
|
|
echo "<a href=\"{$linkautologin}\" target=\"_blank\" style=\"color:#cc0000\">Control Panel</a>"; */
|
|
|
}
|
|
|
+
|
|
|
function cwp7_ChangePassword($params){
|
|
|
- logModuleCall(
|
|
|
- 'cwp7',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- 'Debug',
|
|
|
- ''
|
|
|
- );
|
|
|
- return 'Error: Debug';
|
|
|
-// return 'success';
|
|
|
+ $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
+ $response = $cwp7->changePass(array('user' => $params['username'], 'password' => $params['password']));
|
|
|
+ if($response['status'] != 'OK') {
|
|
|
+ return 'Error: ' . $response['msj'];
|
|
|
+ }
|
|
|
+ return 'success';
|
|
|
}
|
|
|
-function cwp7_ChangePackage($params){
|
|
|
-/* $postvars = array("key" => $params["serveraccesshash"],"action"=>'udp','user' => $params["username"],'package'=>$params["configoption1"].'@');
|
|
|
- $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);
|
|
|
- curl_close($curl);
|
|
|
-
|
|
|
- if(strpos($answer,"OK")!==false){$result='success';}else{$result=json_decode($answer,true); $result=$result['msj'];}
|
|
|
- logModuleCall('cwpwhmcs','ChangePackage','https://' . $params["serverhostname"] . ':2304/v1/packages'.$postdata,$answer);
|
|
|
- return $result; */
|
|
|
+function cwp7_ChangePackage($params){
|
|
|
+ $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
+ $response = $cwp7->modifyAccount(array('user' => $params['username'], 'email' => $params['clientdetails']['email'], 'package' => $params['configoption1']));
|
|
|
+ if($response['status'] != 'OK') {
|
|
|
+ return 'Error: ' . $response['msj'];
|
|
|
+ }
|
|
|
return 'success';
|
|
|
}
|
|
|
+
|
|
|
function cwp7_UsageUpdate($params) {
|
|
|
/* $postvars = array('key' => $params["serveraccesshash"],'action' => 'list');
|
|
|
$postdata = http_build_query($postvars);
|