Chat doesn't recognize logged in user

Last post 01-29-2009, 11:30 PM by erikbartlow. 6 replies.
Sort Posts: Previous Next
  •  12-31-2008, 11:14 AM 47322

    Chat doesn't recognize logged in user

    I have integrated the Chat Release 5 into my site, but it keeps telling me that i need to be logged in.  i've integrated it using the chat provider, and can see that the code is called.  This same code worked in version 4.  Is there something i'm missing.
     
    I've implemented the ChatProvider for my site as seen below:

    ///

    <summary>

    ///

    CuteChat .NET Provider for site.com

    ///

    </summary>

    public class MyChatProvider : CuteChat.ChatProvider {

    private User _user;

    ///

    <summary>

    ///

    Gets the connection string.

    ///

    </summary>

    ///

    <returns></returns>

    public override string GetConnectionString() {

    return ConfigurationManager.ConnectionStrings[ "MainConnection" ].ConnectionString;

    }

    ///

    <summary>

    ///

    Finds the name of the user login.

    ///

    </summary>

    /// <param name="nickName">Name of the nick.

    </param>

    ///

    <returns></returns>

    public override string FindUserLoginName( string nickName ) {

    String screenname = Common.Screenname;

    if ( screenname == String.Empty ) {

    UserController controller = new UserController();

    _user = controller.GetUserByScreenName( nickName );

    if ( _user == null ) {

    return null;

    }

    else {

    return _user.Screenname;

    }

    }

    else {

    return screenname;

    }

    }

    ///

    <summary>

    ///

    Gets the logon identity.

    ///

    </summary>

    ///

    <returns></returns>

    public override CuteChat.AppChatIdentity GetLogonIdentity() {

    UserController controller = new UserController();

    _user = controller.GetUserByID( Common.UserId );

    if ( _user != null && _user.IsActive ) {

    return new CuteChat.AppChatIdentity( _user.Screenname, _user.isPublic, ToUserId( _user.Screenname ), HttpContext.Current.Request.UserHostAddress );

    }

    return null;

    }

    ///

    <summary>

    ///

    Gets the user info.

    ///

    </summary>

    /// <param name="loginName">Name of the login.

    </param>

    /// <param name="nickName">Name of the nick.

    </param>

    /// <param name="IsAdmin">if set to <c>true</c> [is admin].

    </param>

    ///

    <returns></returns>

    public override bool GetUserInfo( string loginName, ref string nickName, ref bool IsAdmin ) {

    UserController controller = new UserController();

    _user = controller.GetUserByID( Common.UserId );

    if ( _user != null && _user.IsActive ) {

    IsAdmin = _user.IsAdmin;

    loginName = _user.UserName;

    nickName = _user.Screenname;

    return true;

    }

    return false;

    }

    ///

    <summary>

    ///

    Validates the user.

    ///

    </summary>

    /// <param name="loginName">Name of the login.

    </param>

    /// <param name="password">The password.

    </param>

    ///

    <returns></returns>

    public override bool ValidateUser( string loginName, string password ) {

    UserController controller = new UserController();

    _user = controller.GetUserByUserNameAndPassword( loginName, password );

    if ( _user != null ) { return true; }

    return false;

    }

    }

  •  12-31-2008, 11:29 AM 47324 in reply to 47322

    Re: Chat doesn't recognize logged in user

    We didn't change the integration part in version 5.0. If it works for version 4.0 it should work for version 5.0 automatically.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-31-2008, 12:16 PM 47328 in reply to 47324

    Re: Chat doesn't recognize logged in user

    That is good news to hear.  However it isn't working.  It was working with 4.0, and when I uploaded all the new files it started to send this message after it connected to the server.
     
     
    Please wait, connecting to server...
    Anonymous Users are not allowed in this application. You must sign in this website first.
  •  12-31-2008, 4:46 PM 47333 in reply to 47328

    Re: Chat doesn't recognize logged in user

    I appreciate your response.  However, I can show you that it doesn't work.  Even when I step through the code I can see the provideer methods getting called.  I'm returning the users in my database and setting the necessary properties from my users table.  After all the code is run the Chat server still states the "Anonymous users are not allowed on this site..." message. 
  •  01-19-2009, 12:58 PM 47868 in reply to 47324

    Re: Chat doesn't recognize logged in user

    I'm getting a lot of heat from my customer on this.  I haven't heard a response from my last post.  Is there anything else I can try tthat would help debug this?  Do you have any logging I can turn on that might call out a missing parameter or something.
     
    Please help!
  •  01-19-2009, 1:29 PM 47869 in reply to 47868

    Re: Chat doesn't recognize logged in user

    Please check the following article which shows you how to integrate cute chat with your own application.
     
     
    Please also check this link:
     
     
    In the integration package, we provide many examples showing how to integrate cute chat with asp.net 2.0 membership database, classic ASP and ASP.net applications.
     
    If you still have problems, there are two options ().
     
    1. Request the integration service
     
    2. Request the the debug service
     
    If you choose the above two services, you need to create a sample application with DB data to us.
     
    We have to spend the time to study your application, check the details to fix the integration issue.
     
    For the fee information, please write to [email protected]

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-29-2009, 11:30 PM 48218 in reply to 47869

    Re: Chat doesn't recognize logged in user

    Adam,
     
    I took a closer look at the provider I had implemented from the last version, and the one provided in your samples for the new one.  I noticed a few discrepencies around the isAnonymous flag in the GetLogonIdentity.  I fixed them, and now things are working fine.  Thank you for you assistance.
     
    Erik
View as RSS news feed in XML