コード例 #1
0
        public ActionResult Reply(int id, string fullText)
        {
            var user = this.CurrentUser();

            if (user == null)
            {
                return(this.Forbidden("Forbidden", null));
            }
            var pm = _privateMessageService.Get(id);

            if (!_privateMessageService.IsUserInPM(user, pm))
            {
                return(this.Forbidden("Forbidden", null));
            }
            _privateMessageService.Reply(pm, fullText, user);
            return(RedirectToAction("View", new { id }));
        }
コード例 #2
0
        public ActionResult Reply(int id, string fullText)
        {
            var user = _userRetrievalShim.GetUser(HttpContext);

            if (user == null)
            {
                return(Forbid());
            }
            var pm = _privateMessageService.Get(id);

            if (!_privateMessageService.IsUserInPM(user, pm))
            {
                return(Forbid());
            }
            _privateMessageService.Reply(pm, fullText, user);
            return(RedirectToAction("View", new { id }));
        }
コード例 #3
0
        public ActionResult Reply(int id, string fullText)
        {
            var user = _userRetrievalShim.GetUser(HttpContext);

            if (user == null)
            {
                return(StatusCode(403));
            }
            var pm = _privateMessageService.Get(id);

            if (!_privateMessageService.IsUserInPM(user, pm))
            {
                return(StatusCode(403));
            }
            if (String.IsNullOrEmpty(fullText))
            {
                fullText = String.Empty;
            }
            _privateMessageService.Reply(pm, fullText, user);
            return(RedirectToAction("View", new { id }));
        }
コード例 #4
0
        public async Task <ActionResult> Reply(int id, string fullText)
        {
            var user = _userRetrievalShim.GetUser();

            if (user == null)
            {
                return(StatusCode(403));
            }
            var pm = await _privateMessageService.Get(id);

            if (await _privateMessageService.IsUserInPM(user, pm) == false)
            {
                return(StatusCode(403));
            }
            if (string.IsNullOrEmpty(fullText))
            {
                fullText = string.Empty;
            }
            await _privateMessageService.Reply(pm, fullText, user);

            return(RedirectToAction("View", new { id }));
        }