HOR-4155
Validate if logen user is not guest. Close previous session if webentry is anonymous.
This commit is contained in:
@@ -24,6 +24,7 @@ try {
|
|||||||
throw new Exception('WebEntry User not found');
|
throw new Exception('WebEntry User not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$_SESSION = [];
|
||||||
initUserSession($userUid, $userInfo->getUsrUsername());
|
initUserSession($userUid, $userInfo->getUsrUsername());
|
||||||
|
|
||||||
$result = [
|
$result = [
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
|
|||||||
var weUid = <?php echo G::json_encode($webEntryModel->getWeUid()); ?>;
|
var weUid = <?php echo G::json_encode($webEntryModel->getWeUid()); ?>;
|
||||||
var forceLogin = <?php echo G::json_encode($webEntryModel->getWeAuthentication()==='LOGIN_REQUIRED'); ?>;
|
var forceLogin = <?php echo G::json_encode($webEntryModel->getWeAuthentication()==='LOGIN_REQUIRED'); ?>;
|
||||||
var isLogged = <?php echo G::json_encode(!empty($_SESSION['USER_LOGGED'])); ?>;
|
var isLogged = <?php echo G::json_encode(!empty($_SESSION['USER_LOGGED'])); ?>;
|
||||||
|
var currentLoggedIsGuest = <?php echo G::json_encode(!empty($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] === RBAC::GUEST_USER_UID); ?>;
|
||||||
var closeSession = <?php echo G::json_encode($webEntryModel->getWeCallback()==='CUSTOM_CLEAR'); ?>;
|
var closeSession = <?php echo G::json_encode($webEntryModel->getWeCallback()==='CUSTOM_CLEAR'); ?>;
|
||||||
var hideInformationBar = <?php echo G::json_encode(!!$webEntryModel->getWeHideInformationBar()); ?>;
|
var hideInformationBar = <?php echo G::json_encode(!!$webEntryModel->getWeHideInformationBar()); ?>;
|
||||||
if (!forceLogin) {
|
if (!forceLogin) {
|
||||||
@@ -263,7 +264,7 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
|
|||||||
};
|
};
|
||||||
var login = function () {
|
var login = function () {
|
||||||
return new Promise(function (logged, failure) {
|
return new Promise(function (logged, failure) {
|
||||||
if (!isLogged) {
|
if (!isLogged || currentLoggedIsGuest) {
|
||||||
log("login");
|
log("login");
|
||||||
open('../login/login?inIFrame=1&u=' + encodeURIComponent(location.pathname + '/../../webentry/logged'))
|
open('../login/login?inIFrame=1&u=' + encodeURIComponent(location.pathname + '/../../webentry/logged'))
|
||||||
.then(function (userInformation) {
|
.then(function (userInformation) {
|
||||||
|
|||||||
Reference in New Issue
Block a user