public ActionResult GetResult() { ControllerErrorResult result = new ControllerErrorResult(); #if DEBUG ExceptionFormatter formatter = new ExceptionFormatter("Colossus Portal", Message); result.ViewData.Message = formatter.Generate(this, "<br/>"); #endif #if !DEBUG result.ViewData.Message = "An error occurred."; #endif return(result); }
public override void Execute(IPortalContext context) { IPrincipal user = context.HttpContext.User; if (user != null && user.Identity.IsAuthenticated) { return; } ControllerErrorResult result = new ControllerErrorResult(); result.ViewData.Message = "You are not authorized."; context.Request.Result = result; }