Offsite portal support for secure vpn connectivity.
[openemr.git] / library / ajax / offsite_portal_ajax.php
blobfa365ef8bb02aea5b520cb4b6fba6ddbc8e3caf7
1 <?php
2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
4 //
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 //
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Vinish K <vinish@zhservices.com>
26 // +------------------------------------------------------------------------------+
27 //SANITIZE ALL ESCAPES
28 $sanitize_all_escapes=true;
31 //STOP FAKE REGISTER GLOBALS
32 $fake_register_globals=false;
34 require_once(dirname(__FILE__)."/../../interface/globals.php");
35 require_once("$srcdir/acl.inc");
36 require_once(dirname(__FILE__)."/../../myportal/soap_service/portal_connectivity.php");
38 if($_POST['action'] == 'check_file' && acl_check('admin', 'super')){
39 $client = portal_connection();
40 $error_message = '';
41 try {
42 $response = $client->getPortalConnectionFiles($credentials);
44 catch(SoapFault $e){
45 error_log('SoapFault Error');
46 $error_message = xlt('Patient Portal connectivity issue');
48 catch(Exception $e){
49 error_log('Exception Error');
50 $error_message = xlt('Patient Portal connectivity issue');
52 if($response['status'] == 1){
53 if($response['value'] != '')
54 echo "OK";
55 else
56 echo $error_message;
58 else{
59 echo xlt('Offsite Portal web Service Failed').": ".text($response['value']);