preparing for 5.0.1 release in several weeks (#1509)
[openemr.git] / portal / patient / _machine_config.php
blob0320d2c2862f11134068b129a19966583c434914
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 session_start();
20 if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite_two'])) {
21 $pid = $_SESSION['pid'];
22 $ignoreAuth = true;
23 GlobalConfig::$PORTAL = true;
24 require_once(dirname(__FILE__) . "/../../interface/globals.php");
25 } else {
26 session_destroy();
27 GlobalConfig::$PORTAL = false;
28 $ignoreAuth = false;
29 require_once(dirname(__FILE__) . "/../../interface/globals.php");
30 if (! isset($_SESSION['authUserID'])) {
31 $landingpage = "index.php";
32 header('Location: '.$landingpage);
33 exit;
37 require_once 'verysimple/Phreeze/ConnectionSetting.php';
38 require_once("verysimple/HTTP/RequestUtil.php");
40 /**
41 * database connection settings
43 GlobalConfig::$CONNECTION_SETTING = new ConnectionSetting();
44 GlobalConfig::$CONNECTION_SETTING->ConnectionString = $GLOBALS['host'] . ":" . $GLOBALS['port'];
45 GlobalConfig::$CONNECTION_SETTING->DBName = $GLOBALS['dbase'];
46 GlobalConfig::$CONNECTION_SETTING->Username = $GLOBALS['login'];
47 GlobalConfig::$CONNECTION_SETTING->Password = $GLOBALS['pass'];
48 GlobalConfig::$CONNECTION_SETTING->Type = "MySQLi";
49 if (!$disable_utf8_flag) {
50 GlobalConfig::$CONNECTION_SETTING->Charset = "utf8";
53 GlobalConfig::$CONNECTION_SETTING->Multibyte = true;
54 // Turn off STRICT SQL
55 GlobalConfig::$CONNECTION_SETTING->BootstrapSQL = "SET sql_mode = '', time_zone = '" .
56 (new DateTime())->format("P") . "'";
58 /**
59 * the root url of the application with trailing slash, for example http://localhost/patient/
60 * default is relative base address
62 if ($GLOBALS['portal_onsite_two_basepath']) {
63 GlobalConfig::$ROOT_URL = RequestUtil::GetServerRootUrl() . preg_replace('/^\//', '', $GLOBALS['web_root']) . '/portal/patient/';
64 } else {
65 GlobalConfig::$ROOT_URL = $GLOBALS['web_root'] . '/portal/patient/';
69 /**
70 * timezone
72 // date_default_timezone_set("UTC");
74 // if Multibyte support is specified then we need to check if multibyte functions are available
75 // if you receive this error then either install multibyte extensions or set Multibyte to false
76 if (GlobalConfig::$CONNECTION_SETTING->Multibyte && ! function_exists('mb_strlen')) {
77 die('<html>Multibyte extensions are not installed but Multibyte is set to true in _machine_config.php</html>');