AllowOnlyAdminAndNewsletterAdmin() method not exist in SiteUtils class.

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.
10/25/2009 4:53:06 AM
Gravatar
Total Posts 550

AllowOnlyAdminAndNewsletterAdmin() method not exist in SiteUtils class.

Hi Joe,

AllowOnlyAdminAndNewsletterAdmin() method not exist in SiteUtils class. Am I missing?. I am updated to 5789 revision of repository.

Best,

Asad

10/25/2009 5:06:57 AM
Gravatar
Total Posts 18439

Re: AllowOnlyAdminAndNewsletterAdmin() method not exist in SiteUtils class.

That method is no longer used in mojoPortal and was never expected to be used from custom code since the newsletter is an internal feature.

All of the other SiteUtils.AllowOnly...methods are also now marked as obsolete.

If you were calling this method from your custom code you should change it to this:

 

if (!WebUser.IsNewsletterAdmin)
{
SiteUtils.RedirectToAccessDeniedPage(this);
return;
}

if (!WebUser.IsNewsletterAdmin){ SiteUtils.RedirectToAccessDeniedPage(this); return;}

The problem with those SiteUtils methods is they do a hard redirect and this can cause thread abort exceptions.

Its possible to do soft redirects without threadabort exceptions using WebUtils.SetupRedirect(this, redirectUrl)

However when you do a soft redirect then you must call return; after setting up the redirect, otherwise the page code can keep executing even after the redirect.

Best,

Joe

 

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