Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:47:04+00:00 2026-05-15T08:47:04+00:00

Could anyone possibly share me your understanding on the difference between UserController.GetUser(PortalId*,UserId*, true/false) and

  • 0

Could anyone possibly share me your understanding on the difference between UserController.GetUser(PortalId*,UserId*, true/false) and UserController.GetCurrentUserInfo(). Can I use them interchangeably?

*Provided that PortalId and UserId are the properties of PortalModuleBase

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:47:04+00:00Added an answer on May 15, 2026 at 8:47 am

    Here are the two methods that you are referring to from the source code of the current version 5.4.2. From what I can see, the diffs are
    1) GetUser is Deprecated
    2) GetUser appears to manually hydrate the roles, the notes suggest that single users are automatically hydrated

    here is the old method

           ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' GetUser retrieves a User from the DataStore
        ''' </summary>
        ''' <remarks>
        ''' </remarks>
        ''' <param name="portalId">The Id of the Portal</param>
        ''' <param name="userId">The Id of the user being retrieved from the Data Store.</param>
        ''' <param name="isHydrated">A flag that determines whether the user is hydrated.</param>
        ''' <param name="hydrateRoles">A flag that instructs the method to automatically hydrate the roles</param>
        ''' <returns>The User as a UserInfo object</returns>
        ''' <history>
        ''' </history>
        ''' -----------------------------------------------------------------------------
        <Obsolete("Deprecated in DNN 5.1. Not needed any longer for single users due to autohydration")> _
        Public Shared Function GetUser(ByVal portalId As Integer, ByVal userId As Integer, ByVal isHydrated As Boolean, ByVal hydrateRoles As Boolean) As UserInfo
            Dim user As UserInfo = GetUserById(portalId, userId)
    
            If hydrateRoles Then
                Dim controller As DotNetNuke.Security.Roles.RoleController = New DotNetNuke.Security.Roles.RoleController
                user.Roles = controller.GetRolesByUser(userId, portalId)
            End If
    
            Return user
        End Function
    

    and here is the new method

        ''' -----------------------------------------------------------------------------
        ''' <summary>
        ''' Get the current UserInfo object
        ''' </summary>
        ''' <returns>The current UserInfo if authenticated, oherwise an empty user</returns>
        ''' <history>
        '''     [cnurse]    05/23/2005  Documented
        ''' </history>
        ''' -----------------------------------------------------------------------------
        Public Shared Function GetCurrentUserInfo() As UserInfo
    
            If (HttpContext.Current Is Nothing) Then
                If Not (Thread.CurrentPrincipal.Identity.IsAuthenticated) Then
                    Return New UserInfo
                Else
                    Dim _portalSettings As PortalSettings = PortalController.GetCurrentPortalSettings
                    If Not _portalSettings Is Nothing Then
                        Dim objUser As UserInfo = GetCachedUser(_portalSettings.PortalId, Thread.CurrentPrincipal.Identity.Name)
                        If Not objUser Is Nothing Then
                            Return objUser
                        Else
                            Return New UserInfo
                        End If
                    Else
                        Return New UserInfo
                    End If
                End If
            Else
                Dim objUser As UserInfo = CType(HttpContext.Current.Items("UserInfo"), UserInfo)
                If Not objUser Is Nothing Then
                    Return objUser
                Else
                    Return New UserInfo
                End If
            End If
        End Function
    

    is that any help?

    thanks

    Mark Breen

    Ireland

    1987 BMW R80GS

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could anyone explain to me in noob way what the difference is betweeen ImageIcon
Could anyone tell me if it is possible to use the flex 4 framework
Possible Duplicate: Could anyone explain these undefined behaviors (i = i++ + ++i ,
Possible Duplicate: Could anyone explain these undefined behaviors (i = i++ + ++i ,
Could anyone guide me in created a simple app in JS? What the app
Could anyone please let me know if there is a way to programatically determine
Could anyone give me some help with this please? The content needs to appear
Could anyone provide me with the pointers to source code for linux commands such
could anyone please clarify the meaning of line generalizes the tag object's storage of
could anyone assist me with this. I need to compare two beefy xml files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.