BUG 10083 skins not being remembered after logout SOLVED
- According to the specifications. - Was add cookie for save skin of workspace.
This commit is contained in:
@@ -249,6 +249,13 @@ try {
|
|||||||
$sLocation = $_REQUEST['u'];
|
$sLocation = $_REQUEST['u'];
|
||||||
} else {
|
} else {
|
||||||
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
||||||
|
if (isset($_COOKIE['workspaceSkin'])) {
|
||||||
|
if (substr(SYS_SKIN, 0, 2) == 'ux') {
|
||||||
|
$sLocation = str_replace(SYS_SKIN."/main", $_COOKIE['workspaceSkin']."/setup/main", $sLocation);
|
||||||
|
} else {
|
||||||
|
$sLocation = str_replace(SYS_SKIN, $_COOKIE['workspaceSkin'], $sLocation);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ if (isset ($_SESSION['USER_LOGGED'])) {
|
|||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
if ($aRow) {
|
if ($aRow) {
|
||||||
|
setcookie("workspaceSkin", SYS_SKIN, time() + 24*60*60, "/sys".SYS_SYS);
|
||||||
if ($aRow['LOG_STATUS'] != 'CLOSED' && $aRow['LOG_END_DATE'] == null) {
|
if ($aRow['LOG_STATUS'] != 'CLOSED' && $aRow['LOG_END_DATE'] == null) {
|
||||||
$weblog = new LoginLog();
|
$weblog = new LoginLog();
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ $oHeadPublisher->addExtJsScript( 'setup/skinList', false ); //adding a javascrip
|
|||||||
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
|
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
|
||||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||||
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
|
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
|
||||||
|
$oHeadPublisher->assign( 'SYS_SYS', "sys".SYS_SYS );
|
||||||
|
|
||||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||||
|
|
||||||
|
|||||||
@@ -777,6 +777,17 @@ deleteSkin = function(){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createCookie (name, value, time) {
|
||||||
|
if (time) {
|
||||||
|
var date = new Date();
|
||||||
|
date.setTime(date.getTime()+(time*24*60*60*1000));
|
||||||
|
var expires = "; expires="+date.toGMTString();
|
||||||
|
} else {
|
||||||
|
var expires = "";
|
||||||
|
}
|
||||||
|
document.cookie = name+"="+value+expires+"; path=/"+SYS_SYS;
|
||||||
|
}
|
||||||
|
|
||||||
function changeSkin(newSkin,currentSkin){
|
function changeSkin(newSkin,currentSkin){
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'clearCompiledAjax',
|
url: 'clearCompiledAjax',
|
||||||
@@ -787,6 +798,7 @@ function changeSkin(newSkin,currentSkin){
|
|||||||
var response = Ext.util.JSON.decode(r.responseText);
|
var response = Ext.util.JSON.decode(r.responseText);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
currentLocation = top.location.href;
|
currentLocation = top.location.href;
|
||||||
|
createCookie ('workspaceSkin', newSkin, '1');
|
||||||
if (currentSkin.substring(0,2) != 'ux') {
|
if (currentSkin.substring(0,2) != 'ux') {
|
||||||
if (newSkin.substring(0,2) == 'ux') {
|
if (newSkin.substring(0,2) == 'ux') {
|
||||||
newLocation = currentLocation.replace("/" + currentSkin + "/setup/", "/" + newSkin + "/");
|
newLocation = currentLocation.replace("/" + currentSkin + "/setup/", "/" + newSkin + "/");
|
||||||
|
|||||||
Reference in New Issue
Block a user