public static void RunServiceAsSpaceOwner(WebServicesClientProtocol proxy) { // impersonate as space owner string username = EcommerceSettings.GetSetting("OwnerUsername"); string password = EcommerceSettings.GetSetting("OwnerPassword"); if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password)) { EnterpriseServerProxyConfigurator config = new EnterpriseServerProxyConfigurator(); config.EnterpriseServerUrl = EcommerceSettings.GetSetting("EnterpriseServer"); config.Username = username; config.Password = password; config.Configure(proxy); } else { throw new Exception("Ecommerce doesn't configured correctly, please review SitesSettings/Ecommerce section"); } }
public static void Configure(WebServicesClientProtocol proxy, bool applyPolicy) { if (applyPolicy && !HttpContext.Current.Request.IsAuthenticated) { // impersonate as space owner string username = EcommerceSettings.GetSetting("OwnerUsername"); string password = EcommerceSettings.GetSetting("OwnerPassword"); if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password)) { EnterpriseServerProxyConfigurator config = new EnterpriseServerProxyConfigurator(); config.EnterpriseServerUrl = EcommerceSettings.GetSetting("EnterpriseServer"); config.Username = username; config.Password = password; config.Configure(proxy); return; } } PortalUtils.ConfigureEnterpriseServerProxy(proxy, applyPolicy); }
static CryptoCache() { CacheCryptoKey = EcommerceSettings.GetSetting(Keys.CacheCryptoKey); }