attach bill note to correct encounter (#4344)
[openemr.git] / portal / patient / _machine_config.php
blob9510fb848fcd7c7c95d707a11e4b7979617e279b
1 <?php
3 /**
4 * @package Patient
6 * MACHINE-SPECIFIC CONFIGURATION SETTINGS
8 * The configuration settings in this file can be changed to suit the
9 * machine on which the app is running (ex. local, staging or production).
11 * This file should not be added to version control, rather a template
12 * file should be added instead and then copied for each install
14 * From phreeze package
15 * @license http://www.gnu.org/copyleft/lesser.html LGPL
19 /* */
21 // Will start the (patient) portal OpenEMR session/cookie.
22 require_once(dirname(__FILE__) . "/../../src/Common/Session/SessionUtil.php");
23 OpenEMR\Common\Session\SessionUtil::portalSessionStart();
25 if (isset($_SESSION['pid']) && (isset($_SESSION['patient_portal_onsite_two']) || $_SESSION['register'] === true)) {
26 $pid = $_SESSION['pid'];
27 $ignoreAuth_onsite_portal = true;
28 GlobalConfig::$PORTAL = 1;
29 require_once(dirname(__FILE__) . "/../../interface/globals.php");
30 } else {
31 OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy();
32 GlobalConfig::$PORTAL = 0;
33 $ignoreAuth = false;
34 require_once(dirname(__FILE__) . "/../../interface/globals.php");
35 if (!isset($_SESSION['authUserID'])) {
36 $landingpage = "index.php";
37 header('Location: ' . $landingpage);
38 exit;
42 require_once 'verysimple/Phreeze/ConnectionSetting.php';
43 require_once("verysimple/HTTP/RequestUtil.php");
45 /**
46 * database connection settings
48 GlobalConfig::$CONNECTION_SETTING = new ConnectionSetting();
49 GlobalConfig::$CONNECTION_SETTING->ConnectionString = $GLOBALS['host'] . ":" . $GLOBALS['port'];
50 GlobalConfig::$CONNECTION_SETTING->DBName = $GLOBALS['dbase'];
51 GlobalConfig::$CONNECTION_SETTING->Username = $GLOBALS['login'];
52 GlobalConfig::$CONNECTION_SETTING->Password = $GLOBALS['pass'];
53 GlobalConfig::$CONNECTION_SETTING->Type = "MySQLi";
54 if (!$disable_utf8_flag) {
55 if (!empty($sqlconf["db_encoding"]) && ($sqlconf["db_encoding"] == "utf8mb4")) {
56 GlobalConfig::$CONNECTION_SETTING->Charset = "utf8mb4";
57 } else {
58 GlobalConfig::$CONNECTION_SETTING->Charset = "utf8";
62 GlobalConfig::$CONNECTION_SETTING->Multibyte = true;
63 // Turn off STRICT SQL
64 GlobalConfig::$CONNECTION_SETTING->BootstrapSQL = "SET sql_mode = '', time_zone = '" .
65 (new DateTime())->format("P") . "'";
67 /**
68 * the root url of the application with trailing slash, for example http://localhost/patient/
69 * default is relative base address
71 if ($GLOBALS['portal_onsite_two_basepath']) {
72 GlobalConfig::$ROOT_URL = RequestUtil::GetServerRootUrl() . preg_replace('/^\//', '', $GLOBALS['web_root']) . '/portal/patient/';
73 } else {
74 GlobalConfig::$ROOT_URL = $GLOBALS['web_root'] . '/portal/patient/';
78 /**
79 * timezone
81 // date_default_timezone_set("UTC");
83 // if Multibyte support is specified then we need to check if multibyte functions are available
84 // if you receive this error then either install multibyte extensions or set Multibyte to false
85 if (GlobalConfig::$CONNECTION_SETTING->Multibyte && !function_exists('mb_strlen')) {
86 die('<html>Multibyte extensions are not installed but Multibyte is set to true in _machine_config.php</html>');