public ActionResult Accept() { // Gets the related tracking consent ConsentInfo consent = ConsentInfoProvider.GetConsentInfo("SampleTrackingConsent"); // Sets the visitor's cookie level to 'All' (enables contact tracking) currentCookieLevelProvider.SetCurrentCookieLevel(CookieLevel.All); // Gets the current contact and creates a consent agreement ContactInfo currentContact = ContactManagementContext.GetCurrentContact(); consentAgreementService.Agree(currentContact, consent); return(RedirectToAction("DisplayConsent")); }
public ActionResult Agree() { var resultStatus = HttpStatusCode.BadRequest; var consent = ConsentInfoProvider.GetConsentInfo(TrackingConsentGenerator.CONSENT_NAME); if (consent != null) { mCookieLevelProvider.SetCurrentCookieLevel(CookieLevel.All); mConsentAgreementService.Agree(ContactManagementContext.CurrentContact, consent); resultStatus = HttpStatusCode.OK; } // Redirect is handled on client by javascript return(new HttpStatusCodeResult(resultStatus)); }
public ActionResult Agree(string returnUrl) { var consent = consentInfoProvider.Get(TrackingConsentGenerator.CONSENT_NAME); if (consent != null) { cookieLevelProvider.SetCurrentCookieLevel(CookieLevel.All); var contact = ContactManagementContext.CurrentContact; if (contact != null) { consentAgreementService.Agree(contact, consent); } return(Redirect(returnUrl)); } return(new StatusCodeResult(StatusCodes.Status400BadRequest)); }