ASP.NET
   Home| DNN 2.x Integration| Configuration| Forums| Online Demo| Order
   

Configuring Cute Chat/messenger for DNN 2.x DNN Chat

The Configuration section is designed to help you quickly find answers to frequently asked configuration questions. If there are topics not addressed here that you'd like to see in future releases, please drop us a line at Support@CuteSoft.net.

  • How to tie a DNN Role with Cute Chat moderator list?
    In the following example, we tie "My DNN Role" role with Cute Chat moderator list.

    Please open your Global.asax and find the following code:

     
    Public Function IsLobbyAdmin(ByVal useruniquename As String, ByVal lobby As CuteSoft.Chat.CuteChatLobby) As Boolean Implements CuteSoft.Chat.IHttpApplicationDataProvider.IsLobbyAdmin
                Return False
    End Function
     
    Change it to
     
     Public Function IsLobbyAdmin(ByVal useruniquename As String, ByVal lobby As CuteSoft.Chat.CuteChatLobby) As Boolean Implements CuteSoft.Chat.IHttpApplicationDataProvider.IsLobbyAdmin
                Dim user As DotNetNuke.Entities.Users.UserInfo = GetUser(useruniquename)
                If user.IsSuperUser Then
                    Return True
                End If
                Dim roles() As String = New DotNetNuke.Security.Roles.RoleController().GetRolesByUser(user.UserID, CurrentPortal().PortalId)
                Return Array.IndexOf(roles, "My DNN Role") <> -1
    End Function
  • How to change the display names of Cute Chat users?
    By default, when a new user entered the chat room, the Display Name of this user is generated based on DotNetNuke username. You can change it based on user's LastName or user's FirstName.

    Please open your Global.asax and find the following code:


    Public Function GetUserDisplayName(ByVal useruniquename As String) As String Implements CuteSoft.Chat.IHttpApplicationDataProvider.GetUserDisplayName
        Return GetUser(useruniquename).Username
    End Function

     
    Change it to


    Public Function GetUserDisplayName(ByVal useruniquename As String) As String Implements CuteSoft.Chat.IHttpApplicationDataProvider.GetUserDisplayName
        Return GetUser(useruniquename).FirstName
    End Function

     

    Find the following code:


     Public Function SearchUserUniqueNameByDisplayName(ByVal userDisplaName As String) As String() Implements CuteSoft.Chat.IHttpApplicationDataProvider.SearchUserUniqueNameByDisplayName
            userDisplaName = userDisplaName.ToLower()
            Dim names As New System.Collections.ArrayList
            For Each user As DotNetNuke.UserInfo In New DotNetNuke.UserController().GetUsers(CurrentPortal().PortalId, "")
                Dim prop As String = user.Username

                If prop.ToLower().IndexOf(userDisplaName) <> -1 Then
                    names.Add(user.UserID.ToString())
                End If
            Next
            Return CType(names.ToArray(GetType(String)), String())
        End Function

     
    Change it to

     Public Function SearchUserUniqueNameByDisplayName(ByVal userDisplaName As String) As String() Implements CuteSoft.Chat.IHttpApplicationDataProvider.SearchUserUniqueNameByDisplayName
            userDisplaName = userDisplaName.ToLower()
            Dim names As New System.Collections.ArrayList
            For Each user As DotNetNuke.UserInfo In New DotNetNuke.UserController().GetUsers(CurrentPortal().PortalId, "")
                Dim prop As String = user.FirstName

                If prop.ToLower().IndexOf(userDisplaName) <> -1 Then
                    names.Add(user.UserID.ToString())
                End If
            Next
            Return CType(names.ToArray(GetType(String)), String())
        End Function