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