andre 3 лет назад
Родитель
Сommit
904eda4651
1 измененных файлов с 19 добавлено и 2 удалено
  1. 19 2
      api/test.php

+ 19 - 2
api/test.php

@@ -86,9 +86,26 @@ if(isset($r['error_msg'])) {
 // Actions //
 /////////////
 
-// Get All Accounts
 if($action == 'gaa')
 {
     $r = $cwp7->getAllAccounts();
-	print_r($r);
+	if(isset($r['error_msg'])) {
+        echo 'Error : could not fetch list of accounts on '. $cwp7URL . ' :-(' . PHP_EOL;
+        print_r($r);
+	} else {
+        echo 'OK : got a list of '. count($r['msj']) . ' accounts on ' . $cwp7URL . ' :-)' . PHP_EOL;
+    }
 }
+
+// Get Account Informations
+if($action == 'gai')
+{
+	$r = $cwp7->getAccount($args['account_name']);
+	if(isset($r['error_msg'])) {
+        echo 'Error : could not fetch information of '. $args['account_name'] . ' :-(' . PHP_EOL;
+        print_r($r);
+	} else {
+		echo 'OK : got the infos for account ' . $args['account_name'] . ' :-)' . PHP_EOL;
+		print_r($r);
+    }
+}