Esempio n. 1
0
 /**
  * If is authentificate
  *
  * @return bool|void
  */
 function isAuthentificate()
 {
     $options = array("encoding" => $this->encoding);
     try {
         $soap_client = new CSOAPClient($this->type_soap);
         $password = $this->getPassword();
         $soap_client->make($this->host, $this->user, $password, $this->type_echange, $options, null, null, $this->local_cert, $this->passphrase, false, $this->verify_peer, $this->cafile, $this->wsdl_external);
         $soap_client->checkServiceAvailability();
     } catch (Exception $e) {
         $this->_reachable = 1;
         $this->_message = $e->getMessage();
         return false;
     }
     return true;
 }
Esempio n. 2
0
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
// Check params
if (null == ($exchange_source_name = CValue::get("exchange_source_name"))) {
    CAppUI::stepAjax("Aucun nom de source d'échange spécifié", UI_MSG_ERROR);
}
/** @var CSourceSOAP $exchange_source */
$exchange_source = CExchangeSource::get($exchange_source_name, "soap", true, null, false);
if (!$exchange_source) {
    CAppUI::stepAjax("Aucune source d'échange disponible pour ce nom : '{$exchange_source_name}'", UI_MSG_ERROR);
}
if (!$exchange_source->host) {
    CAppUI::stepAjax("Aucun hôte pour la source d'échange : '{$exchange_source_name}'", UI_MSG_ERROR);
}
$options = array("encoding" => $exchange_source->encoding);
$soap_client = new CSOAPClient($exchange_source->type_soap);
$soap_client->make($exchange_source->host, $exchange_source->user, $exchange_source->getPassword(), $exchange_source->type_echange, $options, null, null, $exchange_source->local_cert, $exchange_source->passphrase, $exchange_source->safe_mode, $exchange_source->verify_peer, $exchange_source->cafile, $exchange_source->wsdl_external);
if (!$soap_client || $soap_client->client->soap_client_error) {
    CAppUI::stepAjax("Impossible de joindre la source de donnée : '{$exchange_source_name}'", UI_MSG_ERROR);
} else {
    CAppUI::stepAjax("Connecté à la source '{$exchange_source_name}'");
}
try {
    $soap_client->client->checkServiceAvailability();
} catch (CMbException $e) {
    $e->stepAjax();
}