PMCORE-651 Web entry data is insecure because the Guest user's session overwrites the one of the user currently logged
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
if (!empty($_POST['form'])) {
|
if (!empty($_POST['form'])) {
|
||||||
if (!empty($_POST['form']['buttonContinue'])) {
|
if (!empty($_POST['form']['buttonContinue'])) {
|
||||||
$_SESSION['__WEBENTRYCONTINUE__'] = true;
|
$_SESSION['__WEBENTRYCONTINUE__'] = true;
|
||||||
|
if (!empty($_SESSION['USER_LOGGED'])) {
|
||||||
|
$_SESSION['__WEBENTRYCONTINUE_USER_LOGGED__'] = $_SESSION['USER_LOGGED'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($_POST['form']['buttonLogout'])) {
|
if (!empty($_POST['form']['buttonLogout'])) {
|
||||||
$_SESSION = [];
|
$_SESSION = [];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This service is to start PM with the anonymous user.
|
* This service is to start PM with the anonymous user.
|
||||||
*/
|
*/
|
||||||
@@ -19,6 +20,12 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$userUid = $webEntry->getUsrUid();
|
$userUid = $webEntry->getUsrUid();
|
||||||
|
|
||||||
|
if (!empty($_SESSION['__WEBENTRYCONTINUE_USER_LOGGED__'])) {
|
||||||
|
$userUid = $_SESSION['__WEBENTRYCONTINUE_USER_LOGGED__'];
|
||||||
|
unset($_SESSION['__WEBENTRYCONTINUE_USER_LOGGED__']);
|
||||||
|
}
|
||||||
|
|
||||||
$userInfo = UsersPeer::retrieveByPK($userUid);
|
$userInfo = UsersPeer::retrieveByPK($userUid);
|
||||||
if (empty($userInfo)) {
|
if (empty($userInfo)) {
|
||||||
throw new Exception('WebEntry User not found');
|
throw new Exception('WebEntry User not found');
|
||||||
@@ -33,7 +40,7 @@ try {
|
|||||||
'firstName' => $userInfo->getUsrFirstName(),
|
'firstName' => $userInfo->getUsrFirstName(),
|
||||||
'lastName' => $userInfo->getUsrLastName(),
|
'lastName' => $userInfo->getUsrLastName(),
|
||||||
'mail' => $userInfo->getUsrEmail(),
|
'mail' => $userInfo->getUsrEmail(),
|
||||||
'image' => '../users/users_ViewPhoto?t='.microtime(true),
|
'image' => '../users/users_ViewPhoto?t=' . microtime(true),
|
||||||
];
|
];
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$result = [
|
$result = [
|
||||||
|
|||||||
Reference in New Issue
Block a user