| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@page errorPage="login_withForm.jsp" %>
- <%@ page import="com.kingdee.eas.cp.common.web.util.WebContext"%>
- <%@ page import="com.kingdee.eas.cp.common.web.util.WebContextUtil"%>
- <%@ page import="javax.servlet.http.Cookie"%>
- <%@ page import="com.kingdee.eas.base.attachment.util.AttachmentUtils"%>
- <%@ page import="com.kingdee.util.StringUtils"%>
- <%
- Cookie[] cookies = request.getCookies();
- Cookie tempCookie = null;
- String cookieName = null;
- String webColorStyle = null;
- String webColorPath = null;
- if(cookies == null){
- webColorStyle = WebContextUtil.getDefaultColorStyle();
- if(webColorStyle.indexOf("_simple") >= 0){
- webColorStyle = WebContextUtil.getPortalContextPath(request)+WebContext.DIAMON_BLUE_THEME_SKIN;
- }else{
- webColorStyle = WebContextUtil.getPortalContextPath(request)+webColorStyle;
- }
- System.out.println("webColorStyle is:"+webColorStyle);
- session.setAttribute(com.kingdee.eas.portal.web.control.Globals.USER_SKIN,webColorStyle);
- }else{
-
- System.out.println("******cookies is not null *****");
- for(int i = 0 ;i < cookies.length; i++){
-
- tempCookie = cookies[i];
- if(WebContext.EASWEBCOLORSTYLE.equals(tempCookie.getName())){
-
- webColorStyle = tempCookie.getValue();
- break;
- }
- }
-
- if(webColorStyle == null){
-
- webColorPath = WebContextUtil.getDefaultColorStyle();
- webColorStyle = WebContextUtil.getPortalContextPath(request)+webColorPath;
-
- }else{
-
- if(webColorStyle.indexOf("_simple") >= 0){
- webColorStyle = WebContext.DIAMON_BLUE_THEME_SKIN;
- }
- webColorPath = webColorStyle;
- webColorStyle = WebContextUtil.getPortalContextPath(request) + webColorStyle;
-
- }
-
-
- session.setAttribute(com.kingdee.eas.portal.web.control.Globals.USER_SKIN,webColorStyle);
-
- }
- String service = "";
- boolean sso = false;
- if(!StringUtils.isEmpty(request.getParameter("service"))){
- service = request.getParameter("service");
- if(service.indexOf("username=")>-1 && service.indexOf("password=")>-1){
- sso=true;
- }
- }
- String redirectToLogin = "/autologin_sso.jsp" ;
- String isAlreadyLogin = (String)request.getAttribute("isAlreadyLogin");
- if("true".equalsIgnoreCase(isAlreadyLogin)){
- sso=false;
- }
- if("EASAUTO".equalsIgnoreCase(request.getParameter("EASAUTO")))
- {
- redirectToLogin = "/autologin.jsp" ;
- request.setAttribute("EASTOKEN",AttachmentUtils.init().checkID(request.getParameter("EASTOKEN")));
- request.setAttribute("EASSSOUSER",request.getParameter("EASSSOUSER"));
- request.setAttribute("EASDATABASE",request.getParameter("EASDATABASE"));
- request.setAttribute("EASLOGCAL",request.getParameter("EASLOGCAL"));
- }else if(!sso){
- String params = "" ;
- if(service != null && service.length() > 0 && service.indexOf("?") >-1)
- params = service.substring(service.indexOf("?")+1);
- if(params==null ||params.length() <=0){
- redirectToLogin = "/login_withForm.jsp";
- }else{
- redirectToLogin = "/login_withForm.jsp?" + params;
- }
- }
- System.out.println("----"+redirectToLogin);
- %>
- <jsp:forward page="<%=redirectToLogin%>"/>
|