Esempio n. 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");
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 static CryptoCache()
 {
     CacheCryptoKey = EcommerceSettings.GetSetting(Keys.CacheCryptoKey);
 }