Merge pull request #5250 from jitendrapurohit/CRM-15934update
[civicrm-core.git] / CRM / Utils / SoapServer.php
index 3f3248bd71d6b4c2218a96989733d2ac6aa3e94e..9c7a34f2028262b6ffe13433cec4057175a8047e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -45,7 +45,6 @@ class CRM_Utils_SoapServer {
 
   /**
    * Number of seconds we should let a soap process idle
-   * @static
    */
   static $soap_timeout = 0;
 
@@ -70,10 +69,10 @@ class CRM_Utils_SoapServer {
   /**
    * Simple ping function to test for liveness.
    *
-   * @param string $var   The string to be echoed
+   * @param string $var
+   *   The string to be echoed.
    *
-   * @return string       $var
-   * @access public
+   * @return string
    */
   public function ping($var) {
     $session = CRM_Core_Session::singleton();
@@ -83,13 +82,13 @@ class CRM_Utils_SoapServer {
   }
 
   /**
-   * Verify a SOAP key
+   * Verify a SOAP key.
    *
-   * @param string $key The soap key generated by authenticate()
+   * @param string $key
+   *   The soap key generated by authenticate().
    *
    * @throws SoapFault
    * @return void
-   * @access public
    */
   public function verify($key) {
     $session = CRM_Core_Session::singleton();
@@ -101,7 +100,6 @@ class CRM_Utils_SoapServer {
       throw new SoapFault('Client', 'Invalid key');
     }
 
-
     if (self::$soap_timeout &&
       $t > ($session->get('soap_time') + self::$soap_timeout)
     ) {
@@ -114,27 +112,28 @@ class CRM_Utils_SoapServer {
   }
 
   /**
-   * Authentication wrapper to the UF Class
+   * Authentication wrapper to the UF Class.
    *
-   * @param string $name Login name
-   * @param string $pass Password
+   * @param string $name
+   *   Login name.
+   * @param string $pass
+   *   Password.
    *
    * @param bool $loadCMSBootstrap
    *
    * @throws SoapFault
-   * @return string           The SOAP Client key
-   * @access public
-   * @static
+   * @return string
+   *   The SOAP Client key
    */
   public function authenticate($name, $pass, $loadCMSBootstrap = FALSE) {
-    require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->ufClass) . '.php');
+    require_once str_replace('_', DIRECTORY_SEPARATOR, $this->ufClass) . '.php';
 
-    if ($this->ufClass == 'CRM_Utils_System_Joomla'){
-      $loadCMSBootstrap = true;
+    if ($this->ufClass == 'CRM_Utils_System_Joomla') {
+      $loadCMSBootstrap = TRUE;
     }
 
     $className = $this->ufClass;
-    $result =& $className::authenticate($name, $pass, $loadCMSBootstrap );
+    $result =& $className::authenticate($name, $pass, $loadCMSBootstrap);
 
     if (empty($result)) {
       throw new SoapFault('Client', 'Invalid login');
@@ -147,7 +146,9 @@ class CRM_Utils_SoapServer {
     return sha1($result[2]);
   }
 
-  /*** MAILER API ***/
+  /**
+   * MAILER API.
+   */
   public function mailer_event_bounce($key, $job, $queue, $hash, $body) {
     $this->verify($key);
     $params = array(
@@ -331,5 +332,5 @@ class CRM_Utils_SoapServer {
     $params['version'] = 3;
     return civicrm_api('contact', 'get', $params);
   }
-}
 
+}