Please open DNNChatProvider.vb and post the following code:
Imports
System.IO
Imports
System.Security
Imports
System.Security.Principal
Imports
System.Threading
Imports
System.Web
Imports
System.Web.Security
Imports
DotNetNuke.Common.Utilities
Imports
DotNetNuke.Entities.Portals
Imports
DotNetNuke.Security.Roles
Imports
DotNetNuke.Services.Exceptions
Imports
DotNetNuke.Services.Log.EventLog
Imports
DotNetNuke.Services.Scheduling
Imports
DotNetNuke.Services.Upgrade
Imports
Microsoft.VisualBasic
Public
Class DNNChatProvider
Inherits CuteChat.ChatProvider
Protected Function CurrentPortal() As DotNetNuke.Entities.Portals.PortalSettings
Dim ps As DotNetNuke.Entities.Portals.PortalSettings
ps = PortalController.GetCurrentPortalSettings()
If ps Is Nothing Then
Throw (New Exception("PortalSettings Not Ready"))
End If
Return ps
End Function
Public Function GetLogonUser() As DotNetNuke.Entities.Users.UserInfo
If Not HttpContext.Current.Request.IsAuthenticated Then
Return Nothing
End If
Dim username As String = HttpContext.Current.User.Identity.Name
Return DotNetNuke.Entities.Users.UserController.GetUserByName(CurrentPortal().PortalId, username)
End Function
Public Overrides Function GetConnectionString() As String
Return System.Configuration.ConfigurationManager.ConnectionStrings("SiteSqlServer").ConnectionString
End Function
Public Overrides Function GetLogonIdentity() As CuteChat.AppChatIdentity
Dim user As DotNetNuke.Entities.Users.UserInfo = GetLogonUser()
If user Is Nothing Then
Return Nothing
End If
Return New CuteChat.AppChatIdentity(user.Username, False, ToUserId(user.Username), HttpContext.Current.Request.UserHostAddress)
End Function
Public Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean
Try
Dim user As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetUserByName(CurrentPortal().PortalId, loginName)
If user Is Nothing Then
Return False
End If
nickName = user.Username
isAdmin = user.IsInRole("Administrators")
Or (user.Username = "admin")
Return True
Catch ex As Exception
Return False
End Try
End Function
Public Overrides Function FindUserLoginName(ByVal nickName As String) As String
Try
Dim totalRecords As Integer
For Each user As DotNetNuke.Entities.Users.UserInfo In DotNetNuke.Entities.Users.UserController.GetUsersByUserName(CurrentPortal().PortalId, nickName, 0, 100, totalRecords)
If String.Equals(user.Username, nickName, StringComparison.OrdinalIgnoreCase) Then
Return user.Username
End If
Next
Return Nothing
Catch ex As Exception
Return Nothing
End Try
End Function
Public Overrides Function ValidateUser(ByVal loginName As String, ByVal password As String) As Boolean
If System.Web.Security.Membership.ValidateUser(loginName, password) Then
System.Web.Security.FormsAuthentication.SetAuthCookie(loginName,
False)
Return True
End If
End Function
Public Class MyDataManager
Inherits CuteChat.AppDataManager
Public Sub New(ByVal portal As CuteChat.AppPortal)
MyBase.New(portal)
End Sub
Public Overrides Sub AddContact(ByVal identity As CuteChat.ChatIdentity, ByVal userid As String)
End Sub
Public Overrides Sub RemoveContact(ByVal identity As CuteChat.ChatIdentity, ByVal userid As String)
End Sub
Public Overrides Function GetContacts(ByVal identity As CuteChat.ChatIdentity) As CuteChat.IChatUserInfo()
Dim portalid As Integer = 0
Dim list As ArrayList = DotNetNuke.Entities.Users.UserController.GetUsers(portalid)
Dim res As New ArrayList
Dim provider As CuteChat.ChatProvider = CuteChat.ChatProvider.Instance
Dim myname As String = provider.FromUserId(identity.UniqueId)
For Each info As DotNetNuke.Entities.Users.UserInfo In list
If String.CompareOrdinal(myname, info.Username) <> 0 Then
res.Add(
Me.GetUserInfo(provider.ToUserId(info.Username)))
End If
Next
Return res.ToArray(GetType(CuteChat.IChatUserInfo))
End Function
End Class
Public Overrides Function CreateDataManagerInstance(ByVal portal As CuteChat.AppPortal) As CuteChat.AppDataManager
Return New MyDataManager(portal)
End Function
End
Class
asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
asp wysiwyg html editor: http://cutesoft.net/ASP
asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
Live Support: http://cutesoft.net/live-support/default.aspx