check user is authenticated on Chat_OpenMessenger()

Last post 06-12-2008, 10:45 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  06-12-2008, 6:07 AM 41353

    check user is authenticated on Chat_OpenMessenger()

     
    I am using Membership Data Base Intergration and .Net Forms Authentication

    I have a link to
    Chat_OpenMessenger() that only displays when my users are logged in to the website. However, if a user does not use the website for 30 minutes they are logged out off the system, but the link to Chat_OpenMessenger() is still visible (assuimg hte user doesn' close the web page).
     
    I tried to edit the overridden function so they are taken to a message page, but this does not work:

    public override AppChatIdentity GetLogonIdentity()

    {

    if (HttpContext.Current.User.Identity.IsAuthenticated)

    {

    CurrentUser cu = new CurrentUser();

    cu.GetUserDetails();

    string sLogin = cu.GUID.ToString();

    return new AppChatIdentity(ToUserId(sLogin), false, ToUserId(sLogin), HttpContext.Current.Request.UserHostAddress);

    }

    else

    {

    HttpContext.Current.Response.Redirect("/message.aspx");
     
    return null;

    }

    }

     
     Can you help please? All I want to do is show a message page if the user is not authenticated when I call Chat_OpenMessenger()
     
    thanks
     
    Greg
     
     
     
     
  •  06-12-2008, 10:45 AM 41364 in reply to 41353

    Re: check user is authenticated on Chat_OpenMessenger()

    greg0rym,
     
    You can show this link to the online users only by changing your code.

    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