Page permission and login screen

Posted by Community Admin on 03-Aug-2018 12:41

Page permission and login screen

All Replies

Posted by Community Admin on 09-Jun-2015 00:00

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

Posted by Community Admin on 12-Jun-2015 00:00

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
 

Posted by Community Admin on 12-Jun-2015 00:00

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?

Posted by Community Admin on 16-Jun-2015 00:00

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
 

This thread is closed