New onsite patient portal, take 4.
[openemr.git] / portal / verify_session.php
blobf23c4df092980af183dbae976a1967b874c41bd6
1 <?php
2 /**
4 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
5 * Copyright (C) 2013 Kevin Yeh <kevin.y@integralemr.com>
6 * Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * 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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Cassian LUP <cassi.lup@gmail.com>
21 * @author Kevin Yeh <kevin.y@integralemr.com>
22 * @author Jerry Padgett <sjpadgett@gmail.com>
23 * @link http://www.open-emr.org
25 * Moved out of individual get_* portal functions for re-use by
26 * Kevin Yeh (kevin.y@integralemr.com) May 2013
30 // All of the common intialization steps for the get_* patient portal functions are now in this single include.
32 //SANITIZE ALL ESCAPES
33 $sanitize_all_escapes=true;
35 //STOP FAKE REGISTER GLOBALS
36 $fake_register_globals=false;
38 //continue session
39 session_start();
41 //landing page definition -- where to go if something goes wrong
42 $landingpage = "index.php?site=".$_SESSION['site_id'];
45 // kick out if patient not authenticated
46 if ( isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite_two']) ) {
47 $pid = $_SESSION['pid'];
49 else {
50 session_destroy();
51 header('Location: '.$landingpage.'&w');
52 exit;
56 $ignoreAuth=true; // ignore the standard authentication for a regular OpenEMR user
57 require_once(dirname(__file__) . './../interface/globals.php');