andre 3 년 전
부모
커밋
d51c6fc280
2개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      api/cwp7/Admin.php
  2. 5 5
      api/test.php

+ 1 - 1
api/cwp7/Admin.php

@@ -330,7 +330,7 @@ class cwp7_Admin {
         $response = curl_exec($ch);
         if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) != 200) {
             curl_close($ch);
-            return array('status' => 'error', 'err_msg' => curl_error($ch));
+            return array('status' => 'Error', 'err_msg' => curl_error($ch));
         };
         curl_close($ch);
         return json_decode($response, true);

+ 5 - 5
api/test.php

@@ -89,7 +89,7 @@ if(isset($r['error_msg'])) {
 if($action == 'gaa')
 {
     $r = $cwp7->getAllAccounts();
-	if(isset($r['error_msg'])) {
+	if($r['status'] == 'Error') {
         echo 'Error : could not fetch list of accounts on '. $cwp7URL . ' :-(' . PHP_EOL;
 	} else {
         echo 'OK : got a list of '. count($r['msj']) . ' accounts on ' . $cwp7URL . ' :-)' . PHP_EOL;
@@ -101,7 +101,7 @@ if($action == 'gaa')
 if($action == 'gai')
 {
 	$r = $cwp7->getAccount($args['account_name']);
-	if(isset($r['error_msg'])) {
+	if($r['status'] == 'Error') {
         echo 'Error : could not fetch information of '. $args['account_name'] . ' :-(' . PHP_EOL;
 	} else {
 		echo 'OK : got the infos for account ' . $args['account_name'] . ' :-)' . PHP_EOL;
@@ -113,7 +113,7 @@ if($action == 'gai')
 if($action == 'gap')
 {
 	$r = $cwp7->getPackages();
-	if(isset($r['error_msg'])) {
+	if($r['status'] == 'Error') {
         echo 'Error : could not fetch information of packages :-(' . PHP_EOL;
 	} else {
 		echo 'OK : got the infos of ' . count($r['msj']) . 'packages :-)' . PHP_EOL;
@@ -125,7 +125,7 @@ if($action == 'gap')
 if($action == 'gqu')
 {
 	$r = $cwp7->getQuota($args['account_name']);
-	if(isset($r['error_msg'])) {
+	if($r['status'] == 'Error') {
         echo 'Error : could not fetch quota information of '. $args['account_name'] . ' :-(' . PHP_EOL;
 	} else {
 		echo 'OK : got the quota infos for account ' . $args['account_name'] . ' :-)' . PHP_EOL;
@@ -137,7 +137,7 @@ if($action == 'gqu')
 if($action == 'gas')
 {
 	$r = $cwp7->getAutoSSL($args['account_name']);
-	if(isset($r['error_msg'])) {
+	if($r['status'] == 'Error') {
         echo 'Error : could not fetch AutoSSL information of '. $args['account_name'] . ' :-(' . PHP_EOL;
 	} else {
 		echo 'OK : got the AutoSSL infos for account ' . $args['account_name'] . ' :-)' . PHP_EOL;