andre 3 лет назад
Родитель
Сommit
7d3e3f73df
2 измененных файлов с 16 добавлено и 5 удалено
  1. 1 1
      api/cwp7/Admin.php
  2. 15 4
      api/test.php

+ 1 - 1
api/cwp7/Admin.php

@@ -214,7 +214,7 @@ class cwp7_Admin {
 	 * 
 	 * @return array packages
 	 */
-    public function changePackage($params)
+    public function changePass($params)
 	{
         if(!isset($params['user'])) {
             return array('error_msg' => 'Error: missing parameter user');

+ 15 - 4
api/test.php

@@ -91,10 +91,10 @@ if($action == 'gaa')
     $r = $cwp7->getAllAccounts();
 	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;
     }
+	print_r($r);
 }
 
 // Get Account Informations
@@ -103,9 +103,20 @@ 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);
     }
-}
+	print_r($r);
+}
+
+// Get all Packages
+if($action == 'gap')
+{
+	$r = $cwp7->getPackages();
+	if(isset($r['error_msg'])) {
+        echo 'Error : could not fetch information of packages :-(' . PHP_EOL;
+	} else {
+		echo 'OK : got the infos of packages :-)' . PHP_EOL;
+    }
+	print_r($r);
+}