BUG 10083 skins not being remembered after logout IMPROVEMENT

- According to the specifications.
- Was add cookie for save skin of workspace.
This commit is contained in:
Marco Antonio Nina
2012-12-14 11:43:43 -04:00
parent 0d59dccdb6
commit a157292688
3 changed files with 27 additions and 11 deletions

View File

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

View File

@@ -251,7 +251,16 @@ class UsersProperties extends BaseUsersProperties
$url = ''; $url = '';
if (substr( SYS_SKIN, 0, 2 ) == 'ux' && SYS_SKIN != 'uxs') { if (substr( SYS_SKIN, 0, 2 ) == 'ux' && SYS_SKIN != 'uxs') {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/main'; if (isset($_COOKIE['workspaceSkin'])) {
if (substr( $_COOKIE['workspaceSkin'], 0, 2 ) != 'ux') {
$url = $this->_getDefaultLocation();
return $url;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
}
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/main';
}
global $RBAC; global $RBAC;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
$oConf = new Configurations(); $oConf = new Configurations();
@@ -317,7 +326,11 @@ class UsersProperties extends BaseUsersProperties
if (isset( $aRedirectLogin ) && is_array( $aRedirectLogin )) { if (isset( $aRedirectLogin ) && is_array( $aRedirectLogin )) {
foreach ($aRedirectLogin as $key => $detail) { foreach ($aRedirectLogin as $key => $detail) {
if (isset( $detail->sPathMethod ) && $detail->sRoleCode == $userRole) { if (isset( $detail->sPathMethod ) && $detail->sRoleCode == $userRole) {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $detail->sPathMethod; if (isset($_COOKIE['workspaceSkin'])) {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $detail->sPathMethod;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $detail->sPathMethod;
}
} }
} }
} }
@@ -378,7 +391,12 @@ class UsersProperties extends BaseUsersProperties
$oConf = new Configurations(); $oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' ); $oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/'; //$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
if (isset($_COOKIE['workspaceSkin'])) {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
} else {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
}
$url = ''; $url = '';
if (sizeof( $oConf->aConfig ) > 0) { if (sizeof( $oConf->aConfig ) > 0) {

View File

@@ -98,9 +98,11 @@ class Home extends Controller
$processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' ); $processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' );
$switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'] ); $switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'] );
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') { if (!isset($_COOKIE['workspaceSkin'])) {
$_SESSION['_defaultUserLocation'] = $switchLink; if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main'; $_SESSION['_defaultUserLocation'] = $switchLink;
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
}
} }
unset( $processList[0] ); unset( $processList[0] );