Răsfoiți Sursa

add ressources

andre 2 ani în urmă
părinte
comite
682f74bdad
2 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 2 11
      api/KerioWhmcs.php
  2. 9 0
      api/class/KerioApi.php

+ 2 - 11
api/KerioWhmcs.php

@@ -447,7 +447,7 @@ class KerioWhmcs extends KerioConnectApi {
 	 */
 	function createResouce($attr, $domain) {
 		$params = array(
-			'resources' => array(
+			'resources' => array(array(
 				'name' => $attr['name'],
 				'description' => $attr['description'],
 				'type' => $attr['type'],
@@ -455,19 +455,10 @@ class KerioWhmcs extends KerioConnectApi {
 				'resourceUsers' => array('id' => $domain, 'type' => 'AuthDomainPrincipal'),
 				'manager' => array('id' => $attr['manager'], 'type' => 'UserPrincipal'),
 				'domainId' => $domain
-			)
+			))
 		);
 
 		$result = $this->sendRequest('Resources.create', $params);
-
-		logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $result,
-            'Debug Error',
-            $params
-        );
-
 		return $result;
 	}
 

+ 9 - 0
api/class/KerioApi.php

@@ -475,6 +475,15 @@ class KerioApi implements KerioApiInterface {
 		$json_response = $this->send('POST', $json_request);
 		/* Return */
 		$response = json_decode($json_response, TRUE);
+		
+		logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $json_request,
+            'Debug Error',
+            $response
+        );
+
 		return $response['result'];
 	}