Integration with our user database so nickname dialog does not appear.

Last post 07-05-2006, 2:39 AM by Adam. 9 replies.
Sort Posts: Previous Next
  •  06-19-2006, 11:16 AM 20264

    Integration with our user database so nickname dialog does not appear.

    I followed the instructions in the V3 Integration: I put in a reference to our database in the web.config and fixed the "Connection String" to our database.  We disabled Allow anonymous.  And we still get prompted for nickname.  What are we missing?

    Implement IHttpApplicationConnectionStringProvider interface and Let CuteChat know the database connection string


    In this step, you need to implement one simple method:

    //Retrieves the Cute Chat database connection string
    public string GetConnectionString(CuteSoft.Chat.UserIdentity user)

    Code Example

    public string GetConnectionString(CuteSoft.Chat.UserIdentity user)

    {

        return System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];

    }

  •  06-19-2006, 12:15 PM 20265 in reply to 20264

    Re: Integration with our user database so nickname dialog does not appear.

    You also have to override/implement the follwoing methods:

    public override string GetUserUniqueName( HttpContext context )
    this methods provides access to the UserID of the currently logged-in user.
    If this method returns NULL then you are asked for login, else you can procceed with a "scient" login.

    In order to have a "pretty" name of the user you have to implement/override:
    public override string GetUserDisplayName( string useruniquename )
    this method takes the UserID as param and retruns string presentation of the user. So here you can add the first&last name...

    Hope this helps.
    Diman
  •  06-21-2006, 5:36 PM 20373 in reply to 20264

    Re: Integration with our user database so nickname dialog does not appear.

    Can you provide me with an example?  Does this all go in the global.asac file?
    Here is what I added to my global.ascx so far:
     

    public static String ConnectionString

    {

    get

    {

    return System.Configuration.ConfigurationSettings.AppSettings["MyConnectionString"];

    }
    what do I do next?

    }

  •  06-22-2006, 1:38 AM 20387 in reply to 20373

    Re: Integration with our user database so nickname dialog does not appear.

    Cynthia,

    The above code looks good if you do have an entry in your web.config.

     <appSettings>
         <add key="MyConnectionString" value="server=(local);database=SamplePortal;uid=test;pwd=test" />
     </appSettings>
     
     
     

    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

  •  06-22-2006, 11:10 AM 20403 in reply to 20387

    Re: Integration with our user database so nickname dialog does not appear.

    Thank you for that, but I also need to know how to write the other two lines to set up integration. How do I tell cutechat what the display name is so the user is not prompted for it?  A code example would be great.
     
    Thanks
  •  06-22-2006, 11:26 AM 20411 in reply to 20403

    Re: Integration with our user database so nickname dialog does not appear.

    Cynthia,
     
    Do you know how to connect your SQL Server?
     
    If yes, just put your SQL Server Connection string in above line.
     
     

    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

  •  06-22-2006, 9:16 PM 20430 in reply to 20411

    Re: Integration with our user database so nickname dialog does not appear.

    Please read what I asked:
     
    Thank you for that, but I also need to know how to write the other two lines to set up integration. How do I tell cutechat what the display name is so the user is not prompted for it?  A code example would be great.
     
    I know how to do the connection but please answer the question above.
     
     
  •  06-22-2006, 10:19 PM 20431 in reply to 20430

    Re: Integration with our user database so nickname dialog does not appear.

    The role of GetUserDisplayName is helping you get  user's display name based on the user's UniqueName.
     
     
    Before you get started, you need to understand the 'UniqueName' in CuteChat. In CuteChat, UniqueName means the unique data of your user. Depending on how you implement the user system, in some systems, the best unique data is the user ID; in some system, every user have a unique account name; some systems like MSN, the unique data is the user email. It could be string(username, email), integer(user ID) or GUID.
     
     
    You can just change it to:
     
    public string GetUserDisplayName(string useruniquename)
    {
       return useruniquename;
    }
     
    When you get comfortable with the integration part, then change the above code to something make sense to your system.
     
     

    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

  •  07-02-2006, 5:22 PM 20656 in reply to 20431

    Re: Integration with our user database so nickname dialog does not appear.

    Ok I am still confused.  I have download the V3 integration package and see all the routines in the global file.  I still do not userstand how to pass to you the username and display name.  I have my own .net application that has forms authentication.  Once they log in they see a set of chats rooms they can enter.  When they select one I pass them to your chat engine as shown below.  In this context how do I pass the other information (ie that they are authenticated and their display name).
     
    Here is how I am calling your the chat engine.  Eval("LobbyID").ToString() produces the Lobby ID for the specify class they link to.
     
    navigateurl='<%# "http://chat.eskillz.com/v2eskillzchat/CuteSoft_Client/CuteChat/CH_MainForm.Aspx?Location=Lobby&LocationId=" & Eval("LobbyID").ToString()
     
    THANKS for your help!
  •  07-05-2006, 2:39 AM 20722 in reply to 20656

    Re: Integration with our user database so nickname dialog does not appear.

    Have you finished this step?
     

    Implement IHttpApplicationUserAdapter interface and Let CuteChat know who has logged in the website


    In this step, you need to implement one simple method:

    //Retrieves the unique identity of the current user
    public CuteSoft.Chat.UserIdentity GetUserIdentity()

    Code Example

    public string GetUserUniqueName()

    {    
         if (Context.User.Identity.IsAuthenticated)
            return Context.User.Identity.Name; 
        return null;

    }

    public CuteSoft.Chat.UserIdentity GetUserIdentity()

    {

        string uniquename = GetUserUniqueName();

        if (uniquename == null)

        {

            return CuteSoft.Chat.UserIdentity.CreateNull();

        }

        CuteSoft.Chat.UserIdentity identity = new CuteSoft.Chat.UserIdentity(uniquename, null, Request.UserHostAddress);

        return identity;

    }
     
    Before you get started, you need to understand the 'UniqueName' in CuteChat. In CuteChat, UniqueName means the unique data of your user. Depending on how you implement the user system, in some systems, the best unique data is the user ID; in some system, every user have a unique account name; some systems like MSN, the unique data is the user email. It could be string(username, email), integer(user ID) or GUID.
     
    If your 'UniqueName' is just your username, you don't need to do anything.:
     
    public string GetUserDisplayName(string useruniquename)
    {
         return useruniquename;
    }
     
    In some systems like MSN, the unique data is the user email. In this situation, you need to write some code return the username based on the email address.
     
    Does it help?
     
    Keep me posted
     
     
     
     

    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

View as RSS news feed in XML