OM-607: Session Block: Cuando se pierde session en alguna de las opciones de Admin>Settings, se bloquea processmaker completamente

more changes

change login.php

update pr
This commit is contained in:
Rodrigo Quelca
2016-04-25 23:17:58 -04:00
parent 403a3a873b
commit decca9efc8
3 changed files with 40 additions and 1 deletions

View File

@@ -339,7 +339,14 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
: 'off'; : 'off';
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI); setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI);
setcookie("PM-TabPrimary", uniqid(), time() + (24 * 60 * 60), '/');
$configS = System::getSystemConfiguration('', '', SYS_SYS);
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block'] : true;
if ($activeSession) {
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
} else {
setcookie("PM-TabPrimary", uniqid(), time() + (24 * 60 * 60), '/');
}
$oHeadPublisher->addScriptCode("var flagForgotPassword = '$flagForgotPassword';"); $oHeadPublisher->addScriptCode("var flagForgotPassword = '$flagForgotPassword';");
$oHeadPublisher->addScriptFile('/jscore/src/PM.js'); $oHeadPublisher->addScriptFile('/jscore/src/PM.js');

View File

@@ -25,6 +25,23 @@ SELECT LANG_ID, LANG_NAME FROM langOptions
<en><![CDATA[Forgot Password]]></en> <en><![CDATA[Forgot Password]]></en>
</FORGOT_PASWORD_LINK> </FORGOT_PASWORD_LINK>
<JS type="javascript"><![CDATA[ <JS type="javascript"><![CDATA[
//validate iframe login
if(inIframe()) {
if (PM.Sessions.getCookie('PM-TabPrimary') !== '101010010'
&& (window.location.pathname.indexOf("login/login") !== -1
|| window.location.pathname.indexOf("sysLogin") !== -1)) {
window.top.location.href = window.location.pathname;
}
}
function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
};
// enable/disable forgot password link // enable/disable forgot password link
if(flagForgotPassword == 'on' || flagForgotPassword == '1') { if(flagForgotPassword == 'on' || flagForgotPassword == '1') {
document.getElementById("form[FORGOT_PASWORD_LINK]").style.display = 'block';//hideRowById('FORGOT_PASWORD_LINK'); document.getElementById("form[FORGOT_PASWORD_LINK]").style.display = 'block';//hideRowById('FORGOT_PASWORD_LINK');

View File

@@ -28,6 +28,21 @@ SELECT LANG_ID, LANG_NAME FROM langOptions
</FORGOT_PASWORD_LINK> </FORGOT_PASWORD_LINK>
<JS type="javascript"><![CDATA[ <JS type="javascript"><![CDATA[
//validate iframe login
if(inIframe()) {
if (PM.Sessions.getCookie('PM-TabPrimary') !== '101010010'
&& (window.location.pathname.indexOf("login/login") !== -1
|| window.location.pathname.indexOf("sysLogin") !== -1)) {
window.top.location.href = window.location.pathname;
}
}
function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
};
function getElementsByClassNameIE8(node, classname) { function getElementsByClassNameIE8(node, classname) {
var a = []; var a = [];
var re = new RegExp('(^| )'+classname+'( |$)'); var re = new RegExp('(^| )'+classname+'( |$)');