HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/TDijk1/erp-apps.eu/wwwroot/CMSWebParts/Pux/Membership/Logout/SignOutUser.ascx.cs
using CMS.DataEngine;
using CMS.DocumentEngine;
using CMS.Helpers;
using CMS.Membership;
using CMS.PortalControls;
using CMS.SiteProvider;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CMSWebParts_Pux_Membership_Logout_SignOutUser : CMSAbstractWebPart
{
    #region "Properties"

    public bool ShouldLogout
    {
        get
        {
            return ValidationHelper.GetBoolean(GetValue("ShouldLogout"), false);
        }
        set
        {
            SetValue("ShouldLogout", value);
        }
    }

    public string RedirectUrl
    {
        get
        {
            return ValidationHelper.GetString(GetValue("RedirectUrl"), string.Empty);
        }
        set
        {
            SetValue("RedirectUrl", value);
        }
    }

    #endregion

    public override void OnContentLoaded()
    {
        base.OnContentLoaded();
        SetupControl();
    }

    protected void SetupControl()
    {
        if (this.StopProcessing)
        {
            // Do not process
        }
        else
        {
            if (Enabled && ShouldLogout && ViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite)
            {
                string redirectUrl = RedirectUrl;

                if (string.IsNullOrEmpty(redirectUrl))
                {
                    SettingsKeyInfoProvider.GetValue("CMSDefaultAliasPath", CurrentSiteName);
                    redirectUrl = DocumentURLProvider.GetUrl(redirectUrl);
                }

                if (AuthenticationHelper.IsAuthenticated())
                {
                    AuthenticationHelper.SignOut();
                }

                Response.Cache.SetNoStore();
                URLHelper.Redirect(redirectUrl);
            }
        }
    }

    public override void ReloadData()
    {
        base.ReloadData();

        SetupControl();
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
}