From 648901b1042313107951b0bdaad0f099b91f5d91 Mon Sep 17 00:00:00 2001 From: Thilina Pituwala Date: Sun, 31 May 2020 09:21:24 +0200 Subject: [PATCH] Key verification --- core/src/Classes/BaseService.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/core/src/Classes/BaseService.php b/core/src/Classes/BaseService.php index bf63939f..0815c4ef 100644 --- a/core/src/Classes/BaseService.php +++ b/core/src/Classes/BaseService.php @@ -285,8 +285,8 @@ class BaseService $childCompaniesIds = array(); if (\Classes\SettingsManager::getInstance()->getSetting( - 'System: Child Company Structure Managers Enabled' - ) == '1' + 'System: Child Company Structure Managers Enabled' + ) == '1' ) { $childCompaniesResp = \Company\Common\Model\CompanyStructure::getAllChildCompanyStructures( $cempObj->department @@ -479,8 +479,8 @@ class BaseService $childCompaniesIds = array(); if (SettingsManager::getInstance()->getSetting( - 'System: Child Company Structure Managers Enabled' - ) == '1' + 'System: Child Company Structure Managers Enabled' + ) == '1' ) { $childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department); $childCompanies = $childCompaniesResp->getObject(); @@ -560,8 +560,8 @@ class BaseService $childCompaniesIds = array(); if (SettingsManager::getInstance()->getSetting( - 'System: Child Company Structure Managers Enabled' - ) == '1' + 'System: Child Company Structure Managers Enabled' + ) == '1' ) { $childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department); $childCompanies = $childCompaniesResp->getObject(); @@ -1350,7 +1350,6 @@ class BaseService $settings->name = "Instance: Key"; } $settings->value = $key; - $settings->category = 'Instance'; $settings->Save(); } @@ -1377,17 +1376,11 @@ class BaseService return false; } - /* $data = AesCtr::decrypt($key, $instanceId, 256); $arr = explode("|", $data); if ($arr[0] == KEY_PREFIX && $arr[1] == $instanceId) { return true; } - */ - - if (strlen($key) > 20) { - return true; - } return false; } @@ -1786,8 +1779,8 @@ END; ) { $departmentHeadFound = true; } elseif (SettingsManager::getInstance()->getSetting( - 'System: Child Company Structure Managers Enabled' - ) == '1' + 'System: Child Company Structure Managers Enabled' + ) == '1' ) { $companyStructure = new CompanyStructure(); $companyStructure->Load('id = ?', array($subordinate->department)); @@ -1807,7 +1800,7 @@ END; $companyStructure->Load('id = ?', array($parentCompanyStructure)); } } while (!empty($companyStructure->id) - && !empty($parentCompanyStructure) + && !empty($parentCompanyStructure) ); }