SiteUtils.AllowOnlyAuthenticated() does not work properly

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/17/2007 5:13:49 AM
Gravatar
Total Posts 488

SiteUtils.AllowOnlyAuthenticated() does not work properly

SiteUtils.AllowOnlyAuthenticated() function does not work properly for folder-based sites as it uses HttpContext.Current.Request.IsAuthenticated property.

So, if I log in to one site and then go to some page in another one that uses it, the page will show.

At the time these functions were written either folder-based sites functionality was not available yet or I did not notice this. Now this function (and all the similar AllowOnly* functions) should be somehow modificated to deal with it.

7/17/2007 6:14:25 AM
Gravatar
Total Posts 18439

Re: SiteUtils.AllowOnlyAuthenticated() does not work properly

It should work fine. Request.IsAuthenticated should be the same as calling Context.User.Identity.IsAuthenticated which should get its result from the custom mojoIdentity which knows how to handle the different sites.

Maybe its possible they are different results from Request.IsAuthenticated but I thought it was just a shortcut to Context.User.Identity.IsAuthenticated and therefore should work.

7/18/2007 6:06:48 AM
Gravatar
Total Posts 488

Re: SiteUtils.AllowOnlyAuthenticated() does not work properly

Sorry, you are right - everything is ok with these functions.

The reason I thought it was something bad with it is that I have a little patch to global.asax.cs that disallows viewing any pages without login. It uses this function and I placed it in incorrect place. Now I have moved it and everything works ok.

You must sign in to post in the forums. This thread is closed to new posts.