security fix in master branch
[openemr.git] / library / ajax / offsite_portal_ajax.php
blob5379e2bcfe6bb4eff9cd28f1337ee797202f0daf
1 <?php
2 /**
3 * Ajax script to connect to offsite patient portal.
5 * Currently supports collecting the vpn connection package and
6 * can be expanded to support other features in the future.
8 * Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Eldho Chacko <eldho@zhservices.com>
23 * @author Vinish K <vinish@zhservices.com>
24 * @link http://www.open-emr.org
28 require_once(dirname(__FILE__)."/../../interface/globals.php");
29 require_once("$srcdir/acl.inc");
30 require_once(dirname(__FILE__)."/../../myportal/soap_service/portal_connectivity.php");
32 if ($_POST['action'] == 'check_file' && acl_check('admin', 'super')) {
33 $client = portal_connection();
34 $error_message = '';
35 try {
36 $response = $client->getPortalConnectionFiles($credentials);
37 } catch (SoapFault $e) {
38 error_log('SoapFault Error');
39 $error_message = xlt('Patient Portal connectivity issue');
40 } catch (Exception $e) {
41 error_log('Exception Error');
42 $error_message = xlt('Patient Portal connectivity issue');
45 if ($response['status'] == 1) {
46 if ($response['value'] != '') {
47 echo "OK";
48 } else {
49 echo $error_message;
51 } else {
52 echo xlt('Offsite Portal web Service Failed').": ".text($response['value']);