Skip to content

Commit

Permalink
Fixing forum avatar visibility for superuser #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilpo Juvander committed Jul 11, 2016
1 parent 8273074 commit a0932e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
8 changes: 2 additions & 6 deletions branches/DNN_5/Components/Entities/UserInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,8 @@ Namespace DotNetNuke.Modules.Forum
''' <remarks>This can be stored as a fileid (as a string) or as an actual file name.</remarks>
Public ReadOnly Property ProfileAvatar() As String
Get
If Not Me.IsSuperUser Then
' we are using profile avatars, lets check for the property value
Return Me.Profile.GetPropertyValue(objConfig.AvatarProfilePropName)
Else
Return String.Empty
End If
' we are using profile avatars, lets check for the property value
Return Me.Profile.GetPropertyValue(objConfig.AvatarProfilePropName)
End Get
End Property

Expand Down
30 changes: 14 additions & 16 deletions branches/DNN_5/Components/UI/Posts.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1884,23 +1884,21 @@ Namespace DotNetNuke.Modules.Forum
RenderCellBegin(wr, "Forum_UserAvatar", "", "", "", "top", "", "") ' <td>
wr.Write("<br />")
If objConfig.EnableUserAvatar And author.UserID > 0 Then
If Not author.IsSuperUser Then
Dim WebVisibility As UserVisibilityMode
WebVisibility = author.Profile.ProfileProperties(objConfig.AvatarProfilePropName).ProfileVisibility.VisibilityMode

Select Case WebVisibility
Case UserVisibilityMode.AdminOnly
If objSecurity.IsForumAdmin Then
RenderProfileAvatar(author, wr)
End If
Case UserVisibilityMode.AllUsers
Dim WebVisibility As UserVisibilityMode
WebVisibility = author.Profile.ProfileProperties(objConfig.AvatarProfilePropName).ProfileVisibility.VisibilityMode

Select Case WebVisibility
Case UserVisibilityMode.AdminOnly
If objSecurity.IsForumAdmin Then
RenderProfileAvatar(author, wr)
Case UserVisibilityMode.MembersOnly
If CurrentForumUser.UserID > 0 Then
RenderProfileAvatar(author, wr)
End If
End Select
End If
End If
Case UserVisibilityMode.AllUsers
RenderProfileAvatar(author, wr)
Case UserVisibilityMode.MembersOnly
If CurrentForumUser.UserID > 0 Then
RenderProfileAvatar(author, wr)
End If
End Select
Else
If author.UserID > 0 Then
RenderImage(wr, author.AvatarComplete, author.SiteAlias & "'s " & ForumControl.LocalizedText("Avatar"), "")
Expand Down

0 comments on commit a0932e4

Please sign in to comment.