+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Page permission and login screen

Page permission and login screen

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:
    22 Sep 2016
    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:
    22 Sep 2016
    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