Esempio n. 1
0
        private void SaveSettings()
        {
            // SAVE THE URL/SSL CONFIGURATION
            _Store.StoreUrl      = StoreUrl.Text;
            _Settings.SSLEnabled = SSLEnabled.Checked;
            if (_Settings.SSLEnabled && !string.IsNullOrEmpty(SSLDomain.Text))
            {
                // ENSURE CORRECT URI VALUES
                _Settings.EncryptedUri   = SSLDomain.Text;
                _Settings.UnencryptedUri = UrlHelper.GetDomainFromUrl(_Store.StoreUrl);
            }
            else
            {
                // RESET URI VALUES
                SSLDomain.Text           = string.Empty;
                _Settings.UnencryptedUri = string.Empty;
                _Settings.EncryptedUri   = string.Empty;
            }

            _Settings.MobileStoreDomain = MobileDomain.SelectedValue;
            UpdatesSSLConfig(SecureAllPages.Checked);

            // IF NO SSL DOMAIN IS SET, COOKIE DOMAIN SHOULD BE BLANK (UNSET)
            // VERIFY WEB.CONFIG IS CONSISTENT WITH WHATEVER IS DETERMINED AS THE COOKIE DOMAIN
            string cookieDomain = UrlHelper.GetSecondLevelDomainFromUrl(_Settings.EncryptedUri);


            try
            {
                UrlHelper.UpdateWebConfigCookieDomain(cookieDomain);
            }
            catch (Exception exp)
            {
                phSslDomain.Controls.Add(new LiteralControl("<br />"));
                Label error = new Label();
                error.SkinID = "ErrorCondition";
                error.Text   = "There was a problem attempting to save this change,<br /> please read error log for more details.";
                phSslDomain.Controls.Add(error);
                Logger.Error("Unable to save SSL changes in web.config", exp);
            }

            // SAVE FILE EXTENSIONS
            _Settings.FileExt_Assets       = FileExtAssets.Text;
            _Settings.FileExt_Themes       = FileExtThemes.Text;
            _Settings.FileExt_DigitalGoods = FileExtDigitalGoods.Text;

            // SET PAYMENT ACCOUNT SETTINGS
            _Settings.PaymentLifespan         = AlwaysConvert.ToInt(PaymentLifespan.SelectedValue);
            _Settings.EnableCreditCardStorage = EnableCreditCardStorage.Checked;

            // SAVE ALL AND DISPLAY CONFIRMATION
            _Store.Save();
            AppCache.Clear();
            SavedMessage.Visible = true;
            SavedMessage.Text    = string.Format(SavedMessage.Text, LocaleHelper.LocalNow);
        }
Esempio n. 2
0
        public async Task <ServiceResponse <bool> > Logout()
        {
            if (AppCache.State.IsAuthenticated)
            {
                await _adAuthService.Unauthenticate();

                await AppCache.Clear();
            }

            return(new ServiceResponse <bool>(ServiceStatus.Success, data: true));
        }
Esempio n. 3
0
        public void Can_Clear_All_Items()
        {
            var cacheContent1 = new MacroCacheContent();
            var cacheContent2 = new MacroCacheContent();
            var cacheContent3 = new MacroCacheContent();
            var cacheContent4 = new LiteralControl();

            AppCache.Get("Test1", () => cacheContent1);
            AppCache.Get("Test2", () => cacheContent2);
            AppCache.Get("Test3", () => cacheContent3);
            AppCache.Get("Test4", () => cacheContent4);

            Assert.AreEqual(4, GetTotalItemCount);

            AppCache.Clear();

            Assert.AreEqual(0, GetTotalItemCount);
        }
Esempio n. 4
0
 protected void SaveButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Store store = AbleContext.Current.Store;
         StoreSettingsManager settings = store.Settings;
         settings.SeoAllowCustomExtensions    = AllowCustomExtensions.Checked;
         settings.SeoAllowedExtensions        = AllowedExtensions.Text;
         settings.SeoAllowUrlWithoutExtension = AllowUrlWithoutExtensions.Checked;
         settings.SeoCacheSize       = AlwaysConvert.ToInt(CacheSize.Text);
         settings.SeoTrackStatistics = EnableTracking.Checked;
         settings.Save();
         AppCache.Clear();
         IntializeCustomExtensionsPanel();
         SavedMessage.Visible = true;
         SavedMessage.Text    = string.Format(SavedMessage.Text, LocaleHelper.LocalNow);
     }
 }
Esempio n. 5
0
        protected void RemoveWebConfigurationButton_Click(object sender, EventArgs e)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(_WebConfigPath);
            XmlNode xmlNode = xmlDocument.SelectSingleNode("/configuration/system.webServer/modules");

            if (xmlNode != null)
            {
                StoreSettingsManager settings = AbleContext.Current.Store.Settings;
                settings.SeoAllowCustomExtensions = false;
                settings.Save();
                AppCache.Clear();
                ((XmlElement)xmlNode).RemoveAttribute("runAllManagedModulesForAllRequests");
                string fileContent = XmlUtility.XmlToString(xmlDocument);
                File.WriteAllText(_WebConfigPath, fileContent);
                Response.Redirect(Request.Url.ToString());
            }
        }
Esempio n. 6
0
 public virtual void TearDown()
 {
     AppCache.Clear();
 }
Esempio n. 7
0
 protected override bool DoClearCathe()
 {
     AppCache.Clear();
     return(base.DoClearCathe());
 }
Esempio n. 8
0
 public void Run()
 {
     TvInfoService.StoreShows();
     AppCache.Clear();
     TvInfoService.GetShows();
 }