CCS bug之4: 站内发私人留言,用户同时收到email,点击链接,却显示该帖不存在的错误页面

症状:  用户A在站内给用户B发私人留言,用户B注册时填的邮箱会收到email,点击email中的链接,定向到网站,如果用户B没有保持cookie,则会显示该帖不存在的错误页面.

原因: 不详,确实比较奇怪,FormAuthentication居然没有罩住. 不过可以解决也就懒得追踪了

解决方案: /Forums/Posts.cs中的GetPost(int postID, int userID, bool trackViews)中在CSContext csContext = CSContext.Current;下面加一句
if ( ! csContext.IsAuthenticated)
            
{
                HttpContext.Current.Response.Redirect(Globals.GetSiteUrls().Login, 
true);
            }

你可能感兴趣的:(email)