Finally,
I think I got it
- <%@ Application Codebehind="Global.asax.vb" Inherits="SiennEngine.Global_asax" Language="vb" %>
- <%@ Import Namespace="System" %>
- <%@ Import Namespace="System.Collections" %>
- <%@ Import Namespace="System.ComponentModel" %>
- <%@ Import Namespace="System.Web" %>
- <%@ Import Namespace="System.Web.SessionState" %>
- <%@ Import Namespace="System.Security.Principal" %>
- <%@ Import Namespace="System.Data" %>
- <%@ Import Namespace="System.Data.SqlClient" %>
-
- <%@ Import Namespace="CuteChat" %>
-
- <script runat="server" Language="vb">
-
- Public Overloads Overrides Sub Init()
- MyBase.Init()
-
-
- If Not CuteChat.ChatSystem.HasStarted Then
- CuteChat.ChatProvider.Instance = New SiennChatProvider()
- CuteChat.ChatSystem.Start(New CuteChat.AppSystem())
- End If
-
- End Sub
-
- Public Class SiennChatProvider
- Inherits CuteChat.ChatProvider
- Dim pbw As New SiennEngine.PBW
- Dim Constring As String = pbw.get_constring()
- Dim Cid As String = pbw.get_cid_currentdomain()
-
- Dim prefix As String = Cid & "U_"
- Dim userId As String = ""
-
- Public Overloads Overrides Function GetConnectionString() As String
- Dim Retstring As String = Constring
- Return Retstring
- End Function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Public Overloads Overrides Function GetLogonIdentity() As AppChatIdentity
- Dim user As System.Web.Security.MembershipUser = System.Web.Security.Membership.GetUser()
-
- If user IsNot Nothing AndAlso user.IsApproved Then
- Return New AppChatIdentity(user.UserName, False, ToUserId(user.UserName), HttpContext.Current.Request.UserHostAddress)
- End If
-
- Return Nothing
- End Function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Public Overloads Overrides Function FindUserLoginName(ByVal nickName As String) As String
- Dim user As System.Web.Security.MembershipUser = System.Web.Security.Membership.GetUser(nickName, False)
- If user IsNot Nothing AndAlso user.IsApproved Then
- Return user.UserName
- End If
- Return Nothing
- End Function
- Public Overloads Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean
- Dim user As System.Web.Security.MembershipUser = System.Web.Security.Membership.GetUser(loginName, False)
- If user IsNot Nothing AndAlso user.IsApproved Then
- nickName = user.UserName
- isAdmin = False
- Return True
- End If
- Return False
- End Function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Public Overloads Overrides Function ValidateUser(ByVal loginName As String, ByVal password As String) As Boolean
-
-
- System.Web.Security.FormsAuthentication.SetAuthCookie(loginName, False, HttpRuntime.AppDomainAppVirtualPath)
-
- Return (True)
- End Function
- End Class
-
- </script>
now I have to figure out how to add contact automaticly