コード例 #1
0
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            db = (BullyAssureContext)context.HttpContext.RequestServices.GetService(typeof(BullyAssureContext));

            //new LoggingHandler(db).AuditTrail(JsonSerializer.Serialize(context.HttpContext.Request.Form), context.HttpContext.Session.GetString("UserID"), context.HttpContext.Request.Path, context.HttpContext.Request.QueryString.ToString());

            if (!AuthenticateUser(context.HttpContext.Session.GetString("UserID"), context.HttpContext.Session.GetString("token"), context.HttpContext.Request.Path).Result)
            {
                if (!String.IsNullOrEmpty(context.HttpContext.Session.GetString("UserID")))
                {
                    LogFilter.Write(db, context.HttpContext.Request.QueryString.ToString(), context.HttpContext.Request.Path, context.HttpContext.Session.GetString("UserID"));
                }
                var controller = (dynamic)context.Controller;
                if (!String.IsNullOrEmpty(context.HttpContext.Session.GetString("SYSTEMCONFIGURATION")))
                {
                    context.Result = controller.RedirectToAction(
                        JsonSerializer.Deserialize <SystemConfiguration>(context.HttpContext.Session.GetString("SYSTEMCONFIGURATION")).ErrorRedirectAction ?? "LoginPage",
                        JsonSerializer.Deserialize <SystemConfiguration>(context.HttpContext.Session.GetString("SYSTEMCONFIGURATION")).ErrorRedirectTo ?? "Login"
                        );
                }
                else
                {
                    context.Result = controller.RedirectToAction("LoginPage", "Login");
                }
            }
        }
コード例 #2
0
 public PedigreeFieldsViewComponent(BullyAssureContext context, IConfiguration _config)
 {
     db     = context;
     config = _config;
 }
コード例 #3
0
 public ComponentsController(BullyAssureContext _db, IConfiguration _config)
 {
     db     = _db;
     config = _config;
 }
コード例 #4
0
 public static void Write(BullyAssureContext _db, string QueryString, string path, string UserID, Exception ex = null)
 {
     new LoggingHandler(_db).LogError(ex, UserID, path, QueryString);
 }
コード例 #5
0
 public HomeController(BullyAssureContext _db, ILogger <HomeController> logger)
 {
     db      = _db;
     _logger = logger;
 }
コード例 #6
0
 public LogAuditLogin(BullyAssureContext _db)
 {
     db = _db;
 }
コード例 #7
0
 public LoggingHandler(BullyAssureContext _db)
 {
     db = _db;
 }
コード例 #8
0
 public FieldTypeViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #9
0
 public ErrorViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #10
0
 public KennelFieldViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #11
0
 public EmailHandler(BullyAssureContext _db)
 {
     db = _db;
 }
コード例 #12
0
 public CardsViewComponent(BullyAssureContext context, IConfiguration _config)
 {
     db     = context;
     config = _config;
 }
コード例 #13
0
 public SystemSettingsViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #14
0
 public BreederFieldViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #15
0
 public GlobalSettingsViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #16
0
 public KennelController(BullyAssureContext _db, IConfiguration _config, EmailHandler _emailHandler)
 {
     this.db           = _db;
     this.config       = _config;
     this.emailHandler = _emailHandler;
 }
コード例 #17
0
 public FieldController(BullyAssureContext _db, IConfiguration _config)
 {
     db     = _db;
     config = _config;
 }
コード例 #18
0
 public MenuNavViewComponent(BullyAssureContext context)
 {
     db = context;
 }
コード例 #19
0
 public PermissionsViewComponent(BullyAssureContext context)
 {
     this.db = context;
 }