Hello Ken,
Thanks for your reply.
I have made the Global.asax like below I can login to the admin pages and make a testroom. But when I log in as a user, there is no real testroom. There is a little message with the name testroom but that is not a chatroom.
Must I do something for users now?
SubApplication_Start(ByValsenderAsObject,ByValeAsEventArgs)
' Code that runs on application startup
IfNotRoles.RoleExists("Administrators")Then
Roles.CreateRole("Administrators")
EndIf
PrivateSharedCuteChatConnectionStringConfigNameAsString="aspnetdbConnectionString"
PublicFunctionGetConnectionString(reservedAsString)AsString
ReturnSystem.Configuration.ConfigurationManager.ConnectionStrings(CuteChatConnectionStringConfigName).ConnectionString
EndFunction
PublicClassAspNetChatProvider
InheritsChatProvider
PublicOverridesFunctionGetConnectionString()AsString
ReturnSystem.Configuration.ConfigurationManager.ConnectionStrings(CuteChatConnectionStringConfigName).ConnectionString
EndFunction
PublicOverridesFunctionGetLogonIdentity()AsAppChatIdentity
DimuserAsSystem.Web.Security.MembershipUser= System.Web.Security.Membership.GetUser()
IfuserIsNotNothingAndAlsouser.IsApprovedThen
ReturnNewAppChatIdentity(user.UserName,False, ToUserId(user.UserName),HttpContext.Current.Request.UserHostAddress)
EndIf
ReturnNothing
EndFunction
PublicOverridesFunctionFindUserLoginName(nickNameAsString)AsString
DimuserAsSystem.Web.Security.MembershipUser= System.Web.Security.Membership.GetUser(nickName,False)
IfuserIsNotNothingAndAlsouser.IsApprovedThen
Returnuser.UserName
EndIf
ReturnNothing
EndFunction
PublicOverridesFunctionGetUserInfo(loginNameAsString,ByRefnickNameAsString,ByRefisAdminAsBoolean)AsBoolean
DimuserAsSystem.Web.Security.MembershipUser= System.Web.Security.Membership.GetUser(loginName,False)
IfuserIsNotNothingAndAlsouser.IsApprovedThen
nickName = user.UserName
isAdmin =Roles.IsUserInRole(user.UserName,"Administrators")
ReturnTrue
EndIf
ReturnFalse
EndFunction
PublicOverridesFunctionValidateUser(usernameAsString, passwordAsString)AsBoolean
IfNotSystem.Web.Security.Membership.ValidateUser(username, password)Then
ReturnFalse
EndIf
System.Web.Security.FormsAuthentication.SetAuthCookie(username,False,HttpRuntime.AppDomainAppVirtualPath)
ReturnTrue
EndFunction
EndClass