Parcourir la source

Fixed Multiple bugs in WHMCS module

Added module debug logging
Fixed simple bugs in function result codes returns
kotso il y a 11 ans
Parent
commit
63e3728999
1 fichiers modifiés avec 21 ajouts et 4 suppressions
  1. 21 4
      install/ubuntu/whmcs-module.php

+ 21 - 4
install/ubuntu/whmcs-module.php

@@ -43,6 +43,8 @@ function vesta_CreateAccount($params) {
         curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
         $answer = curl_exec($curl);
 
+		logModuleCall('vesta','CreateAccount_UserAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
         // Enable ssh access
         if(($answer == 'OK') && ($params["configoption2"] == 'on')) {
             $postvars = array(
@@ -62,6 +64,8 @@ function vesta_CreateAccount($params) {
             curl_setopt($curl, CURLOPT_POST, true);
             curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
             $answer = curl_exec($curl);
+
+            logModuleCall('vesta','CreateAccount_EnableSSH','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
         }
 
         // Add domain
@@ -84,6 +88,8 @@ function vesta_CreateAccount($params) {
             curl_setopt($curl, CURLOPT_POST, true);
             curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
             $answer = curl_exec($curl);
+
+            logModuleCall('vesta','CreateAccount_AddDomain','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
         }
     }
 
@@ -92,8 +98,8 @@ function vesta_CreateAccount($params) {
     } else {
         $result = $answer;
     }
-    return $result;
 
+    return $result;
 }
 
 function vesta_TerminateAccount($params) {
@@ -122,6 +128,8 @@ function vesta_TerminateAccount($params) {
         $answer = curl_exec($curl);
     }
 
+	logModuleCall('vesta','TerminateAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
     if($answer == 'OK') {
         $result = "success";
     } else {
@@ -129,7 +137,6 @@ function vesta_TerminateAccount($params) {
     }
 
     return $result;
-
 }
 
 function vesta_SuspendAccount($params) {
@@ -158,12 +165,15 @@ function vesta_SuspendAccount($params) {
         $answer = curl_exec($curl);
     }
 
+	logModuleCall('vesta','SuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
     if($answer == 'OK') {
         $result = "success";
     } else {
         $result = $answer;
     }
 
+    return $result;
 }
 
 function vesta_UnsuspendAccount($params) {
@@ -192,12 +202,15 @@ function vesta_UnsuspendAccount($params) {
         $answer = curl_exec($curl);
     }
 
+    logModuleCall('vesta','UnsuspendAccount','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
     if($answer == 'OK') {
         $result = "success";
     } else {
         $result = $answer;
     }
 
+    return $result;
 }
 
 function vesta_ChangePassword($params) {
@@ -227,13 +240,15 @@ function vesta_ChangePassword($params) {
         $answer = curl_exec($curl);
     }
 
+	logModuleCall('vesta','ChangePassword','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
     if($answer == 'OK') {
         $result = "success";
     } else {
         $result = $answer;
     }
+    
     return $result;
-
 }
 
 function vesta_ChangePackage($params) {
@@ -263,13 +278,15 @@ function vesta_ChangePackage($params) {
         $answer = curl_exec($curl);
     }
 
+	logModuleCall('vesta','ChangePackage','https://'.$params["serverhostname"].':8083/api/'$postdata,$answer);
+
     if($answer == 'OK') {
         $result = "success";
     } else {
         $result = $answer;
     }
-    return $result;
 
+    return $result;
 }
 
 function vesta_ClientArea($params) {