Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((Request.QueryString["led"]) == null)
        {
            if ((Request.UrlReferrer == null) || (!Request.UrlReferrer.AbsoluteUri.Contains("Register.aspx") && !Request.UrlReferrer.AbsoluteUri.Contains("Login.aspx") && !Request.UrlReferrer.AbsoluteUri.Contains("ChangePasswordSuccess.aspx") && !Request.UrlReferrer.AbsoluteUri.Contains("RecoverPassword.aspx")))
            {
                if (Request.QueryString["logout"] != null)
                {
                    //Session.Abandon();
                    FormsAuthentication.SignOut();
                    Response.Redirect("Login.aspx?led=1");
                }
                if (Request.QueryString["egiftid"] != null)
                {
                    string eGiftId = Request.QueryString["egiftid"];
                    Administration admin = new Administration();
                    CharityEvents Event = admin.GetEventByEgiftId(eGiftId);

                    if (Event != null && Event.UserId == Guid.Empty)
                    {
                        Response.Redirect("Register.aspx?egiftid=" + eGiftId + "&ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]), false);
                        return;
                    }
                }
                if (Request.QueryString["PMC"] != null)
                {
                    Response.Redirect("Register.aspx?PMC=yes&ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]));
                }
                Response.Redirect("Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]));
            }
            if (Request.QueryString["logout"] != null)
            {
                foreach (HttpCookie cookie in Request.Cookies)
                {
                    cookie.Expires = DateTime.Now.AddDays(-1d);
                }
                Response.Redirect("Login.aspx");
            }
        }
        RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        ForgotPasswordHyperLink.NavigateUrl = "RecoverPassword.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
    }
Ejemplo n.º 2
0
 protected void JimmyFundIDAvailableValidator_ServerValidate(object source, ServerValidateEventArgs args)
 {
     args.IsValid = true;
     if (Request.QueryString["Jimmy"] != null)
     {
         string eGiftId = ((TextBox)RegisterUserWizardStep.Controls[0].FindControl("JimmyData").FindControl("JimmyEgiftID")).Text;
         if (!string.IsNullOrEmpty(eGiftId.Trim()))
         {
             Administration admin = new Administration();
             CharityEvents Event = admin.GetEventByEgiftId(eGiftId, "Jimmy");
             if (Event != null)
             {
                 args.IsValid = false;
             }
         }
     }
 }
Ejemplo n.º 3
0
    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
        if (Request.QueryString["PMC"] != null)
        {
            string eGiftId = ((TextBox)RegisterUserWizardStep.Controls[0].FindControl("PMCData").FindControl("EGIFTID")).Text;
            Administration admin = new Administration();
            CharityEvents Event = admin.GetEventByEgiftId(eGiftId);
            if (Event != null && Event.UserId == Guid.Empty)
            {
                Response.Redirect("EGIFTIDRegister.aspx?egiftid=" + eGiftId);
                return;
            }
        }
        else if (Request.QueryString["Jimmy"] != null)
        {
            string eGiftId = ((TextBox)RegisterUserWizardStep.Controls[0].FindControl("JimmyData").FindControl("JimmyEgiftID")).Text;
            Administration admin = new Administration();

            Response.Redirect("../Funds/EditFund.aspx?Jimmy=yes&egiftid=" + eGiftId);
            return;

        }
        else if (Request.QueryString["event"] != null)
        {
            string strEvent = Request.QueryString["event"].ToString();
            Response.Redirect("../Funds/EditFund.aspx?event=" + strEvent);
            return;
        }

        string continueUrl = RegisterUser.ContinueDestinationPageUrl;
        if (String.IsNullOrEmpty(continueUrl))
        {
            continueUrl = "~/";
        }
        Response.Redirect(continueUrl);
    }
Ejemplo n.º 4
0
 protected void EGIFTIDAvailableValidator_ServerValidate(object source, ServerValidateEventArgs args)
 {
     args.IsValid = true;
     if (Request.QueryString["PMC"] != null)
     {
         string eGiftId = ((TextBox)RegisterUserWizardStep.Controls[0].FindControl("PMCData").FindControl("EGIFTID")).Text;
         Administration admin = new Administration();
         CharityEvents Event = admin.GetEventByEgiftId(eGiftId);
         if ((Event != null) && (Event.UserId != Guid.Empty))
         {
             args.IsValid = false;
         }
     }
 }