Exemplo n.º 1
0
        public bool TryFindContent(PublishedRequest contentRequest)
        {
            // handle all requests beginning /website...
            var                       path       = contentRequest.Uri.AbsolutePath;
            HttpContextBase           wrapper    = new HttpContextWrapper(HttpContext.Current);
            UmbracoBackOfficeIdentity user       = wrapper.GetCurrentIdentity(true);
            bool                      isLoggedIn = user != null;

            if (!isLoggedIn)
            {
                if (path.StartsWith("/" + StandingData.UmbracoRootFolderUrl))
                {
                    contentRequest.Is404 = true;
                    HttpContext.Current.Response.Redirect(path.Replace("/" + StandingData.UmbracoRootFolderUrl, ""));
                }
            }

            return(true);
        }