Re: DNN Sub Portal User Authentication

  •  08-18-2004, 11:49 AM

    Re: DNN Sub Portal User Authentication

     
    Terry found a soluton and we made the test and it works.
     
    I highlighted the code we added as followings:

    'If the url contain the CuteChat, we don't want to dotnetnuke do the sighout.

    If Request.Path.ToLower().IndexOf("/cutechat/") = -1 Then

        ' expire cookies if portal has changed

        Response.Cookies("portalid").Value = Nothing

        Response.Cookies("portalid").Path = "/"

        Response.Cookies("portalid").Expires = DateTime.Now.AddYears(-30)

        Response.Cookies("portalroles").Value = Nothing

        Response.Cookies("portalroles").Path = "/"

        Response.Cookies("portalroles").Expires = DateTime.Now.AddYears(-30)

        ' check if user is valid for new portal

        Dim objUsers As New UserController

        Dim objUser As UserInfo = objUsers.GetUser(_portalSettings.PortalId, Int32.Parse(Context.User.Identity.Name))

        If objUser Is Nothing Then

            ' log user out

            FormsAuthentication.SignOut()

            ' Redirect browser back to home page

            Response.Redirect(Request.RawUrl, True)

            Exit Sub

        End If

    End If

     

    and:
     

    'If the url contain the CuteChat, we don't want to dotnetnuke do the sighout.

    If Request.Path.ToLower().IndexOf("/cutechat/") = -1 Then

        ' Log User Off from Cookie Authentication System

         FormsAuthentication.SignOut()

         ' expire cookies

        Response.Cookies("portalid").Value = Nothing

        Response.Cookies("portalid").Path = "/"

        Response.Cookies("portalid").Expires = DateTime.Now.AddYears(-30)

        Response.Cookies("portalroles").Value = Nothing

        Response.Cookies("portalroles").Path = "/"

        Response.Cookies("portalroles").Expires = DateTime.Now.AddYears(-30)

    End If

     
    Please give it try and keep us 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 Complete Thread