Knowledge Base

Snippets

25

Dim objRoleController As New RoleController
Dim arrRoles As String() = CType(objRoleController.GetUserRoles(Me.PortalId, Me.UserInfo.Username.ToString(), ""), 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

Posted in: VbScript

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.