Moderators

Last post 08-23-2010, 1:17 AM by kjell.ek. 5 replies.
Sort Posts: Previous Next
  •  08-08-2010, 6:51 AM 63236

    Moderators

    Problem to add Moderators in admin mode. Does not matter what I enter for the username in the form field, it will be the name that is logged in. Even if I add a user in the chat as a moderator. It will be my name ...
    Using Chat/Web Messenger integration package
     
    My provider is:
     

    Imports Microsoft.VisualBasic
    Imports System.Collections
    Imports CuteChat

    Public Class MyChatProvider
        Inherits CuteChat.ChatProvider

        '....................................

        Public Overrides Function GetConnectionString() As String
            Return System.Configuration.ConfigurationManager.AppSettings.Get("ChattInlogg")
        End Function

        '....................................

        Public Overrides Function GetLogonIdentity() As CuteChat.AppChatIdentity

            If Not HttpContext.Current.Request.IsAuthenticated Then
                Return Nothing
            End If

            Dim id As FormsIdentity = TryCast(HttpContext.Current.User.Identity, FormsIdentity)
            Dim ticket As FormsAuthenticationTicket = id.Ticket

            Dim userDataString As String = ticket.UserData
            Dim userDataPieces As String() = userDataString.Split(",".ToCharArray())

            Return New CuteChat.AppChatIdentity(userDataPieces(1), False, ToUserId(userDataPieces(0)), HttpContext.Current.Request.UserHostAddress)

        End Function

        '....................................

        Public Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean

            Dim id As FormsIdentity = TryCast(HttpContext.Current.User.Identity, FormsIdentity)
            Dim ticket As FormsAuthenticationTicket = id.Ticket

            Dim userDataString As String = ticket.UserData
            Dim userDataPieces As String() = userDataString.Split(",".ToCharArray())

            loginName = userDataPieces(0)
            nickName = userDataPieces(1)
            If loginName = "1011" Then
                isAdmin = True
                Return True
            Else
                isAdmin = False
                Return False
            End If

        End Function

        '....................................

        Public Overrides Function FindUserLoginName(ByVal nickName As String) As String
            Return True
        End Function

        '....................................

        Public Overloads Overrides Function ValidateUser(ByVal username As String, ByVal password As String) As Boolean
            Return True
        End Function

    End Class

  •  08-11-2010, 1:11 AM 63315 in reply to 63236

    Re: Moderators

    Can I get some feedback on this?
    I have been thinking about acquiring a license, but want to solve the problems first ............
  •  08-11-2010, 9:40 PM 63346 in reply to 63315

    Re: Moderators

    Hi kjell.ek,
     
    Is your test site online? If so, please create ftp access for me and send me the test page url I will check it and get back to you as soon as possible.
     
     
    Regards,
     
    ken
  •  08-13-2010, 3:59 AM 63372 in reply to 63346

    Re: Moderators

    Hi kjell.ek,
     
     
    In method below you need to return a string value not a bool value.
     
    1. Public Overrides Function FindUserLoginName(ByVal nickName As StringAs String  
    2.         Return True  
    3.     End Function  
     
    If you set like below, no matter what value you set in moderator, it will always display “Ken”.

     So please check your code and make sure it returns a right value.

    1. Public Overrides Function FindUserLoginName(nickName As StringAs String  
    2.   
    3.   
    4.     Return "ken"  
    5.   
    6. End Function  
    chat provider reference :http://www.cutesoft.net/ASP.NET+Chat/Developer-Guide/scr/DeploymentIntegration.htm

     

    Regards,

     ken

  •  08-14-2010, 5:40 AM 63400 in reply to 63372

    Re: Moderators

    Now i use:
     
    Public Overrides Function FindUserLoginName(ByVal nickName As String) As String
          Return "nisse"
    End Function
     
    I am logged in as Kjell Ek
     
    In Room Administration i write in the form field User Name "kalle" to add moderator.
     
    The name that is displayed/inserted is "Kjell Ek"
     
    Same problem.
  •  08-23-2010, 1:17 AM 63557 in reply to 63400

    Re: Moderators

    Please, can i have suport of this?
View as RSS news feed in XML