Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Undocumented breaking change made to DNN Core 4.9.0Undocumented breaking change made to DNN Core 4.9.0
Previous
 
Next
New Post
10/14/2008 1:14 PM
 

Most of the Library components of DNN Core are supposed to be directly used by Module Developers in one way or the other. In some cases, this is a requirement (e.g. all Module controls need to inherit from PortalModuleBase class).

So, I thought the Core team takes utmost care before introducing any breaking change to these classes, if one is really required. In any case, these should be documented on Gemini (which I take a serious look at before porting my modules to a new DNN upgrade. If there is some other authentic source for these change documentation that I am not aware of, I would be obliged if someone informs me).

Now, I come to the point. The UserModuleBase class is supposed to be inherited by any Control that provides some sort of User management functionality. All controls in DNN's 'User Accounts' module do so.

As this module restricts User Management to Admins only, I had created custom Modules that provided limited User Management to appropriate Users with Edit Rights to the Module, without elevating them to the Admin role.

Now, the Shadowed UserId property in DNN 4.8.4 used to look like follows:

        Public Shadows Property UserId() As Integer
            Get
                Dim _UserId As Integer = Null.NullInteger
                If v13wstat3("UserId") Is Nothing Then
                    If Not (Request.QueryString("userid") Is Nothing) Then
                        _UserId = Int32.Parse(Request.QueryString("userid"))
                        v13wstat3("UserId") = _UserId
                    End If
                Else
                    _UserId = CType(v13wstat3("UserId"), Integer)
                End If
                Return _UserId
            End Get
            Set(ByVal Value As Integer)
                v13wstat3("UserId") = Value
            End Set
        End Property
 

But in 4.9.0, it changed to:

        Public Shadows Property UserId() As Integer
            Get
                Dim _UserId As Integer = Null.NullInteger
                If v13wstat3("UserId") Is Nothing Then
                    If Not (Request.QueryString("userid") Is Nothing) Then
                        Dim passedID As Integer = Int32.Parse(Request.QueryString("userid"))
                        Dim isAllowedUser As Boolean = False
                        'check if user is edited their own details
                        If UserInfo.UserID = passedID Then
                            isAllowedUser = True
                        ElseIf UserInfo.IsSuperUser = True Then
                            'superuser has access to all users
                            isAllowedUser = True
                        ElseIf UserInfo.IsInRole(Me.PortalSettings.AdministratorRoleName) = True Then
                            'need to check if the user is within the admins portal
                            Dim passedUser As UserInfo = DotNetNuke.Entities.Users.UserController.GetUser(PortalId, passedID, False)
                            If Not IsNothing(passedUser) Then
                                'ignore superuser's
                                If passedUser.IsSuperUser = False Then
                                    isAllowedUser = True
                                End If
                            End If
                            End If
                            If isAllowedUser = True Then
                                _UserId = Int32.Parse(Request.QueryString("userid"))
                                v13wstat3("UserId") = _UserId
                            Else
                                'attempt to access invalid user
                                Response.Redirect(NavigateURL("Access Denied"), True)
                            End If
                    End If
                Else
                    _UserId = CType(v13wstat3("UserId"), Integer)
                End If
                Return _UserId
            End Get
            Set(ByVal Value As Integer)
                v13wstat3("UserId") = Value
            End Set
        End Property
 

In a nutshell, this change restricted any control derived from UserModuleBase to be accessible by Host or Admin accounts only. This was a major change that I believe was not needed. In any case, it should have been documented.

It really caused me pain and frustration when I upgraded a Client installation from 4.8.4 to 4.9.0. Before doing so, I had checked Gemini and tested my modules on 4.9.0 on my development machine. I tested them while logged in as admin and so could not catch the change in core. And neither was I expecting such a Policy change to happen.

And after I upgraded the Client installation, and left his premises, he reported me being directed to Access Denied page. And as his schedule was being disturbed, I had to elevate him to Admin role temporarily before I dug into my and DNN code to discover what the problem was.

 
New Post
10/14/2008 1:22 PM
 

Can you please log this issue in http://support.dotnetnuke.com so it can be reviewed and possibly corrected. Many thanks.



Alex Shirley


 
New Post
10/14/2008 1:38 PM
 

the change is not to restrict access to only Host and Admin accounts. If you look at the code, it is allowing access to Host and Admins account and ALSO allowing anyone to access their own account.

The code was changed to prevent someone from accessing someone else's user account.  If your client was trying to access someone else's user account details, then your client *should* have to be an admin or host.

 
New Post
10/14/2008 1:47 PM
 

Steve's correct, it was a security fix added in 4.9. The gemini issue is @ http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=7982&PROJID=2 and references the security bulletin @ http://www.dotnetnuke.com/News/SecurityPolicy/Securitybulletinno21/tabid/1174/Default.aspx .

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
10/14/2008 1:49 PM
 

r_honey wrote
 

Now, I come to the point. The UserModuleBase class is supposed to be inherited by any Control that provides some sort of User management functionality. All controls in DNN's 'User Accounts' module do so.

As this module restricts User Management to Admins only, I had created custom Modules that provided limited User Management to appropriate Users with Edit Rights to the Module, without elevating them to the Admin role.

Please note, this control does not limit access to user admins (it's used in a number of locations including when a non-admin user want's to update some of their settings)


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Undocumented breaking change made to DNN Core 4.9.0Undocumented breaking change made to DNN Core 4.9.0


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out