Imports System.Web.SessionState
Imports CuteChat
Public Class Global_asax
Inherits System.web.httpApplication
Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
ChatProvider.Instance = New AspNetChatProvider()
ChatSystem.Start(New AppSystem())
End Sub
Private Shared CuteChatConnectionStringConfigName As String = "CuteLiveSupportConnectionString"
Public Function GetConnectionString(ByVal reserved As String) As String
Return System.Web.Configuration.WebConfigurationManager.ConnectionStrings(CuteChatConnectionStringConfigName).ConnectionString
End Function
Public Class AspNetChatProvider
Inherits ChatProvider
Public Overloads Overrides Function GetConnectionString() As String
Return System.Web.Configuration.WebConfigurationManager.ConnectionStrings(CuteChatConnectionStringConfigName).ConnectionString
End Function
Public Overloads Overrides Function GetLogonIdentity() As AppChatIdentity
Return New AppChatIdentity("orlandoj", False, "orlandoj", HttpContext.Current.Request.UserHostAddress)
End Function
Public Overloads Overrides Function FindUserLoginName(ByVal nickName As String) As String
Return "orlandoj"
End Function
Public Overloads Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean
nickName = "orlandoj"
isAdmin = True
Return True
End Function
Public Overloads Overrides Function ValidateUser(ByVal username As String, ByVal password As String) As Boolean
System.Web.Security.FormsAuthentication.SetAuthCookie("orlandoj", False)
Return True
End Function
End Class
End Class