Explorar o código

bugfix changepackage

andre %!s(int64=3) %!d(string=hai) anos
pai
achega
9af98e7c5d
Modificáronse 2 ficheiros con 16 adicións e 13 borrados
  1. 16 4
      api/cwp7/Admin.php
  2. 0 9
      cwp7.php

+ 16 - 4
api/cwp7/Admin.php

@@ -91,6 +91,9 @@ class cwp7_Admin {
 	 * @return array of account informations or error message
 	 */
     public function createAccount($params) {
+        if(!isset($params['package'])) {
+            return array('error_msg' => 'Error: missing parameter package');
+        }
         if(!isset($params['domain'])) {
             return array('error_msg' => 'Error: missing parameter domain');
         }
@@ -103,8 +106,17 @@ class cwp7_Admin {
         if(!isset($params['email'])) {
             return array('error_msg' => 'Error: missing parameter email');
         }
-        if(!isset($params['package'])) {
-            return array('error_msg' => 'Error: missing parameter package');
+        if(!isset($params['inode'])) {
+            return array('error_msg' => 'Error: missing parameter inode');
+        }
+        if(!isset($params['nofile'])) {
+            return array('error_msg' => 'Error: missing parameter nofile');
+        }
+        if(!isset($params['nproc'])) {
+            return array('error_msg' => 'Error: missing parameter nproc');
+        }
+        if(!isset($params['server_ips'])) {
+            return array('error_msg' => 'Error: missing parameter server_ips');
         }
         if(!isset($params['autossl'])) {
             $params['autossl'] = 0;
@@ -119,8 +131,8 @@ class cwp7_Admin {
             'autossl'       => $params['autossl'],
             'encodepass'    => true,
 			'inode'         => $params['inode'],
-            'nofile'        => $params['nofile'],
-            'nproc'         => $params['nproc'],
+            'limit_nofile'  => $params['nofile'],
+            'limit_nproc'   => $params['nproc'],
             'server_ips'    => $params['server_ips'],
         );
         return $this->doRequest('account', 'add', $data);

+ 0 - 9
cwp7.php

@@ -412,15 +412,6 @@ function cwp7_ChangePackage($params) {
 		'processes' => $params["configoption4"],
 	);
 	$response = $cwp7->modifyAccount($data);
-
-	logModuleCall(
-		'cwp7',
-		__FUNCTION__,
-		$data,
-		'debug',
-		$response
-	);
-
 	if($response['status'] != 'OK') {
 		return 'Error: ' . $response['error_msg'];
 	}