Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Performance Tip - Remove default user check on every request

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
John Mitchell
Posts:3550



04/29/2007 9:04 AM  

If you are concerned about performance in your DotNetNuke websites like I am, here is a quick and easy performance enhancement.
Recent versions of DotNetNuke have added a check to warn you if you are using "admin" or "host" as a username.
This check happens on every page request, and is not needed IMO.

To remove this warning, simply delete the following lines of code from Default.aspx.vb

            'check if running with known account defaults
            Dim messageText As String = ""
            If Request.IsAuthenticated = True And String.IsNullOrEmpty(Request.QueryString("runningDefault")) = False Then
                Dim userInfo As UserInfo = HttpContext.Current.Items("UserInfo")
                'only show message to default users
                If (userInfo.Username.ToLower = "admin") OrElse (userInfo.Username.ToLower = "host") Then
                    messageText = RenderDefaultsWarning()
                    Dim messageTitle As String = Services.Localization.Localization.GetString("InsecureDefaults.Title", Services.Localization.Localization.GlobalResourceFile)
                    UI.Skins.Skin.AddPageMessage(CType(ctlSkin, DotNetNuke.UI.Skins.Skin), messageTitle.ToString, messageText.ToString, Skins.Controls.ModuleMessage.ModuleMessageType.RedError)
                End If
            End If

greenflash
Posts:51



04/30/2007 4:25 AM  
Thanks John, great tip, i published this tip at my Turkish support blog.
Here is the link:
http://www.mikroproje.com/Blog/tabid/144/articleType/ArticleView/articleId/93/DotNetNuke-Performans-pucu.aspx

DotNetNuke Türkçe
John Mitchell
Posts:3550



05/01/2007 9:51 AM  

Thanks greenflash.

For anyone that is wanting to follow this discussion further, it is continued here:

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/118/threadid/129728/scope/posts/Default.aspx

 

SplatMan_DK
Posts:81



05/14/2007 6:40 AM  
Hmmm... how big is the actual impact to performance? I am no expert on the finer arts of microcomputing, but it seems to me that the mentioned scripting code is pretty simple, and should not generate a lot of extra CPU cycles? Is there an actual performance gain, or is it more of a theoretical one?

- Jesper

brgds

- Jesper
John Mitchell
Posts:3550



05/14/2007 7:45 AM  
No, this one check is not a big impact on performance by itself, but if you look at what the default page is doing already then you'll see that it really adds up. The problem with this one is that once you get the message and make the change then the check is totally unneccessary. I really don't like using code that runs on every request to deliver a single message to a specific person.
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

Forums >DotNetNuke Support >Tips-And-Tricks > Performance Tip - Remove default user check on every request



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DotNetNuke CSS Menu 3.3.4 (single use)

Item codeCSSNM33SU
AuthorJohn Mitchell
Base Price$25.00
Product Information 
DotNetNuke CSS NavMenu 3.3.4 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 Performance for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$25.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

AuthorNina Meiers
Price$49.00
Product Information 
XDAmarina (CSS & Flash Skin)

AuthorNina Meiers
Price$49.00
Product Information