Merge branch 'master' of https://github.com/openemr/openemr into signer-templates
[openemr.git] / portal / verify_session.php
blob517cc805f596ab5aced97c57cf49dc789de5be80
1 <?php
2 /**
3 * portal/verify_session.php
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Cassian LUP <cassi.lup@gmail.com>
8 * @author Kevin Yeh <kevin.y@integralemr.com>
9 * @author Jerry Padgett <sjpadgett@gmail.com>
10 * @author Brady Miller <brady.g.miller@gmail.com>
11 * @copyright Copyright (c) 2011 Cassian LUP <cassi.lup@gmail.com>
12 * @copyright Copyright (c) 2013 Kevin Yeh <kevin.y@integralemr.com>
13 * @copyright Copyright (c) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
14 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
15 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
18 // All of the common intialization steps for the get_* patient portal functions are now in this single include.
22 //continue session
23 // Will start the (patient) portal OpenEMR session/cookie.
24 require_once(dirname(__FILE__) . "/../src/Common/Session/SessionUtil.php");
25 OpenEMR\Common\Session\SessionUtil::portalSessionStart();
27 //landing page definition -- where to go if something goes wrong
28 $landingpage = "index.php?site=" . urlencode($_SESSION['site_id']);
31 // kick out if patient not authenticated
32 if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite_two'])) {
33 $pid = $_SESSION['pid'];
34 } else {
35 OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy();
36 header('Location: '.$landingpage.'&w');
37 exit;
42 $ignoreAuth=true; // ignore the standard authentication for a regular OpenEMR user
43 require_once(dirname(__file__) . './../interface/globals.php');