<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.struts.Globals"%>
<%@ page import="com.kingdee.util.StringUtils"%>
<%@ page import="com.kingdee.eas.base.uiframe.UserDomainBean"%>
<%@ page import="com.kingdee.eas.cp.common.web.util.WebContextUtil"%>
<%
	String easIsSSOClient = System.getProperty("sso.easIsSSOClient");
	//added by lyan_zhang 20100906 direct by tangguowei
	request.getSession().setAttribute("FromLoginPortal","true");

	String redirectTo = "";
	String dcNumber_cloud = request.getParameter("dcNumber_cloud");
	String dcName_cloud = request.getParameter("dcName_cloud");
 	if(easIsSSOClient != null && easIsSSOClient.toLowerCase().equals("true"))
	{
		if(request.getParameter("ssoLogoutTo")!=null){
			redirectTo ="logoutSso.jsp";// "ssoWelcome?redirectTo=/success.jsp";
		}else{
			redirectTo = "ssoWelcome?redirectTo=/index_sso.jsp";
		}
		if(dcNumber_cloud !=null && dcNumber_cloud.length() > 0 && dcName_cloud !=null && dcName_cloud.length() > 0){
			if(redirectTo.indexOf("?")>=0){
				redirectTo += "&dcNumber_cloud=" + dcNumber_cloud + "&dcName_cloud=" + dcName_cloud ;
			}else{
				redirectTo += "?dcNumber_cloud=" + dcNumber_cloud + "&dcName_cloud=" + dcName_cloud ;
			}
		}		
		System.out.print("index.jsp dcName_cloud="+redirectTo);		
		
		response.sendRedirect(redirectTo);
	}
	else
	{
		redirectTo = "/index_nosso.jsp";
		UserDomainBean userdomain = new UserDomainBean();
		String domain = userdomain.getUserDomain() ;
		if(!StringUtils.isEmpty(domain) && domain.equals("portaltogui"))
		{
			redirectTo = "/index_gui.jsp";
		}
		
		%>
			<jsp:forward page="<%=redirectTo%>"/>
		<%
	}
%>

