Merge pull request #1097 from marcoAntonioNina/BUG-10083

BUG 10083 skins not being remembered after logout IMPROVEMENT
This commit is contained in:
julceslauhub
2012-12-14 05:20:19 -08:00
4 changed files with 19 additions and 1 deletions

View File

@@ -446,7 +446,11 @@ class Bootstrap
}
define ( "SYS_LANG", $args ['SYS_LANG'] );
define ( "SYS_SKIN", $args ['SYS_SKIN'] );
if (isset($_COOKIE['workspaceSkin'])) {
define('SYS_SKIN', $_COOKIE['workspaceSkin']);
} else {
define('SYS_SKIN', $args ['SYS_SKIN']);
}
define ( 'SYS_COLLECTION', $args ['SYS_COLLECTION'] );
define ( 'SYS_TARGET', $args ['SYS_TARGET'] );

View File

@@ -69,6 +69,7 @@ if (isset ($_SESSION['USER_LOGGED'])) {
$aRow = $oDataset->getRow();
if ($aRow) {
setcookie("workspaceSkin", SYS_SKIN, time() + 24*60*60, "/sys".SYS_SYS);
if ($aRow['LOG_STATUS'] != 'CLOSED' && $aRow['LOG_END_DATE'] == null) {
$weblog = new LoginLog();

View File

@@ -45,6 +45,7 @@ $oHeadPublisher->addExtJsScript( 'setup/skinList', false ); //adding a javascrip
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
$oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
$oHeadPublisher->assign( 'SYS_SYS', "sys".SYS_SYS );
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );

View File

@@ -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){
Ext.Ajax.request({
url: 'clearCompiledAjax',
@@ -787,6 +798,7 @@ function changeSkin(newSkin,currentSkin){
var response = Ext.util.JSON.decode(r.responseText);
if (response.success) {
currentLocation = top.location.href;
createCookie ('workspaceSkin', newSkin, '1');
if (currentSkin.substring(0,2) != 'ux') {
if (newSkin.substring(0,2) == 'ux') {
newLocation = currentLocation.replace("/" + currentSkin + "/setup/", "/" + newSkin + "/");