protected override void OnInit(EventArgs e) { ctrlGiftRegistryShareForm.ThisCustomer = ThisCustomer; var giftRegistry = this.GiftRegistryFromQueryString; if (giftRegistry != null) { //block the access if registry is not owned by the current user if (!ThisCustomer.IsRegistryOwnedByCustomer(giftRegistry.RegistryID)) { Response.Redirect("giftregistry.aspx"); } ctrlGiftRegistryShareForm.LoadGiftRegistry(giftRegistry); string defaultMessage = string.Format(AppLogic.GetString("editgiftregistry.aspx.44", SkinID, ThisCustomer.LocaleSetting), giftRegistry.URLForViewing); ctrlGiftRegistryShareForm.HtmlMessage = defaultMessage; StartDate = giftRegistry.StartDate; EndDate = giftRegistry.EndDate; Title = giftRegistry.Title; CustomURL = giftRegistry.CustomURLPostfix; } else { //registry not found Response.Redirect("giftregistry.aspx"); } btnSend.Click += (sender, ex) => SendNow(); btnSend.Text = AppLogic.GetString("editgiftregistry.aspx.40", SkinID, ThisCustomer.LocaleSetting); }
private void InitAuthentication() { var giftRegistry = this.GiftRegistryFromQueryString; if (giftRegistry != null) { bool registryOwnedByCustomer = ThisCustomer.IsRegistryOwnedByCustomer(giftRegistry.RegistryID); if (registryOwnedByCustomer) { LoadRegistry(giftRegistry); pnlMain.Visible = true; pnlPassword.Visible = false; return; } if ((giftRegistry.IsPrivate && !giftRegistry.GuestPassword.IsNullOrEmptyTrimmed())) { string viewedRegID = this.ThisCustomer.ThisCustomerSession["ViewedRegistryID"]; if (!viewedRegID.IsNullOrEmptyTrimmed() && viewedRegID == giftRegistry.RegistryID.ToString()) { LoadRegistry(giftRegistry); pnlMain.Visible = true; pnlPassword.Visible = false; return; } else { pnlMain.Visible = false; pnlPassword.Visible = true; } } else { pnlMain.Visible = true; pnlPassword.Visible = false; LoadRegistry(giftRegistry); } } else { Response.Redirect(CurrentContext.FullyQualifiedApplicationPath()); } }