From b83e6888dd5f4c6a74116cf54e8030f0f6ff2f19 Mon Sep 17 00:00:00 2001 From: "Paula.Quispe" Date: Thu, 24 Mar 2022 12:36:01 -0400 Subject: [PATCH 1/2] PMCORE-3698 --- workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index b5cdc13ba..c5e25cdf9 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -9,6 +9,7 @@ use Illuminate\Support\Facades\DB; use ProcessMaker\Core\System; use ProcessMaker\Model\Application; use Publisher; +use RBAC; use ResultSet; use WebEntryPeer; @@ -1101,7 +1102,7 @@ class WebEntry */ public function isWebEntryOne($weUid) { - if (!empty($_SESSION['USER_LOGGED']) && empty($_SESSION['__WEBENTRYCONTINUE__'])) { + if (!empty($_SESSION['USER_LOGGED']) && empty($_SESSION['__WEBENTRYCONTINUE__']) && !RBAC::isGuestUserUid($_SESSION['USER_LOGGED'])) { global $G_PUBLISH; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/checkContinueOrCloseSession', '', [], SYS_URI . 'login/checkContinueOrCloseSession'); From 289877699afb1a3802a82f2f56b6b9a039482f55 Mon Sep 17 00:00:00 2001 From: Roly Gutierrez Date: Fri, 25 Mar 2022 16:43:01 -0400 Subject: [PATCH 2/2] PMCORE-3697 If I have a Current Enabled SAML Setting and SAML Session, don't show the message --- .../ProcessMaker/BusinessModel/WebEntry.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index c5e25cdf9..883f49d73 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -1102,7 +1102,7 @@ class WebEntry */ public function isWebEntryOne($weUid) { - if (!empty($_SESSION['USER_LOGGED']) && empty($_SESSION['__WEBENTRYCONTINUE__']) && !RBAC::isGuestUserUid($_SESSION['USER_LOGGED'])) { + if ($this->verifyCurrentSession()) { global $G_PUBLISH; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/checkContinueOrCloseSession', '', [], SYS_URI . 'login/checkContinueOrCloseSession'); @@ -1117,6 +1117,28 @@ class WebEntry && $webEntry->getWeCallback() === 'PROCESSMAKER'; } + /** + * Verify the current sessión exist for display webentry message confirmation. + * @return bool + */ + private function verifyCurrentSession(): bool + { + //verify normal flow + $rule1 = !empty($_SESSION['USER_LOGGED']) && empty($_SESSION['__WEBENTRYCONTINUE__']); + + //verify guest user + $rule2 = !empty($_SESSION['USER_LOGGED']); + if ($rule2) { + //verify is guest user uid. + $rule2 = !RBAC::isGuestUserUid($_SESSION['USER_LOGGED']); + } + + //verify saml session + $rule3 = !(!empty($_SESSION['samlNameId']) && !empty($_SESSION['samlSessionIndex'])); + + return $rule1 && $rule2 && $rule3; + } + /** * Verify if a Task is and Web Entry auxiliar task. *