public StatusResponse GetStatus() { var status = _allowedIpService.GetStatus(); return(new StatusResponse() { Enabled = status.Enabled }); }
public bool TryFindContent(PublishedRequest request) { var status = _allowedIpService.GetStatus(); if (!status.Enabled) { return(false); } var ip = request.UmbracoContext.HttpContext.Request.UserHostAddress; var item = _allowedIpService.GetByIpAddress(ip); if (item == null) { request.SetRedirect("/ip-not-allowed"); return(true); } return(false); }