Ejemplo n.º 1
0
        /// <summary>
        /// 是否已经登录
        /// </summary>
        /// <returns></returns>
        public bool IsSignedIn( )
        {
            string sUrl = Request.Url.AbsolutePath.ToLower();

            zLogger.Instance.OperateLog(sUrl, Request.UserHostAddress, "MMMenu", "IsSignedIn", true);

            return(SSOWrapper.IsSignedIn());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 登录校验
        /// </summary>
        public void VerifyUserStatus( )
        {
            string sUrl = Request.Url.AbsolutePath.ToLower();

            if (!SSOWrapper.IsSignedIn())
            {
                if (!IsUrlIgnoreSSOVerify(sUrl))
                {
                    zLogger.Instance.OperateLog(sUrl, Request.UserHostAddress, "Enviroment::VerifyUserStatus", "redirect", true);

                    Response.Redirect("/Login.aspx");
                }
            }
            else
            {
                zUser _user = SSOWrapper.GetUserInfo();

                if (UserRole.Equal(_user.RoleId, UserRole.Sales) ||
                    UserRole.Equal(_user.RoleId, UserRole.Buyer) ||
                    UserRole.Equal(_user.RoleId, UserRole.OrderCreator) ||
                    UserRole.Equal(_user.RoleId, UserRole.OrderReceiver))
                {
                    if (sUrl.IndexOf("/login.aspx") != -1 || sUrl == "/index.aspx")
                    {
                        Response.Redirect("/Index.aspx");
                    }
                    else if (!IsUrlIgnoreSSOVerify(sUrl))
                    {
                        //注销并重新登录
                        SSOWrapper.Signout(Config.Instance.WebsiteParameters("SSODomain"));

                        Response.Redirect("/Login.aspx");
                    }
                }
                else
                {
                    //注销并重新登录
                    SSOWrapper.Signout(Config.Instance.WebsiteParameters("SSODomain"));

                    Response.Redirect("/Login.aspx");
                }
            }
        }