Пример #1
0
        protected void Page_Init(object sender, EventArgs e)
        {
            try
            {
                this._authority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority;
            }
            catch (Exception)
            {
                // if this fails FOR WHATEVER REASON then we're not authenticated

                this._authority = null;
                FormsAuthentication.SignOut();
                Response.Redirect("/", true);
            }

            // BEGIN TEST CODE



            // END TEST CODE


            if (this._authority.Organization.Identity == 3 &&
                PilotInstallationIds.IsPilot(PilotInstallationIds.PiratePartySE))
            {
                this._authority = null;
                FormsAuthentication.SignOut();
                Response.Redirect("/", true);
            }
        }
Пример #2
0
    protected static AuthenticationData GetAuthenticationDataAndCulture()
    {
        // This function is called from static page methods in AJAX calls to get
        // the current set of authentication data. Static page methods cannot access
        // the instance data of PageV5Base.

        return(CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current));
    }
Пример #3
0
    protected override void OnInit(EventArgs e)
    {
        try
        {
            this._authority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority;
        }
        catch (Exception)
        {
            // if this fails FOR WHATEVER REASON then we're not authenticated
            this._authority = null;
            FormsAuthentication.SignOut();
            Response.Redirect("/");
        }

        base.OnInit(e);
    }
Пример #4
0
    /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
    protected override void OnInitComplete(EventArgs e)
    {
        base.OnInitComplete(e);

        string identity = HttpContext.Current.User.Identity.Name;

        if (!string.IsNullOrEmpty(identity))
        {
            try
            {
                CurrentAuthority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority;
            }
            catch (Exception)
            {
                // if this fails FOR WHATEVER REASON then we're not authenticated
                this.CurrentAuthority = null;
                FormsAuthentication.SignOut();
            }
        }
        else
        {
            CurrentAuthority = null; // unauthenticated!
        }
    }
Пример #5
0
 protected static AuthenticationData GetAuthenticationDataAndCulture()
 {
     return(CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current));
 }