diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index c33a86317..ecb9ed15b 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -2633,7 +2633,7 @@ class Bootstrap $langServer = $locale['LOCALE']; $language = explode('-', $langServer); $language = head($language); - if ($language === $acceptLanguage) { + if ($language === $acceptLanguage || $langServer === $acceptLanguage) { $inLang = true; break; } diff --git a/workflow/engine/bin/tasks/cliListIds.php b/workflow/engine/bin/tasks/cliListIds.php index 6bc7fa0c8..3c4f1d5ca 100644 --- a/workflow/engine/bin/tasks/cliListIds.php +++ b/workflow/engine/bin/tasks/cliListIds.php @@ -7,8 +7,8 @@ function cliListIds($command, $args) $workspaces = get_workspaces_from_args($command); foreach ($workspaces as $index => $workspace) { - $hostPort1 = explode(":", $workspace->dbInfo['DB_HOST']); - $hostPort = $hostPort1[0] . (isset($hostPort[1]) ? ";port=" . $hostPort[1] : ""); + $hostPort = explode(":", $workspace->dbInfo['DB_HOST']); + $hostPort = $hostPort[0] . (isset($hostPort[1]) ? ";port=" . $hostPort[1] : ""); $connectionString = sprintf( "%s:host=%s;dbname=%s", $workspace->dbInfo['DB_ADAPTER'], diff --git a/workflow/engine/classes/WorkspaceTools.php b/workflow/engine/classes/WorkspaceTools.php index 2529080c3..b6ec6a83e 100644 --- a/workflow/engine/classes/WorkspaceTools.php +++ b/workflow/engine/classes/WorkspaceTools.php @@ -455,9 +455,25 @@ class WorkspaceTools $this->dbRbacUser = $values["DB_RBAC_USER"]; $this->dbRbacPass = $values["DB_RBAC_PASS"]; + $this->setDataBaseConnectionPropertiesForEloquent(); return $this->dbInfo = $values; } + /** + * This used for eloquent model. + */ + public function setDataBaseConnectionPropertiesForEloquent(): void + { + $dbHost = explode(':', $this->dbHost); + config(['database.connections.workflow.host' => $dbHost[0]]); + config(['database.connections.workflow.database' => $this->dbName]); + config(['database.connections.workflow.username' => $this->dbUser]); + config(['database.connections.workflow.password' => $this->dbPass]); + if (count($dbHost) > 1) { + config(['database.connections.workflow.port' => $dbHost[1]]); + } + } + private function resetDBInfoCallback($matches) { /* This function changes the values of defines while keeping their formatting @@ -4296,22 +4312,20 @@ class WorkspaceTools WHERE AD.APP_NUMBER = 0"); $con->commit(); - // Populating APP_MESSAGE.TAS_ID AND APP_MESSAGE.PRO_ID - CLI::logging("-> Populating APP_MESSAGE.TAS_ID and APP_MESSAGE.PRO_ID \n"); + // Populating APP_MESSAGE.TAS_ID + CLI::logging("-> Populating APP_MESSAGE.TAS_ID \n"); $con->begin(); $stmt = $con->createStatement(); $rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AM INNER JOIN ( - SELECT APP_DELEGATION.TAS_ID, - APP_DELEGATION.APP_NUMBER, - APP_DELEGATION.TAS_UID, - APP_DELEGATION.DEL_INDEX, - APP_DELEGATION.PRO_ID + SELECT APP_DELEGATION.APP_NUMBER, + APP_DELEGATION.DEL_INDEX, + APP_DELEGATION.TAS_ID FROM APP_DELEGATION ) AS DEL ON (AM.APP_NUMBER = DEL.APP_NUMBER AND AM.DEL_INDEX = DEL.DEL_INDEX) - SET AM.TAS_ID = DEL.TAS_ID, AM.PRO_ID = DEL.PRO_ID - WHERE AM.TAS_ID = 0 AND AM.PRO_ID = 0 AND AM.APP_NUMBER != 0 AND AM.DEL_INDEX != 0"); + SET AM.TAS_ID = DEL.TAS_ID + WHERE AM.TAS_ID = 0 AND AM.APP_NUMBER != 0 AND AM.DEL_INDEX != 0"); $con->commit(); // Populating APP_MESSAGE.PRO_ID @@ -5086,14 +5100,6 @@ class WorkspaceTools ) { // Initialize DB connections $this->initPropel(); - $dbHost = explode(':', $this->dbHost); - config(['database.connections.workflow.host' => $dbHost[0]]); - config(['database.connections.workflow.database' => $this->dbName]); - config(['database.connections.workflow.username' => $this->dbUser]); - config(['database.connections.workflow.password' => $this->dbPass]); - if (count($dbHost) > 1) { - config(['database.connections.workflow.port' => $dbHost[1]]); - } // Get fields and some specific field types $fields = []; diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php index 043413d83..1ee519865 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php @@ -241,6 +241,7 @@ class InputDocument $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID); $criteria->addSelectColumn(AppDocumentPeer::DOC_VERSION); + $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_COMMENT); $criteria->addSelectColumn(AppDocumentPeer::DOC_UID); $criteria->addSelectColumn(AppDocumentPeer::USR_UID); $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE); @@ -280,13 +281,16 @@ class InputDocument public function getAppDocumentDataFromRecord(array $record) { try { - $newArray = array(); + $newArray = []; if (isset($record["APP_DOC_UID"])) { $newArray["app_doc_uid"] = $record["APP_DOC_UID"]; } if (isset($record["APP_DOC_FILENAME"])) { $newArray["app_doc_filename"] = $record["APP_DOC_FILENAME"]; } + if (isset($record["APP_DOC_COMMENT"])) { + $newArray["app_doc_comment"] = $record["APP_DOC_COMMENT"]; + } if (isset($record["DOC_UID"])) { $newArray["doc_uid"] = $record["DOC_UID"]; } @@ -464,8 +468,6 @@ class InputDocument public function getCasesInputDocument($appUid, $userUid, $inputDocumentUid) { try { - $appUid = $applicationUid; - $case = new Cases(); $fields = $case->loadCase($appUid); $proUid = $fields['PRO_UID']; diff --git a/workflow/engine/src/ProcessMaker/Core/System.php b/workflow/engine/src/ProcessMaker/Core/System.php index 103c90992..b03f4ce46 100644 --- a/workflow/engine/src/ProcessMaker/Core/System.php +++ b/workflow/engine/src/ProcessMaker/Core/System.php @@ -31,62 +31,63 @@ class System private static $debug = null; private static $instance; private static $defaultConfig = [ + 'at_risk_delegation_max_time' => '0.2', + 'code_scanner_scope' => 'import_plugin,enable_plugin,import_process,trigger', 'debug' => 0, 'debug_sql' => 0, 'debug_time' => 0, 'debug_calendar' => 0, - 'wsdl_cache' => 1, - 'time_zone' => 'America/New_York', - 'expiration_year' => '1', - 'memcached' => 0, - 'memcached_server' => '', 'default_skin' => 'neoclassic', 'default_lang' => 'en', + 'delay' => '0', + 'disable_php_upload_execution' => 0, + 'disable_download_documents_session_validation' => 0, + 'disable_advanced_search_case_title_fulltext' => 0, + 'disable_task_manager_routing_async' => '0', + 'display_errors' => 'On', + 'enable_blacklist' => 0, + 'enable_httponly_flag' => 0, + 'error_reporting' => '', + 'expiration_year' => '1', + 'ext_ajax_timeout' => 600000, + 'files_white_list' => '', + 'google_map_api_key' => '', + 'google_map_signature' => '', + 'highlight_home_folder_enable' => 0, + 'highlight_home_folder_refresh_time' => 10, + 'highlight_home_folder_scope' => 'unassigned', // For now only this list is supported + 'ie_cookie_lifetime' => 1, + 'leave_case_warning' => 0, + 'load_headers_ie' => 0, + 'logging_level' => 'INFO', + 'logs_max_files' => 60, + 'logs_location' => '', + 'memcached' => 0, + 'memcached_server' => '', + 'mobile_offline_tables_download_interval' => 24, + 'number_log_file' => 5, + 'on_one_server_enable' => 0, + 'pmftotalcalculation_floating_point_number' => 10, 'proxy_host' => '', 'proxy_port' => '', 'proxy_user' => '', 'proxy_pass' => '', - 'size_log_file' => 5000000, - 'number_log_file' => 5, - 'ie_cookie_lifetime' => 1, - 'safari_cookie_lifetime' => 1, - 'error_reporting' => "", - 'display_errors' => 'On', - 'enable_blacklist' => 0, - 'code_scanner_scope' => 'import_plugin,enable_plugin,import_process,trigger', - 'system_utc_time_zone' => 0, - 'server_protocol' => '', - 'leave_case_warning' => 0, - 'server_hostname_requests_frontend' => '', - 'load_headers_ie' => 0, 'redirect_to_mobile' => 0, - 'disable_php_upload_execution' => 0, - 'disable_download_documents_session_validation' => 0, - 'logs_max_files' => 60, - 'logs_location' => '', - 'logging_level' => 'INFO', - 'smtp_timeout' => 20, - 'google_map_api_key' => '', - 'google_map_signature' => '', - 'upload_attempts_limit_per_user' => '60,1', - 'files_white_list' => '', - 'delay' => '0', - 'tries' => '10', - 'retry_after' => '90', - 'mobile_offline_tables_download_interval' => 24, - 'highlight_home_folder_enable' => 0, - 'highlight_home_folder_refresh_time' => 10, - 'highlight_home_folder_scope' => 'unassigned', // For now only this list is supported - 'disable_advanced_search_case_title_fulltext' => 0, - 'pmftotalcalculation_floating_point_number' => 10, 'report_table_batch_regeneration' => 1000, - 'report_table_floating_number' => 4, 'report_table_double_number' => 4, - 'ext_ajax_timeout' => 600000, - 'disable_task_manager_routing_async' => '0', - 'on_one_server_enable' => 0, - 'at_risk_delegation_max_time' => '0.2', - 'samesite_cookie_setting' => '' + 'report_table_floating_number' => 4, + 'retry_after' => '90', + 'samesite_cookie_setting' => '', + 'safari_cookie_lifetime' => 1, + 'server_protocol' => '', + 'server_hostname_requests_frontend' => '', + 'size_log_file' => 5000000, + 'smtp_timeout' => 20, + 'system_utc_time_zone' => 0, + 'time_zone' => 'America/New_York', + 'tries' => '10', + 'upload_attempts_limit_per_user' => '60,1', + 'wsdl_cache' => 1, ]; public static $cookieDefaultOptions = [ @@ -94,7 +95,6 @@ class System 'path' => '/', 'domain' => '', 'secure' => false, - 'httponly' => true, 'samesite' => '' ]; @@ -1819,6 +1819,14 @@ class System // Set the "samesite" option according to the system configuration $cookieOptions['samesite'] = $systemConfiguration['samesite_cookie_setting']; + // Set the "httponly" option according to the system configuration + $httpOnly = $systemConfiguration['enable_httponly_flag']; + if ($httpOnly) { + $cookieOptions['httponly'] = true; + } else { + $cookieOptions['httponly'] = false; + } + // Overrides the cookie options with the values sent to the method $cookieOptions = array_merge($cookieOptions, $options);