Пример #1
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string url      = null;
            int    urlIndex = 0;

            int notifyID = 0;

            if (context.Request.QueryString["ui"] != null)
            {
                int.TryParse(context.Request.QueryString["ui"], out urlIndex);
            }


            if (int.TryParse(context.Request.QueryString["notifyID"], out notifyID))
            {
                AuthUser user   = User.Current;
                Notify   notify = NotifyBO.Instance.GetNotify(UserBO.Instance.GetCurrentUserID(), notifyID);

                if (notifyID < 0)
                {
                    NotifyBO.Instance.IgnoreSystemNotify(user.UserID, notifyID);
                }
                else
                {
                    if (notify != null && notify.UserID == user.UserID)  //本人,非管理员
                    {
                        NotifyBO.Instance.IgnoreNotifies(user, new int[] { notifyID });
                    }

                    if (notify != null)
                    {
                        switch (notify.TypeID)
                        {
                        case (int)FixNotifies.CommentNotify:
                            CommentNotify cn = new CommentNotify(notify);
                            url = cn.Url;
                            break;

                        default:
                            if (notify.Urls.Length > 0 && notify.Urls.Length >= urlIndex)
                            {
                                url = notify.Urls[urlIndex];
                            }
                            break;
                        }
                    }

                    if (notify != null && !string.IsNullOrEmpty(url))
                    {
                        context.Response.Redirect(url);
                    }
                    else
                    {
                        context.Response.Redirect(BbsRouter.GetIndexUrl());
                    }
                }
            }
        }
Пример #2
0
        private string GetFilteredUrl(string url)
        {
            string urlInfo = BbsRouter.GetUrlInfo(url);

            bool gotoIndexPage;

            switch (urlInfo)
            {
            case "login":
            case "register":
            case "recoverpassword":
            case "info":
                gotoIndexPage = true;
                break;

            default:
                if (urlInfo.StartsWith("logout/", StringComparison.OrdinalIgnoreCase)
                    ||
                    urlInfo.StartsWith("max-dialogs/", StringComparison.OrdinalIgnoreCase)
                    ||
                    urlInfo.StartsWith("register/", StringComparison.OrdinalIgnoreCase)
                    )
                {
                    gotoIndexPage = true;
                }
                else
                {
                    gotoIndexPage = false;
                }
                break;
            }

            if (gotoIndexPage)
            {
                return(BbsRouter.GetIndexUrl());
            }
            else
            {
                return(url);
            }
        }
Пример #3
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            HttpRequest Request = HttpContext.Current.Request;

            string skinID = Request.QueryString["skin"];

            if (skinID != null)
            {
                Skin skin = TemplateManager.GetSkin(skinID);

                if (skin != null && skin.Enabled)
                {
                    UserBO.Instance.UpdateSkinID(User.Current, skinID);
                }
            }

            string returnUrl = Request.QueryString["u"];

            if (string.IsNullOrEmpty(returnUrl))
            {
                if (Request.UrlReferrer != null)
                {
                    returnUrl = Request.UrlReferrer.OriginalString;
                }
            }

            if (!string.IsNullOrEmpty(returnUrl) && returnUrl.StartsWith(Globals.FullAppRoot + "/"))
            {
                returnUrl = GetFilteredUrl(returnUrl);
            }
            else
            {
                returnUrl = BbsRouter.GetIndexUrl();
            }

            HttpContext.Current.Response.Redirect(returnUrl);
        }
Пример #4
0
 public static string GetIndexUrl()
 {
     return(BbsRouter.GetIndexUrl());
 }