Fixes #7503 user admin create empty google sign in (#7504)
[openemr.git] / portal / patient / _machine_config.php
blob7343ad2f57326b1dcbdaee4e0ebbf5aa5e8fcbe1
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(__DIR__ . "/../../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 if (!isset($_SESSION['portal_init'])) {
30 $_SESSION['portal_init'] = true;
32 require_once(__DIR__ . "/../../interface/globals.php");
33 } else {
34 OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy();
35 GlobalConfig::$PORTAL = 0;
36 $ignoreAuth = false;
37 require_once(__DIR__ . "/../../interface/globals.php");
38 if (!isset($_SESSION['authUserID'])) {
39 $landingpage = "index.php";
40 header('Location: ' . $landingpage);
41 exit;
45 require_once 'verysimple/Phreeze/ConnectionSetting.php';
46 require_once("verysimple/HTTP/RequestUtil.php");
48 /**
49 * database connection settings
51 GlobalConfig::$CONNECTION_SETTING = new ConnectionSetting();
52 GlobalConfig::$CONNECTION_SETTING->ConnectionString = $GLOBALS['host'] . ":" . $GLOBALS['port'];
53 GlobalConfig::$CONNECTION_SETTING->DBName = $GLOBALS['dbase'];
54 GlobalConfig::$CONNECTION_SETTING->Username = $GLOBALS['login'];
55 GlobalConfig::$CONNECTION_SETTING->Password = $GLOBALS['pass'];
56 GlobalConfig::$CONNECTION_SETTING->Type = "MySQLi";
57 if (!$disable_utf8_flag) {
58 if (!empty($sqlconf["db_encoding"]) && ($sqlconf["db_encoding"] == "utf8mb4")) {
59 GlobalConfig::$CONNECTION_SETTING->Charset = "utf8mb4";
60 } else {
61 GlobalConfig::$CONNECTION_SETTING->Charset = "utf8";
65 GlobalConfig::$CONNECTION_SETTING->Multibyte = true;
66 // Turn off STRICT SQL
67 GlobalConfig::$CONNECTION_SETTING->BootstrapSQL = "SET sql_mode = '', time_zone = '" .
68 (new DateTime())->format("P") . "'";
70 /**
71 * the root url of the application with trailing slash, for example http://localhost/patient/
72 * default is relative base address
74 GlobalConfig::$WEB_ROOT = $GLOBALS['qualified_site_addr'];
75 if ($GLOBALS['portal_onsite_two_basepath']) {
76 GlobalConfig::$ROOT_URL = GlobalConfig::$WEB_ROOT . '/portal/patient/';
77 } else {
78 GlobalConfig::$ROOT_URL = $GLOBALS['web_root'] . '/portal/patient/';
82 /**
83 * timezone
85 // date_default_timezone_set("UTC");
87 // if Multibyte support is specified then we need to check if multibyte functions are available
88 // if you receive this error then either install multibyte extensions or set Multibyte to false
89 if (GlobalConfig::$CONNECTION_SETTING->Multibyte && !function_exists('mb_strlen')) {
90 die('<html>Multibyte extensions are not installed but Multibyte is set to true in _machine_config.php</html>');