Merge pull request #10857 from adixon/CRM-21063
[civicrm-core.git] / CRM / Utils / SoapServer.php
index 2357d34dcbd48b9516fcfc7ff32b50c27fe162ac..5ab5672c34461641027e59a451786cfe0dbbc53e 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -29,7 +29,7 @@
  * This class handles all SOAP client requests.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
  */
 class CRM_Utils_SoapServer {
 
@@ -122,8 +122,7 @@ class CRM_Utils_SoapServer {
       $loadCMSBootstrap = TRUE;
     }
 
-    $className = $this->ufClass;
-    $result =& $className::authenticate($name, $pass, $loadCMSBootstrap);
+    $result = CRM_Utils_System::authenticate($name, $pass, $loadCMSBootstrap);
 
     if (empty($result)) {
       throw new SoapFault('Client', 'Invalid login');
@@ -158,7 +157,8 @@ class CRM_Utils_SoapServer {
       'body' => $body,
       'version' => 3,
     );
-    return civicrm_api('Mailing', 'event_bounce', $params);
+    $result = civicrm_api('Mailing', 'event_bounce', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -182,7 +182,8 @@ class CRM_Utils_SoapServer {
       'hash' => $hash,
       'version' => 3,
     );
-    return civicrm_api('MailingGroup', 'event_unsubscribe', $params);
+    $result = civicrm_api('MailingGroup', 'event_unsubscribe', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -204,7 +205,8 @@ class CRM_Utils_SoapServer {
       'hash' => $hash,
       'version' => 3,
     );
-    return civicrm_api('MailingGroup', 'event_domain_unsubscribe', $params);
+    $result = civicrm_api('MailingGroup', 'event_domain_unsubscribe', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -226,7 +228,8 @@ class CRM_Utils_SoapServer {
       'hash' => $hash,
       'version' => 3,
     );
-    return civicrm_api('MailingGroup', 'event_resubscribe', $params);
+    $result = civicrm_api('MailingGroup', 'event_resubscribe', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -245,7 +248,8 @@ class CRM_Utils_SoapServer {
       'group_id' => $group,
       'version' => 3,
     );
-    return civicrm_api('MailingGroup', 'event_subscribe', $params);
+    $result = civicrm_api('MailingGroup', 'event_subscribe', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -267,7 +271,8 @@ class CRM_Utils_SoapServer {
       'hash' => $hash,
       'version' => 3,
     );
-    return civicrm_api('Mailing', 'event_confirm', $params);
+    $result = civicrm_api('Mailing', 'event_confirm', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -296,7 +301,8 @@ class CRM_Utils_SoapServer {
       'time_stamp' => date('YmdHis'),
       'version' => 3,
     );
-    return civicrm_api('Mailing', 'event_reply', $params);
+    $result = civicrm_api('Mailing', 'event_reply', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -318,7 +324,8 @@ class CRM_Utils_SoapServer {
       'email' => $email,
       'version' => 3,
     );
-    return civicrm_api('Mailing', 'event_forward', $params);
+    $result = civicrm_api('Mailing', 'event_forward', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
   /**
@@ -331,7 +338,8 @@ class CRM_Utils_SoapServer {
   public function get_contact($key, $params) {
     $this->verify($key);
     $params['version'] = 3;
-    return civicrm_api('contact', 'get', $params);
+    $result = civicrm_api('contact', 'get', $params);
+    return CRM_Utils_Array::encode_items($result);
   }
 
 }