fix: Update patient_tracker.php (#6595)
[openemr.git] / library / ajax / unset_session_ajax.php
blob36d41782dcf4007e78c6190b42b05ced534364e1
1 <?php
3 /**
4 * library/ajax/unset_session_ajax.php Clear active patient on the server side.
6 * @package OpenEMR
7 * @link https://www.open-emr.org
8 * @author Visolve <services@visolve.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2012 Visolve <services@visolve.com>
11 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../../interface/globals.php");
16 require_once("../pid.inc.php");
17 require_once("../group.inc.php");
19 use OpenEMR\Common\Csrf\CsrfUtils;
21 if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
22 CsrfUtils::csrfNotVerified();
25 //Setpid function is called on receiving an ajax request.
26 if (($_POST['func'] == "unset_pid")) {
27 setpid(0);
30 //Setpid function is called on receiving an ajax request.
31 if (($_POST['func'] == "unset_gid")) {
32 unsetGroup();