예제 #1
0
        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");
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 static CryptoCache()
 {
     CacheCryptoKey = EcommerceSettings.GetSetting(Keys.CacheCryptoKey);
 }