META-INF.resources.index.jsp Maven / Gradle / Ivy
<%@include file="../xava/imports.jsp"%>
<%@page import="com.openxava.naviox.util.OrganizationsCurrent"%>
<%@page import="org.openxava.web.Browsers"%>
<%@page import="org.openxava.util.Users"%>
<%@page import="com.openxava.naviox.impl.SignInHelper"%>
<%
String signInURL = SignInHelper.getSignInURL();
if (Users.getCurrent() != null || OrganizationsCurrent.get(request) != null) {
String module = Users.getCurrent() == null?"SignIn":modules.getCurrent(request);
String url = Browsers.isMobile(request) && !"Index".equals(modules.getCurrent(request))?"phone":"m/" + module;
if (signInURL != null && Users.getCurrent() == null && session.getAttribute("naviox.originalURL") == null) {
session.setAttribute("naviox.originalURL", request.getContextPath());
url = request.getContextPath() + signInURL;
}
%>
>
window.location="<%=url%>";
<%
}
else {
if (signInURL != null && session.getAttribute("naviox.originalURL") == null) {
session.setAttribute("naviox.originalURL", request.getContextPath());
%>
>
window.location="<%=request.getContextPath()%><%=signInURL%>";
<%
}
else {
%>
<%
}
}
%>