Exemplo n.º 1
0
        /// <summary>
        /// 初始化并验证用户身份
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (Fetch.GetTerminalType(Page.Request) != 0 && Page.Request.Url.AbsoluteUri.ToLower().Contains("mobile") == false)
            {
                SystemStatusInfo isOpen = FacadeManage.aideAccountsFacade.GetSystemStatusInfo(AppConfig.SystemConfigKey.OpenMobileWebsite.ToString());
                if (isOpen != null && isOpen.StatusValue == 0)
                {
                    Response.Redirect("/Mobile/Index.aspx");
                }
            }

            if (IsAuthenticatedUser)
            {
                UserLogon();
            }
            else if (IsOnLine)
            {
                //在线 刷新 Cookie
                userTicket = Fetch.GetUserCookie();
            }

            SetStyle();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 用户是否在线 判断用户登录 cookie
        /// 在线 true 离线 false
        /// </summary>
        /// <returns></returns>
        public static bool IsUserOnline()
        {
            UserTicketInfo uti = Fetch.GetUserCookie();

            if (uti == null || uti.UserID <= 0)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        public static bool IsUserOnline()
        {
            UserTicketInfo userCookie = Fetch.GetUserCookie();

            if (userCookie != null && userCookie.UserID > 0)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
 public static void ReWriteUserCookie()
 {
     if (Fetch.IsUserOnline())
     {
         UserTicketInfo userCookie = Fetch.GetUserCookie();
         Message        message    = FacadeManage.aideAccountsFacade.Logon(new UserInfo(userCookie), false);
         if (message.Success)
         {
             UserInfo item = message.EntityList[0] as UserInfo;
             Fetch.SetUserCookie(item.ToUserTicketInfo());
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 初始化并验证用户身份
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (IsAuthenticatedUser)
            {
                UserLogon();
            }
            else if (IsOnLine)
            {
                //在线 刷新 Cookie
                userTicket = Fetch.GetUserCookie();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 登录并重写 Cookie
        /// </summary>
        public static void ReWriteUserCookie()
        {
            if (Fetch.IsUserOnline())
            {
                UserTicketInfo uti = Fetch.GetUserCookie();
                Message        msg = FacadeManage.aideAccountsFacade.Logon(new UserInfo(uti), false);
                if (msg.Success)
                {
                    UserInfo       usInfo    = msg.EntityList[0] as UserInfo;
                    UserTicketInfo utiServer = usInfo.ToUserTicketInfo();

                    Fetch.SetUserCookie(utiServer);
                }
            }
        }
Exemplo n.º 7
0
 protected virtual void UserLogon()
 {
     if (Fetch.IsUserOnline())
     {
         this.userTicket = Fetch.GetUserCookie();
         if (this.IsAuthenticatedMember)
         {
             this.IsMember();
             return;
         }
     }
     else
     {
         this.ReLogon();
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 后台登录并重写 Cookie
        /// </summary>
        public static void ReWriteUserCookie()
        {
            if (Fetch.IsUserOnline())
            {
                UserTicketInfo uti = Fetch.GetUserCookie();
                Message        msg = accountsData.Logon(new UserInfo(uti), false);
                if (msg.Success)
                {
                    UserInfo       usInfo    = msg.EntityList[0] as UserInfo;
                    UserTicketInfo utiServer = usInfo.ToUserTicketInfo();
                    utiServer.LogonPass = uti.LogonPass;

                    Fetch.SetUserCookie(utiServer);
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 用户登录
        /// </summary>
        protected virtual void UserLogon()
        {
            if (Fetch.IsUserOnline())
            {
                userTicket = Fetch.GetUserCookie();

                //是否会员
                if (IsAuthenticatedMember)
                {
                    IsMember();
                }
            }
            else
            {
                ReLogon();
            }
        }
Exemplo n.º 10
0
 protected override void OnInit(System.EventArgs e)
 {
     base.OnInit(e);
     if (Fetch.GetTerminalType(this.Page.Request) != 0 && !this.Page.Request.Url.AbsoluteUri.ToLower().Contains("mobile"))
     {
         base.Response.Redirect("/Mobile/Index.aspx");
     }
     if (this.IsAuthenticatedUser)
     {
         this.UserLogon();
     }
     else
     {
         if (this.IsOnLine)
         {
             this.userTicket = Fetch.GetUserCookie();
         }
     }
     this.SetStyle();
 }
Exemplo n.º 11
0
        /// <summary>
        /// 初始化并验证用户身份
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (Fetch.GetTerminalType(Page.Request) != 0 && Page.Request.Url.AbsoluteUri.ToLower().Contains("mobile") == false)
            {
                Response.Redirect("/Mobile/Index.aspx");
            }

            if (IsAuthenticatedUser)
            {
                UserLogon();
            }
            else if (IsOnLine)
            {
                //在线 刷新 Cookie
                userTicket = Fetch.GetUserCookie();
            }

            SetStyle();
        }