-
Notifications
You must be signed in to change notification settings - Fork 4
/
Status.ascx.vb
executable file
·106 lines (74 loc) · 3.36 KB
/
Status.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Security
Imports DotNetNuke.Security.Roles
Imports DotNetNuke.Entities.Tabs
Imports Ventrian.SubscriptionTools.Entities
Namespace Ventrian.SubscriptionTools
Partial Public Class Status
Inherits PortalModuleBase
Implements IActionable
#Region " Private Methods "
Private Sub BindRoleMessage()
Dim objContentController As New ContentController
Dim objContentInfo As ContentInfo
Dim literal As New literal
If (Request.IsAuthenticated = False) Then
objContentInfo = objContentController.Get(Me.ModuleId, "Generic")
If Not (objContentInfo Is Nothing) Then
literal.Text = Server.HtmlDecode(objContentInfo.SettingValue)
Else
literal.Text = ""
End If
phControls.Controls.Add(literal)
Return
End If
Dim objRoleController As New RoleController
Dim arrRoles As String() = objRoleController.GetRolesByUser(Me.UserId, Me.PortalId)
For Each role As String In arrRoles
If PortalSecurity.IsInRole(role) Then
objContentInfo = objContentController.Get(Me.ModuleId, role)
If Not (objContentInfo Is Nothing) Then
If (objContentInfo.SettingValue <> "") Then
Dim val As String = Server.HtmlDecode(objContentInfo.SettingValue)
If (Request.IsAuthenticated) Then
val = val.Replace("[FULLNAME]", Me.UserInfo.DisplayName)
val = val.Replace("[USERNAME]", Me.UserInfo.Username)
End If
literal.Text = val
phControls.Controls.Add(literal)
Return
End If
End If
End If
Next
objContentInfo = objContentController.Get(Me.ModuleId, "Generic")
If Not (objContentInfo Is Nothing) Then
literal.Text = Server.HtmlDecode(objContentInfo.SettingValue)
Else
literal.Text = ""
End If
phControls.Controls.Add(literal)
Return
End Sub
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BindRoleMessage()
End Sub
#End Region
#Region " Optional Interfaces "
Public ReadOnly Property ModuleActions() As DotNetNuke.Entities.Modules.Actions.ModuleActionCollection Implements IActionable.ModuleActions
Get
Dim Actions As New ModuleActionCollection
Actions.Add(GetNextActionID, "View Options", ModuleActionType.ContentOptions, "", "", EditUrl("ViewOptions"), False, SecurityAccessLevel.Edit, True, False)
Return Actions
End Get
End Property
#End Region
End Class
End Namespace