Skip to content

Commit

Permalink
Version 4.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdugar committed Feb 24, 2022
1 parent 821538c commit 4f78cfc
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 91 deletions.
5 changes: 4 additions & 1 deletion alter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2944,4 +2944,7 @@ ALTER TABLE `user_details` ADD `force_password_reset` INT NULL DEFAULT NULL AFTE
INSERT INTO `global_config`
(`display_name`, `name`, `value`, `category`, `remote_sync_needed`, `updated_on`, `updated_by`, `status`)
VALUES
('App Locale/Language', 'app_locale', 'en_US', 'common', 'no', NULL, NULL, 'active');
('App Locale/Language', 'app_locale', 'en_US', 'common', 'no', NULL, NULL, 'active');

-- Amit 24-Feb-2022 version 4.4.8
UPDATE `system_config` SET `value` = '4.4.8' WHERE `system_config`.`name` = 'sc_version';
76 changes: 44 additions & 32 deletions configs/config.development.dist.php
Original file line number Diff line number Diff line change
@@ -1,74 +1,86 @@
<?php

require_once(__DIR__ . '/config.production.php');

$systemConfig = array();


// System Locale
$systemConfig['locale'] = 'en_US';

// VLSTS URL
$systemConfig['remoteURL'] = '';

// Enable/Disable Modules
// true => Enabled
// false => Disabled
$systemConfig['modules']['vl'] = true;
$systemConfig['modules']['eid'] = true;
$systemConfig['modules']['covid19'] = false;
$systemConfig['modules']['covid19'] = true;
$systemConfig['modules']['hepatitis'] = false;
$systemConfig['modules']['tb'] = false;

$systemConfig['instanceName']= '';
$systemConfig['instanceName'] = '';


// Database Settings
$systemConfig['dbName'] = '';
$systemConfig['databaseUserName'] = '';
$systemConfig['databasePassword'] = '';
$systemConfig['databaseName'] = '';
$systemConfig['databasePortNumber'] = 3306;
$systemConfig['passwordSalt']= 'PUT-A-RANDOM-STRING-HERE';
$systemConfig['tryCrypt']= 'XTOTESTTHECRYTPD';
$systemConfig['dbHost'] = '';
$systemConfig['dbUser'] = '';
$systemConfig['dbPassword'] = '';
$systemConfig['dbName'] = 'vlsm';
$systemConfig['dbPort'] = 3306;
$systemConfig['dbCharset'] = 'utf8mb4';


$systemConfig['passwordSalt'] = 'PUT-A-RANDOM-STRING-HERE';
$systemConfig['tryCrypt'] = 'PUT-A-RANDOM-STRING-HERE';


//Please use only GMAIL ID AND PASSWORD
$systemConfig['adminEmailUserName'] = '';
$systemConfig['adminEmailPassword'] = '';

// Portable Uniform Server : following is the path in the portable Uniform Server
//$systemConfig['mysqlDump'] = __DIR__.'\..\..\core\mysql\bin\mysqldump.exe';

// Windows : Change it to the mysqldump.exe path for your computer for eg.
// $systemConfig['mysqlDump'] = 'C:\wamp\mysql\bin\mysqldump.exe';

// Linux : default for Ubuntu 16.04, may be different for your distribution
// Linux : default for Ubuntu 20.04+, may be different for your distribution
$systemConfig['mysqlDump'] = '/usr/bin/mysqldump';


// VLSTS URL
$systemConfig['remoteURL'] = '';

$systemConfig['interfacing'] = array();


$interfaceConfig = array();
// Enable/Disable Interfacing
// true => Enabled
// false => Disabled
$interfaceConfig['enabled'] = false;
$systemConfig['interfacing']['enabled'] = false;

// Interfacing Database Details (not needed if above feature set to false)
$interfaceConfig['dbHost'] = '';
$interfaceConfig['dbUser'] = '';
$interfaceConfig['dbPassword'] = '';
$interfaceConfig['dbName'] = '';
$interfaceConfig['dbPort'] = 3306;
$systemConfig['interfacing']['dbHost'] = '';
$systemConfig['interfacing']['dbUser'] = '';
$systemConfig['interfacing']['dbPassword'] = '';
$systemConfig['interfacing']['dbName'] = 'interfacing';
$systemConfig['interfacing']['dbPort'] = 3306;
$systemConfig['interfacing']['dbCharset'] = 'utf8mb4';


$recencyConfig = array();
$systemConfig['recency'] = array();

// Domain URL of the Recency Web Application
$recencyConfig['url'] = '';
$systemConfig['recency']['url'] = '';

// This Salt should match the Salt on Recency Web app
$recencyConfig['crossloginSalt'] = "PUT-A-RANDOM-STRING-HERE";

// Enable/Disable Recency Sync

// Enable/Disable Recency Viral Load tests sync
// true => Enabled
// false => Disabled
$recencyConfig['vlsync'] = false;
$systemConfig['recency']['vlsync'] = false;


// Enable/Disable Cross Login with Recency
// true => Enabled
// false => Disabled
$recencyConfig['crosslogin'] = false;
$systemConfig['recency']['crosslogin'] = false;

// This Salt should match the Salt on Recency Web app
$systemConfig['recency']['crossloginSalt'] = "PUT-A-RANDOM-STRING-HERE";

return $systemConfig;
51 changes: 22 additions & 29 deletions configs/config.production.dist.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php
// This is a template file
require_once(APPLICATION_PATH . '/system/system.php');


$systemConfig = array();

// System Locale
$systemConfig['locale'] = 'en_US';

// VLSTS URL
$systemConfig['remoteURL'] = '';

// Enable/Disable Modules
// true => Enabled
// false => Disabled
$systemConfig['modules']['vl'] = true;
$systemConfig['modules']['eid'] = true;
$systemConfig['modules']['covid19'] = false;
$systemConfig['modules']['covid19'] = true;
$systemConfig['modules']['hepatitis'] = false;
$systemConfig['modules']['tb'] = false;

Expand All @@ -25,68 +24,62 @@
$systemConfig['dbHost'] = '';
$systemConfig['dbUser'] = '';
$systemConfig['dbPassword'] = '';
$systemConfig['dbName'] = '';
$systemConfig['dbName'] = 'vlsm';
$systemConfig['dbPort'] = 3306;
$systemConfig['dbCharset'] = 'utf8mb4';


$systemConfig['passwordSalt'] = 'PUT-A-RANDOM-STRING-HERE';
$systemConfig['tryCrypt'] = 'XTOTESTTHECRYTPD';
$systemConfig['tryCrypt'] = 'PUT-A-RANDOM-STRING-HERE';


//Please use only GMAIL ID AND PASSWORD
$systemConfig['adminEmailUserName'] = '';
$systemConfig['adminEmailPassword'] = '';

// If using WAMP default settings, then uncomment the following 2 lines
//$systemConfig['databasePassword'] = '';
//$systemConfig['databasePortNumber'] = 3306;

// Portable Uniform Server : following is the path in the portable Uniform Server
//$systemConfig['mysqlDump'] = __DIR__.'\..\..\core\mysql\bin\mysqldump.exe';

// Windows : Change it to the mysqldump.exe path for your computer for eg.
// $systemConfig['mysqlDump'] = 'C:\wamp\mysql\bin\mysqldump.exe';

// Linux : default for Ubuntu 16.04, may be different for your distribution
// Linux : default for Ubuntu 20.04+, may be different for your distribution
$systemConfig['mysqlDump'] = '/usr/bin/mysqldump';


// VLSTS URL
$systemConfig['remoteURL'] = '';

$systemConfig['interfacing'] = array();


$interfaceConfig = array();
// Enable/Disable Interfacing
// true => Enabled
// false => Disabled
$interfaceConfig['enabled'] = false;
$systemConfig['interfacing']['enabled'] = false;

// Interfacing Database Details (not needed if above feature set to false)
$interfaceConfig['dbHost'] = '';
$interfaceConfig['dbUser'] = '';
$interfaceConfig['dbPassword'] = '';
$interfaceConfig['dbName'] = '';
$interfaceConfig['dbPort'] = 3306;
$interfaceConfig['dbCharset'] = 'utf8mb4';
$systemConfig['interfacing']['dbHost'] = '';
$systemConfig['interfacing']['dbUser'] = '';
$systemConfig['interfacing']['dbPassword'] = '';
$systemConfig['interfacing']['dbName'] = 'interfacing';
$systemConfig['interfacing']['dbPort'] = 3306;
$systemConfig['interfacing']['dbCharset'] = 'utf8mb4';

$recencyConfig = array();
$systemConfig['recency'] = array();

// Domain URL of the Recency Web Application
$recencyConfig['url'] = '';
$systemConfig['recency']['url'] = '';



// Enable/Disable Recency Viral Load tests sync
// true => Enabled
// false => Disabled
$recencyConfig['vlsync'] = false;
$systemConfig['recency']['vlsync'] = false;


// Enable/Disable Cross Login with Recency
// true => Enabled
// false => Disabled
$recencyConfig['crosslogin'] = false;
$systemConfig['recency']['crosslogin'] = false;

// This Salt should match the Salt on Recency Web app
$recencyConfig['crossloginSalt'] = "PUT-A-RANDOM-STRING-HERE";
$systemConfig['recency']['crossloginSalt'] = "PUT-A-RANDOM-STRING-HERE";

return $systemConfig;
4 changes: 2 additions & 2 deletions dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<li><a href="#tbDashboard" data-toggle="tab" onclick="generateDashboard('tb');">TB Tests</a></li>
<?php } ?>
<?php
if (isset($recencyConfig['vlsync']) && $recencyConfig['vlsync'] == true) { ?>
if (isset($systemConfig['recency']['vlsync']) && $systemConfig['recency']['vlsync'] == true) { ?>
<li><a href="#recencyDashboard" data-name="recency" data-toggle="tab" onclick="generateDashboard('recency')"><?php echo _("Confirmation Tests for Recency");?></a></li>
<?php } ?>
</ul>
Expand Down Expand Up @@ -90,7 +90,7 @@

<?php } ?>

<?php if (isset($recencyConfig['vlsync']) && $recencyConfig['vlsync'] == true) { ?>
<?php if (isset($systemConfig['recency']['vlsync']) && $systemConfig['recency']['vlsync'] == true) { ?>
<div class="tab-pane fade in" id="recencyDashboard">
<!-- VL content -->
<section class="content">
Expand Down
6 changes: 3 additions & 3 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@
</ul>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<?php if ($recencyConfig['crosslogin']) {
$password = $crossLoginResult['password'] . $recencyConfig['crossloginSalt']; ?>
<?php if ($systemConfig['recency']['crosslogin']) {
$password = $crossLoginResult['password'] . $systemConfig['recency']['crossloginSalt']; ?>
<li class="user-menu">
<a onclick="setCrossLogin();" href="<?php echo rtrim($recencyConfig['url'], "/") . '/login?u=' . base64_encode($crossLoginResult['login_id']) . '&t=' . hash('sha256', $password) . '&name=' . base64_encode($crossLoginResult['user_name']); ?>" class="btn btn-link"><i class="fa fa-fw fa-external-link"></i> Recency</a>
<a onclick="setCrossLogin();" href="<?php echo rtrim($systemConfig['recency']['url'], "/") . '/login?u=' . base64_encode($crossLoginResult['login_id']) . '&t=' . hash('sha256', $password) . '&name=' . base64_encode($crossLoginResult['user_name']); ?>" class="btn btn-link"><i class="fa fa-fw fa-external-link"></i> Recency</a>
</li>
<?php } ?>
<li><span class="is-remote-server-reachable"></span></li>
Expand Down
4 changes: 2 additions & 2 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ function(data) {
}

$(document).ready(function() {
<?php if ($recencyConfig['crosslogin']) { ?>
<?php if ($systemConfig['recency']['crosslogin']) { ?>
if (sessionStorage.getItem("crosslogin") == "true") {
<?php $_SESSION['logged'] = false; ?>
sessionStorage.setItem("crosslogin", "false");
$('<iframe src="<?php echo rtrim($recencyConfig['url'], "/") . '/logout'; ?>" frameborder="0" scrolling="no" id="myFrame" style="display:none;"></iframe>').appendTo('body');
$('<iframe src="<?php echo rtrim($systemConfig['recency']['url'], "/") . '/logout'; ?>" frameborder="0" scrolling="no" id="myFrame" style="display:none;"></iframe>').appendTo('body');
}
<?php }
if (isset($_SESSION['alertMsg']) && trim($_SESSION['alertMsg']) != "") { ?>
Expand Down
6 changes: 3 additions & 3 deletions loginProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$_SESSION['instanceLabId'] = !empty($systemInfo['sc_testing_lab_id']) ? $systemInfo['sc_testing_lab_id'] : null;


if (isset($_GET['u']) && isset($_GET['t']) && $recencyConfig['crosslogin']) {
if (isset($_GET['u']) && isset($_GET['t']) && $systemConfig['recency']['crosslogin']) {

$_GET['u'] = filter_var($_GET['u'], FILTER_SANITIZE_STRING);
$_GET['t'] = filter_var($_GET['t'], FILTER_SANITIZE_STRING);
Expand All @@ -45,7 +45,7 @@
$crossLoginQuery = "SELECT `login_id`,`password`,`user_name` FROM user_details WHERE `login_id` = ?";
$check = $db->rawQueryOne($crossLoginQuery, array($db->escape($_POST['username'])));
if ($check) {
$passwordCrossLoginSalt = $check['password'] . $recencyConfig['crossloginSalt'];
$passwordCrossLoginSalt = $check['password'] . $systemConfig['recency']['crossloginSalt'];
$_POST['password'] = hash('sha256', $passwordCrossLoginSalt);
if ($_POST['password'] == $_GET['t']) {
$password = $check['password'];
Expand All @@ -58,7 +58,7 @@
$_POST['password'] = "";
}
} else {
if (!$recencyConfig['crosslogin'] && !isset($_POST['username']) && !empty($_POST['username'])) {
if (!$systemConfig['recency']['crosslogin'] && !isset($_POST['username']) && !empty($_POST['username'])) {
$_SESSION['alertMsg'] = "Sorry! Recency cross-login has not been activated. Please contact system administrator.";
}
}
Expand Down
2 changes: 1 addition & 1 deletion recency/sendResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$vlTestResult = $db->query($vlTestResultQuery);
$client = new \GuzzleHttp\Client();

$domain = rtrim($recencyConfig['url'], "/");
$domain = rtrim($systemConfig['recency']['url'], "/");
$urlCart = $domain . '/api/vl-test-result';

foreach ($vlTestResult as $result) {
Expand Down
14 changes: 7 additions & 7 deletions scheduled-jobs/interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once(__DIR__ . "/../startup.php");

if (!isset($interfaceConfig['enabled']) || $interfaceConfig['enabled'] === false) {
if (!isset($systemConfig['interfacing']['enabled']) || $systemConfig['interfacing']['enabled'] === false) {
error_log('Interfacing is not enabled. Please enable it in configuration.');
exit;
}
Expand All @@ -20,12 +20,12 @@
}

$db->addConnection('interface', array(
'host' => $interfaceConfig['dbHost'],
'username' => $interfaceConfig['dbUser'],
'password' => $interfaceConfig['dbPassword'],
'db' => $interfaceConfig['dbName'],
'port' => (!empty($interfaceConfig['dbPort']) ? $interfaceConfig['dbPort'] : 3306),
'charset' => (!empty($interfaceConfig['dbCharset']) ? $interfaceConfig['dbCharset'] : 'utf8mb4')
'host' => $systemConfig['interfacing']['dbHost'],
'username' => $systemConfig['interfacing']['dbUser'],
'password' => $systemConfig['interfacing']['dbPassword'],
'db' => $systemConfig['interfacing']['dbName'],
'port' => (!empty($systemConfig['interfacing']['dbPort']) ? $systemConfig['interfacing']['dbPort'] : 3306),
'charset' => (!empty($systemConfig['interfacing']['dbCharset']) ? $systemConfig['interfacing']['dbCharset'] : 'utf8mb4')
));


Expand Down
4 changes: 3 additions & 1 deletion startup.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
get_include_path()
)));

require_once(APPLICATION_PATH . '/system/system.php');
require_once(APPLICATION_PATH . '/vendor/autoload.php');
require_once(APPLICATION_PATH . "/configs/config." . APPLICATION_ENV . ".php");

$systemConfig = require_once(APPLICATION_PATH . "/configs/config." . APPLICATION_ENV . ".php");

// Database Connection
$db = new MysqliDb(array(
Expand Down
2 changes: 1 addition & 1 deletion system/system.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

define('VERSION', '4.4.7');
define('VERSION', '4.4.8');
2 changes: 1 addition & 1 deletion tasks/ScheduledTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


// MACHINE INTERFACING
if (!empty($interfaceConfig['enabled']) && $interfaceConfig['enabled'] == true) {
if (!empty($systemConfig['interfacing']['enabled']) && $systemConfig['interfacing']['enabled'] == true) {
$schedule->run(PHP_BINARY . " " . APPLICATION_PATH . "/scheduled-jobs/interface.php")
->everyMinute()
->timezone($timeZone)
Expand Down
Loading

0 comments on commit 4f78cfc

Please sign in to comment.