...
Code Block |
---|
title | <O3>/jboss/server/default/deploy/gserver/0o3.ear/o3portal.war/i18n- init.jsp |
---|
|
<%
//initialize the theme
String theme = csApplication.getContext().getProperty("ideasoft.themes.defaultTheme", "red");
session.setAttribute(THEME_SESSION_ATTRIBUTE, theme);
session.setAttribute(THEME_PATH_SESSION_ATTRIBUTE, "/themes/" + theme);
%>
REEMPLAZAR POR:
<%
//initialize the theme
String login = csClient.getUserLogin();
String theme;
if ("user".equals(login)) {
theme = "red";
} else if ("admin".equals(login)) {
theme = "blue";
} else {
theme = csApplication.getContext().getProperty("ideasoft.themes.defaultTheme", "red");
}
session.setAttribute(THEME_SESSION_ATTRIBUTE, theme);
session.setAttribute(THEME_PATH_SESSION_ATTRIBUTE, "/themes/" + theme);
%>
|
Si se quiere seleccionar mediante rol al que pertenece el usuario, utilizar la siguiente variante
Code Block |
---|
<%
//initialize the theme
String theme;
com.ideasoft.cs.ClientRestrictions cr = csClient.getClientRestrictions();
if (cr.isUserInRole("Manager")) {
theme = "red";
} else if (cr.isUserInRole("User")) {
theme = "blue";
} else {
theme = csApplication.getContext().getProperty("ideasoft.themes.defaultTheme", "red");
}
session.setAttribute(THEME_SESSION_ATTRIBUTE, theme);
session.setAttribute(THEME_PATH_SESSION_ATTRIBUTE, "/themes/" + theme);
%>
|