Service Portal - Redirect via UI Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2017 01:08 PM
This is part of a UI Script that redirects a user based on roles. Line 21 isn't being called because window.localStorage isn't coming back as null (this seems to only happen if the user has a specific role).
I logged the window.localStorage in another instance that is still using CMS (and an older version of this UI Script) and it came back as null. Any ideas???
addLoadEvent(function() {
try{
if ( typeof g_user.userName != "undefined" && g_user.userName == 'guest' ) {
window.localStorage.removeItem('evgRedirectLaunched');
console.log('[RedirectHandler] Removed evgRedirectLaunched key, on login page');
}
if ( typeof g_user != "undefined") {
if ( typeof g_user.allRoles != "undefined") {
if ( g_user.allRoles.indexOf('ess_it_user') == -1 && g_user.allRoles.indexOf('admin') == -1 ) {
window.localStorage.removeItem('evgRedirectLaunched');
console.log('[RedirectHandler] Removed evgRedirectLaunched key, user is ESS user');
}
}
}
var evgDirectLaunched = window.localStorage.getItem('evgRedirectLaunched');
console.log('evglaunch: '+evgDirectLaunched);
if ( evgDirectLaunched == null ) {
console.log('[RedirectHandler] evgRedirectLaunched NOT set, processing launchredirect, g_user.userName = '+g_user.userName);
launchredirect();
}
} catch (err) {
console.log('[RedirectHandler] Error: ' + err);
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 12:39 PM
Can you provide the script you are using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 01:05 PM
Sorry to seen this to late. There would be a couple of solution to fix this with a mixture of portal, spentrypage and system properties. But you will avoid ui scripts running on your system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2023 01:55 PM
Hello Goran,
May you please specify what is the solution with the UI Script. It will be appreciated if you can give us the client side code for this UI Script and how to trriger it. I think that will help many of us who still struggling with this.
Best wishes,
Shay