/**
  * Execute the request
  *
  * @param string $request  Request to execute
  * @param string $location Webservice URL
  * @param string $action   Action
  * @param int    $version  SOAP version
  * @param int    $one_way  One way
  *
  * @see parent::__doRequest
  *
  * @return null|string
  * @throws CMbException
  */
 public function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     $ca_file = $this->ca_info;
     if ($this->use_tunnel) {
         $tunnel_exist = false;
         $tunnel_pass = CAppUI::conf("eai tunnel_pass");
         $tunnel_object = new CHTTPTunnelObject();
         $tunnels = $tunnel_object->loadActiveTunnel();
         foreach ($tunnels as $_tunnel) {
             if ($_tunnel->checkStatus()) {
                 $location = preg_replace("#[^/]*//[^/]*#", $_tunnel->address, $location);
                 $ca_file = $_tunnel->ca_file;
                 $tunnel_exist = true;
                 break;
             }
         }
         if (!$tunnel_exist && $tunnel_pass === "0") {
             throw new CMbException("Pas de tunnel actif");
         }
     }
     $response = null;
     if ($this->return_mode == "file") {
         $this->doRequestToFile($request, $location, $action, $ca_file);
         return "";
     } elseif ($this->xop_mode) {
         $response = $this->doRequestXOP($request, $location, $action, $ca_file);
     } else {
         $response = parent::__doRequest($request, $location, $action, $version, $one_way);
     }
     if ($this->return_mode == "normal") {
         return $response;
     }
     if (!$response) {
         return null;
     }
     $document = new CMbXMLDocument();
     $document->loadXMLSafe($response, null, true);
     $xpath = new CMbXPath($document);
     $documentElement = $document->documentElement;
     $xpath->registerNamespace($documentElement->prefix, $documentElement->namespaceURI);
     $body = $xpath->queryUniqueNode("/{$documentElement->prefix}:Envelope/{$documentElement->prefix}:Body");
     $new_document = new CMbXMLDocument("UTF-8");
     $new_document->appendChild($new_document->importNode($body->firstChild, true));
     $this->response_body = $new_document->saveXML();
     return $response;
 }
<?php

/**
 * $Id$
 *  
 * @category EAI
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$http_tunnel = new CHTTPTunnelObject();
$tunnels = $http_tunnel->loadList();
$smarty = new CSmartyDP();
$smarty->assign("tunnels", $tunnels);
$smarty->display("inc_list_tunnel.tpl");
Beispiel #3
0
<?php

/**
 * $Id$
 *  
 * @category EAI
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$action = CValue::get("action", null);
$id = CValue::get("idTunnel", null);
$param = CValue::get("param", null);
$tunnel = new CHTTPTunnelObject();
$tunnel->load($id);
$http_client = new CHTTPClient($tunnel->address);
if ($tunnel->ca_file) {
    $http_client->setSSLPeer($tunnel->ca_file);
}
$result = "";
switch ($action) {
    case "restart":
        $http_client->setOption(CURLOPT_CUSTOMREQUEST, "CMD RESTART");
        $result = $http_client->executeRequest();
        break;
    case "stop":
        $http_client->setOption(CURLOPT_CUSTOMREQUEST, "CMD STOP");
        $result = $http_client->executeRequest();
        break;
    case "stat":
Beispiel #4
0
<?php

/**
 * $Id$
 *  
 * @category EAI
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$id_tunnel = CValue::get("tunnel_id");
$http_tunnel = new CHTTPTunnelObject();
$http_tunnel->load($id_tunnel);
$smarty = new CSmartyDP();
$smarty->assign("tunnel", $http_tunnel);
$smarty->display("inc_edit_tunnel.tpl");