Merged in bugfix/PMCORE-4049 (pull request #8637)

PMCORE-4049
This commit is contained in:
Julio Cesar Laura Avendaño
2022-11-16 19:44:27 +00:00
3 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Crypt;
use ProcessMaker\BusinessModel\User; use ProcessMaker\BusinessModel\User;
use ProcessMaker\Core\System; use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry; use ProcessMaker\Plugins\PluginRegistry;
@@ -150,7 +151,7 @@ try {
if (strpos($_SERVER['HTTP_REFERER'], 'home/login') !== false) { if (strpos($_SERVER['HTTP_REFERER'], 'home/login') !== false) {
$d = serialize(['u' => $usr, 'p' => $pwd, 'm' => G::LoadTranslation($errLabel)]); $d = serialize(['u' => $usr, 'p' => $pwd, 'm' => G::LoadTranslation($errLabel)]);
$urlLogin = $urlLogin . '?d=' . base64_encode($d); $urlLogin = $urlLogin . '?d=' . Crypt::encryptString($d);
} else { } else {
if (empty($ldapMessageError)) { if (empty($ldapMessageError)) {
G::SendTemporalMessage($errLabel, "warning"); G::SendTemporalMessage($errLabel, "warning");

View File

@@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Crypt;
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
//Browser Compatibility //Browser Compatibility
$browserSupported = G::checkBrowserCompatibility(); $browserSupported = G::checkBrowserCompatibility();
@@ -10,7 +12,7 @@ if ($browserSupported==false) {
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if (isset ($_POST['form']['USER_ENV'])) { if (isset ($_POST['form']['USER_ENV'])) {
$data = base64_encode(serialize($_POST)); $data = Crypt::encryptString(serialize($_POST));
$url = sprintf('/sys%s/%s/%s/login/sysLoginVerify?d=%s', $_POST['form']['USER_ENV'], SYS_LANG, SYS_SKIN, $data); $url = sprintf('/sys%s/%s/%s/login/sysLoginVerify?d=%s', $_POST['form']['USER_ENV'], SYS_LANG, SYS_SKIN, $data);
G::header("location: $url"); G::header("location: $url");
die(); die();

View File

@@ -1,7 +1,9 @@
<?php <?php
use Illuminate\Support\Facades\Crypt;
if (array_key_exists("d", $_GET)) { if (array_key_exists("d", $_GET)) {
$str = base64_decode($_GET["d"]); $str = Crypt::decryptString($_GET["d"]);
if (preg_match('/^a:[0-9]+:{/', $str) && !preg_match('/(^|;|{|})O:\+?[0-9]+:"/', $str)) { if (preg_match('/^a:[0-9]+:{/', $str) && !preg_match('/(^|;|{|})O:\+?[0-9]+:"/', $str)) {
$_POST = unserialize($str); $_POST = unserialize($str);
} }