Ejemplo n.º 1
0
        public bool IsCommunityKeyActivated()
        {
            bool foundKey = RegistryHelpers.GetSetting("IsCommunity", null) != null;

            if (foundKey)
            {
                MainWindow.ProfilDetailEdition.Text = Constants.COMMUNITY_EDITION_FRIENDLY_NAME;
            }
            return(foundKey);
        }
Ejemplo n.º 2
0
        private void SetKeyGuidAsCookie()
        {
            Guid keyGuid;

            if (Guid.TryParse(RegistryHelpers.GetSetting("Feature_" + ActivatedFeatureID, null), out keyGuid))
            {
                Browser.CookieStorage.SetSessionCookie(CSHTML5_COOKIES_URL, LICENSE_KEY_GUID_COOKIE, keyGuid.ToString(), "localhost", "/", true, true);
                foreach (var cookie in Browser.CookieStorage.GetAllCookies(CSHTML5_COOKIES_URL))
                {
                    Debug.WriteLine(cookie);
                }
            }
        }
Ejemplo n.º 3
0
        public static void LoadCookies(WPFBrowserView wpfBrowserView, string url, string registryName)
        {
            // we search for cookies with a specific url into registries
            string cookiesAsString = RegistryHelpers.GetSetting(registryName + "_" + url, null);

            if (cookiesAsString != null)
            {
                List <CookieData> cookiesList = Serializer.Load <List <CookieData> >(cookiesAsString);
                foreach (var cookie in cookiesList)
                {
                    if (cookie.session)
                    {
                        wpfBrowserView.Browser.CookieStorage.SetSessionCookie(cookie.url, cookie.name, cookie.value, cookie.domain, cookie.path, cookie.secure, cookie.httpOnly);
                    }
                    else
                    {
                        wpfBrowserView.Browser.CookieStorage.SetCookie(cookie.url, cookie.name, cookie.value, cookie.domain, cookie.path, cookie.expirationTime, cookie.secure, cookie.httpOnly);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        internal static bool IsFeatureEnabled(string featureId, HashSet <string> flags)
        {
#if SPECIAL_LICENSE_FOR_APL_USERS
            // If the "apl" flag is specified, we consider that the Pro Edition features are allowed. This was made for the APL community. See the ZenDesk ticket 807 and related.
            if (flags.Contains("apl") && featureId == Constants.PROFESSIONAL_EDITION_FEATURE_ID)
            {
                return(true);
            }
#endif
            //------------------------------
            // Look in the Registry:
            //------------------------------
            object value = RegistryHelpers.GetSetting("Feature_" + featureId, null);
            if (value != null)
            {
                return(true); //todo: to prevent registry tampering, we should retrieve the activation key and check with the server that it is ok.
            }
            else
            {
                return(false);
            }
        }