Hi there.
Hope you can help me. I've downloaded and installed the Integration package in order to integrate Chat with my current website.
I followed the instructions and added the following to my /global.asax file:
Public Overrides Sub Init()
MyBase.Init()
If Not CuteChat.ChatSystem.HasStarted Then
CuteChat.ChatProvider.Instance = New CuteChatMembership()
CuteChat.ChatSystem.Start(New CuteChat.AppSystem())
End If
End Sub
I then implemeted my CuteChatMembership class in a vb file located in my App_Code folder. The gist of it is below:
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports CuteChat
Public Class CuteChatMembership
Inherits CuteChat.ChatProvider
Public Overrides Function GetConnectionString() As String
Return ConfigurationManager.ConnectionStrings("CuteChat").ConnectionString
End Function
Public Overrides Function FindUserLoginName(ByVal nickName As String) As String
Return HttpContext.Current.User.Identity.Name
End Function
Public Overrides Function GetLogonIdentity() As AppChatIdentity
'need to find the information of current user. Return null if user is anonymous.
Dim thisUser As New LoggedInUser(HttpContext.Current.User.Identity.Name)
If thisUser.LoggedIn Then
Return New AppChatIdentity(HttpContext.Current.User.Identity.Name, False, thisUser.AccountID, HttpContext.Current.Request.UserHostAddress)
Else
Return Nothing
End If
End Function
Public Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean
isAdmin = True
nickName = loginName
Return True
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
Else
Return False
End If
End Function
End Class
So as you can see, I'm making sure that every user has Admin access. Unfortunately, I get the following error when trying to go to /CuteSoft_Client/CuteChat/ChatAdmin/ :
Forbidden: You don't have permission to access Admin Console. Please login as admin.
I know that most of it is working, because I get redirected to /login.aspx if I haven't logged into the website first. However, that isAdmin variable seems to be not being set.
Any help will be greatly appreciated.