public void Enabled(global::Orchard.Environment.Extensions.Models.Feature feature) { var settings = _services.WorkContext.CurrentSite.As <ProtectionSettingsPart>(); if (String.IsNullOrWhiteSpace(settings.ProtectedEntries)) { var defaultProtectedEntries = new string[] { "Laser.Orchard.WebServices.Json.GetByAlias", "Laser.Orchard.WebServices.Signal.Trigger", "Laser.Orchard.Braintree.Paypal.GetClientToken", "Laser.Orchard.Braintree.Paypal.Pay", "Laser.Orchard.WebServices.WebApi.Display", "Laser.Orchard.WebServices.WebApi.Terms" }; settings.ProtectedEntries = String.Join(",", defaultProtectedEntries); } if (!settings.ExternalApplicationList.ExternalApplications.Any()) { var appList = new ExternalApplicationList(); var apps = new List <ExternalApplication>(); var api = ""; var name = ""; apps.Add(new ExternalApplication { Name = name = String.Format("{0}App", _settings.Name), ApiKey = api = new WebApiUtils().RandomString(22), EnableTimeStampVerification = true, Validity = 10 }); appList.ExternalApplications = apps; settings.ExternalApplicationList = appList; _notifier.Information(T("A default app named \"{0}\" has been created. Its Api Key is {1}.", name, api)); } }
public void Enabled(global::Orchard.Environment.Extensions.Models.Feature feature) { if (feature.Descriptor.Id == "Laser.Orchard.MobileCommunicationImport") { _pushNotificationService.Synchronize(); } }
public void Enabled(global::Orchard.Environment.Extensions.Models.Feature feature) { if (feature.Descriptor.Name == "Laser.Orchard.Accessibility") { // imposta la cache in modo che tenga conto del cookie "Accessibility" var cacheSettings = _services.WorkContext.CurrentSite.ContentItem.Parts.OfType <CacheSettingsPart>().First(); if (cacheSettings != null) { string vary = cacheSettings.VaryByRequestCookies ?? ""; char[] separators = { ',' }; List <string> cookieList = vary.Split(separators, System.StringSplitOptions.RemoveEmptyEntries).ToList(); if (cookieList.Contains(Utils.AccessibilityCookieName) == false) { cookieList.Add(Utils.AccessibilityCookieName); vary = string.Join(",", cookieList); cacheSettings.VaryByRequestCookies = vary; _signals.Trigger(CacheSettings.CacheKey); } } // svuota la cache _cacheStorageProvider.RemoveAll(); } }
public void Enabled(global::Orchard.Environment.Extensions.Models.Feature feature) { var settings = _orchardServices.WorkContext.CurrentSite.As <UserRegistrationSettingsPart>(); var list = new List <string>(); var policies = _policyServices.GetAllPublishedPolicyTexts(); foreach (var p in policies) { var currentPolicyId = string.Format("{{{0}}}", p.Id); if (p.AddPolicyToRegistration) { list.Add(currentPolicyId); } } settings.IncludePendingPolicy = (list.Count == 0) ? Policy.IncludePendingPolicyOptions.No : Policy.IncludePendingPolicyOptions.Yes; settings.PolicyTextReferences = list.ToArray(); }
public void Uninstalling(global::Orchard.Environment.Extensions.Models.Feature feature) { }
public void Disabled(global::Orchard.Environment.Extensions.Models.Feature feature) { }
public void Uninstalling(global::Orchard.Environment.Extensions.Models.Feature feature) { //throw new NotImplementedException(); }
public void Enabled(global::Orchard.Environment.Extensions.Models.Feature feature) { //if (feature.Descriptor.Id == "Laser.Orchard.CommunicationGateway") { // _communicationService.Synchronize(); //} }