More in this section
Forums / General Discussions / Page permission and login screen

Page permission and login screen

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. Richard
    Richard avatar
    164 posts
    Registered:
    21 Nov 2009
    09 Jun 2015
    Link to this post

    Hi

    I've added a page and made it only given it permission to be seen by a specific user role. When a user tries to access the page without logging in to this role, it offers the backend login screen. How do I make it offer the user my frontend login screen I have created?

    Thanks

    Cheers

    Richard

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    06 Sep 2017
    12 Jun 2015
    Link to this post
    Hi Richard,

    In order to achieve your needs, you can follow that article:
    http://docs.sitefinity.com/frontend-login-page

    I hope this information helps.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Richard
    Richard avatar
    164 posts
    Registered:
    21 Nov 2009
    12 Jun 2015
    Link to this post

    Thanks

     I have two login pages, each for different areas of the site. Each is under a different root folder/page. Can it work like
    that or should I only gave one?

  4. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    06 Sep 2017
    16 Jun 2015
    Link to this post
    Hi Richard,

    In that case you can add in the global.asax 
    protected void Application_Error(object sender, EventArgs e)
    {
        var exception = Server.GetLastError();
     
        if (exception.InnerException.GetType().ToString() == "System.UnauthorizedAccessException")
        {
            HttpContext.Current.ClearError();
     
            var url = HttpContext.Current.Request.Url.ToString();
     
            // sample redirect to the login page
            Response.Redirect("{0}?ReturnUrl={1}".Arrange("~/login", HttpContext.Current.Request.UrlReferrer.ToString().Replace("?", "%3f")));
        }
    }

    and using "HttpContext.Current.Request.UrlReferrer.ToString()" to get the page where the user comes from in order to desite to which login page to redirect the user.

    Than you need to replace in the code above the "~/login" by the respective login page.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered