public void Before_each_test()
            {
                _licensingManager = new LicensingManager();
                _licenseHelper = new LicenseHelper();

                _licenseHelper.BasicSetup();
            }
Beispiel #2
0
 public void RunApplication()
 {
     LicenseHelper.Register();
     AppSettingsManager.Instance.LoadSettings();
     ResourceManager.Instance.LoadResources();
     FormMain.Instance.InitForm();
     PopupMessageHelper.Instance.Title    = FormMain.Instance.Text;
     PopupMessageHelper.Instance.MainForm = FormMain.Instance;
     Application.Run(FormMain.Instance);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.Membership))
        {
            this.StopProcessing = true;
            return;
        }

        this.Initialize();
    }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (!LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.Messaging))
        {
            contactListElem.StopProcessing = true;
            contactListElem.Visible        = false;
        }
    }
Beispiel #5
0
        private void Button_Browse_Click(object sender, RoutedEventArgs e)
        {
            string localizedString = LocalizationProvider.GetLocalizedString("Pro_ImageUploader", false, "MarkdownPadStrings");

            if (!LicenseHelper.ValidateLicense(localizedString, this))
            {
                return;
            }
            this.BrowseAndUploadImage();
        }
Beispiel #6
0
 public LicenseForm()
 {
     InitializeComponent();
     this.Icon = Properties.Resources.keys;
     this.contactLink.Links.Add(new LinkLabel.Link()
     {
         LinkData = "mailto:[email protected]"
     });
     this.tbUserId.Text = LicenseHelper.GetUserId();
 }
    private void CheckEcommerceLicenseLimitations()
    {
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            bool licenseOK = LicenseHelper.CheckLicenseLimitations(FeatureEnum.Ecommerce, out int skuCount, out int maxSKUCount);

            ltlLicenseLimitations.Text    = String.Format(GetString("header.ecommercefeatureexceeded"), skuCount, maxSKUCount, KENTICO_LICENSE_ULTIMATE_URL);
            pnlLicenseLimitations.Visible = !licenseOK;
        }
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        userId      = QueryHelper.GetInteger("userId", 0);
        currentUser = MembershipContext.AuthenticatedUser;

        // Check 'read' permissions
        if (!currentUser.IsAuthorizedPerResource("CMS.Friends", "Read") && (currentUser.UserID != userId))
        {
            RedirectToAccessDenied("CMS.Friends", "Read");
        }

        // Check 'manage' permission
        bool friendsManagePermission = currentUser.IsAuthorizedPerResource("CMS.Friends", "Manage") || (currentUser.UserID == userId);

        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, string.Empty) != string.Empty)
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);
        }

        if (userId > 0)
        {
            // Check that only global administrator can edit global administrator's accounts
            UserInfo ui = UserInfoProvider.GetUserInfo(userId);
            EditedObject = ui;

            if (!CheckGlobalAdminEdit(ui))
            {
                plcTable.Visible = false;
                lblError.Text    = GetString("Administration-User_List.ErrorGlobalAdmin");
                lblError.Visible = true;
            }
            else
            {
                ScriptHelper.RegisterDialogScript(this);
                FriendsListRequested.UserID              = userId;
                FriendsListRequested.OnCheckPermissions += CheckPermissions;
                FriendsListRequested.ZeroRowsText        = GetString("friends.nouserrequestedfriends");

                // Request friend link
                string script =
                    "function displayRequest(){ \n" +
                    "modalDialog('" + AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/Friends_Request.aspx") + "?userid=" + userId + "&siteid=" + SiteID + "', 'rejectDialog', 810, 460);}";

                ScriptHelper.RegisterStartupScript(this, GetType(), "displayModalRequest", ScriptHelper.GetScript(script));

                HeaderAction action = new HeaderAction();
                action.Text          = GetString("Friends_List.NewItemCaption");
                action.OnClientClick = "displayRequest();";
                action.RedirectUrl   = null;
                action.Enabled       = friendsManagePermission;
                CurrentMaster.HeaderActions.AddAction(action);
            }
        }
    }
Beispiel #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Messaging);

        PageTitle.TitleText = GetString("Messaging.MessageUserSelector.HeaderCaption");
        if (!MembershipContext.AuthenticatedUser.IsPublic())
        {
            CurrentMaster.Tabs.Visible = true;
            bool communityModuleLoaded = ModuleManager.IsModuleLoaded(ModuleName.COMMUNITY);
            bool showOnlySearch        = (QueryHelper.GetString("showtab", String.Empty).ToLowerCSafe() != "search");


            if (showOnlySearch)
            {
                // ContactList tab
                CurrentMaster.Tabs.AddTab(new UITabItem
                {
                    Text        = GetString("Messaging.MessageUserSelector.ContactList"),
                    RedirectUrl = AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Messaging/Dialogs/MessageUserSelector_ContactList.aspx") + "?hidid=" +
                                  QueryHelper.GetText("hidid", String.Empty) +
                                  "&mid=" +
                                  QueryHelper.GetText("mid", String.Empty),
                });

                // Show only if community module is present
                if (communityModuleLoaded && UIHelper.IsFriendsModuleEnabled(SiteContext.CurrentSiteName))
                {
                    // Friends tab
                    CurrentMaster.Tabs.AddTab(new UITabItem
                    {
                        Text        = GetString("friends.friends"),
                        RedirectUrl = AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/MessageUserSelector_FriendsList.aspx") + "?hidid=" +
                                      QueryHelper.GetText("hidid", String.Empty) +
                                      "&mid=" +
                                      QueryHelper.GetText("mid", String.Empty),
                    });
                }
            }

            // Search tab
            CurrentMaster.Tabs.AddTab(new UITabItem
            {
                Text        = GetString("general.search"),
                RedirectUrl = AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Messaging/Dialogs/MessageUserSelector_Search.aspx") + "?refresh=" +
                              QueryHelper.GetText("refresh", String.Empty) +
                              "&hidid=" +
                              QueryHelper.GetText("hidid", String.Empty) +
                              "&mid=" +
                              QueryHelper.GetText("mid", String.Empty),
            });

            CurrentMaster.Tabs.SelectedTab = 0;
            CurrentMaster.Tabs.UrlTarget   = "MessageUserSelectorContent";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Add styles
        RegisterDialogCSSLink();

        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, string.Empty) != string.Empty)
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        var currentUser = MembershipContext.AuthenticatedUser;

        // Setup unigrid
        gridClasses.GridView.ShowHeader  = false;
        gridClasses.GridView.BorderWidth = 0;
        gridClasses.OnExternalDataBound += gridClasses_OnExternalDataBound;
        gridClasses.OnBeforeDataReload  += gridClasses_OnBeforeDataReload;
        gridClasses.OnAfterRetrieveData += gridClasses_OnAfterRetrieveData;

        if (ConvertDocumentID > 0)
        {
            // Hide extra options
            plcNewABTestVariant.Visible = false;
            plcNewLink.Visible          = false;
        }
        else
        {
            if (Scope != null)
            {
                // Initialize control by scope settings
                AllowNewABTest &= Scope.ScopeAllowABVariant;
                AllowNewLink   &= Scope.ScopeAllowLinks;
            }

            lblNewLink.Text        = GetString("content.ui.linkexistingdoc");
            lnkNewLink.NavigateUrl = "javascript:modalDialog('" + GetLinkDialogUrl(ParentNodeID) + "', 'contentselectnode', '90%', '85%')";

            plcNewABTestVariant.Visible = false;

            if (ParentNode != null)
            {
                // AB test variant settings
                if (SettingsKeyInfoProvider.GetBoolValue(SiteContext.CurrentSiteName + ".CMSABTestingEnabled") &&
                    AllowNewABTest &&
                    !IsInDialog &&
                    currentUser.IsAuthorizedPerResource("cms.ABTest", "Read") &&
                    ModuleEntryManager.IsModuleLoaded(ModuleName.ONLINEMARKETING) &&
                    ResourceSiteInfoProvider.IsResourceOnSite("CMS.ABTest", SiteContext.CurrentSiteName) &&
                    LicenseHelper.CheckFeature(RequestContext.CurrentDomain, FeatureEnum.ABTesting) &&
                    (ParentNode.NodeAliasPath != "/") &&
                    (ParentNode.NodeClassName != "CMS.Folder"))
                {
                    string url = URLHelper.AddParameterToUrl(NewVariantUrl, "parentnodeid", ParentNodeID.ToString());
                    url = URLHelper.AddParameterToUrl(url, "parentculture", ParentCulture);

                    plcNewABTestVariant.Visible = true;
                    lblNewVariant.Text          = GetString("abtesting.abtestvariant");
                    lnkNewVariant.NavigateUrl   = URLHelper.GetAbsoluteUrl(url);
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrentUserInfo currentUser = CMSContext.CurrentUser;

        // Setup unigrid
        gridClasses.GridView.ShowHeader  = false;
        gridClasses.GridView.BorderWidth = 0;
        gridClasses.OnExternalDataBound += gridClasses_OnExternalDataBound;
        gridClasses.OnBeforeDataReload  += gridClasses_OnBeforeDataReload;
        gridClasses.OnAfterRetrieveData += gridClasses_OnAfterRetrieveData;

        if (ConvertDocumentID > 0)
        {
            // Hide extra options
            plcNewABTestVariant.Visible = false;
            plcNewLink.Visible          = false;
        }
        else
        {
            imgNewLink.ImageUrl    = GetImageUrl("CMSModules/CMS_Content/Menu/Link.png");
            lblNewLink.Text        = GetString("ContentNew.NewLink");
            lnkNewLink.NavigateUrl = "javascript:modalDialog('" + GetLinkDialogUrl(ParentNodeID) + "', 'contentselectnode', '90%', '85%')";

            plcNewABTestVariant.Visible = false;

            if (ParentNode != null)
            {
                // AB test variant settings
                if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSABTestingEnabled") &&
                    AllowNewABTest &&
                    !IsInDialog &&
                    currentUser.IsAuthorizedPerResource("cms.ABTest", "Read") &&
                    ModuleEntry.IsModuleLoaded("cms.onlinemarketing") &&
                    ResourceSiteInfoProvider.IsResourceOnSite("CMS.ABTest", CMSContext.CurrentSiteName) &&
                    LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.ABTesting) &&
                    (ParentNode.NodeAliasPath != "/"))
                {
                    string url = URLHelper.AddParameterToUrl(NewVariantUrl, "parentnodeid", ParentNodeID.ToString());
                    url = URLHelper.AddParameterToUrl(url, "parentculture", ParentCulture);

                    plcNewABTestVariant.Visible = true;
                    lblNewVariant.Text          = GetString("abtesting.abtestvariant");
                    lnkNewVariant.NavigateUrl   = URLHelper.GetAbsoluteUrl(url);

                    if (pnlFooter.Visible == false)
                    {
                        pnlABVariant.CssClass += "PageSeparator";
                    }
                }
            }

            imgNewVariant.ImageUrl = GetImageUrl("Objects/CMS_Variant/object_small.png");
        }
    }
Beispiel #13
0
            public void Before_each_test()
            {
                _licensingManager = new LicensingManager();

                _licenseHelper      = new LicenseHelper();
                _serviceTestManager = new LicenseServiceTestManager(_licenseHelper);

                _serviceTestManager.Start();

                _licenseHelper.BasicSetup();
            }
Beispiel #14
0
			public void Before_each_test()
			{
				_licensingManager = new LicensingManager();

				_licenseHelper = new LicenseHelper();
				_serviceTestManager = new LicenseServiceTestManager(_licenseHelper);

				_serviceTestManager.Start();

				_licenseHelper.BasicSetup();
			}
 private static string GetEditionName(string editionChar)
 {
     try
     {
         ProductEditionEnum edition = LicenseKeyInfoProvider.CharToEdition(editionChar);
         return(LicenseHelper.GetEditionName(edition));
     }
     catch
     {
         return("#UNKNOWN#");
     }
 }
Beispiel #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check license
        LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.BannedIP);

        // Banned ip
        this.apiCreateBannedIp.RunExample            += new CMSAPIExamples_Controls_APIExample.OnRunExample(CreateBannedIp);
        this.apiGetAndUpdateBannedIp.RunExample      += new CMSAPIExamples_Controls_APIExample.OnRunExample(GetAndUpdateBannedIp);
        this.apiGetAndBulkUpdateBannedIps.RunExample += new CMSAPIExamples_Controls_APIExample.OnRunExample(GetAndBulkUpdateBannedIps);
        this.apiDeleteBannedIp.RunExample            += new CMSAPIExamples_Controls_APIExample.OnRunExample(DeleteBannedIp);
        this.apiCheckBannedIp.RunExample             += new CMSAPIExamples_Controls_APIExample.OnRunExample(CheckBannedIp);
    }
        public ActionResult ChangeProspectLO(int contactId, int newOwnerAccountId, string lid)
        {
            try
            {
                UserAccount loggedUser = null;
                if (HttpContext != null && HttpContext.Session != null && HttpContext.Session[SessionHelper.UserData] != null)
                {
                    loggedUser = ( UserAccount )HttpContext.Session[SessionHelper.UserData];
                }
                else
                {
                    // TODO: Handle if user don't have priviledges to see this log
                    throw new UnauthorizedAccessException("User is not authorized to access this method!");
                }

                var licenseExpiredClass   = "notdisplayed";
                var licenseExpiredMessage = String.Empty;

                var updated = ContactServiceFacade.UpdateContactOwner(contactId, newOwnerAccountId, loggedUser.UserAccountId);

                if (!updated || newOwnerAccountId == 0 || !WebCommonHelper.LicensingEnabled())
                {
                    return(Json(new
                    {
                        LicenseExpiredClass = licenseExpiredClass,
                        LicenseExpiredMessage = licenseExpiredMessage
                    }, JsonRequestBehavior.AllowGet));
                }

                Guid loanId;
                Guid.TryParse(lid, out loanId);

                // Check if concierge/branch is licensed
                var isUserStateLicensedForLoan = UserAccountServiceFacade.IsUserStateLicensedForLoan(newOwnerAccountId, loanId, contactId);

                licenseExpiredMessage = LicenseHelper.ConfigureLicenseExpiredMessage(licenseExpiredMessage, isUserStateLicensedForLoan);
                if (!String.IsNullOrEmpty(licenseExpiredMessage))
                {
                    licenseExpiredClass = "licenseExpiredNotification";
                }

                return(Json(new
                {
                    LicenseExpiredClass = licenseExpiredClass,
                    LicenseExpiredMessage = licenseExpiredMessage
                }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                TraceHelper.Error(TraceCategory.Global, "LoanController::ChangeProspectLO", ex);
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #18
0
        public void PopulateMetadata(
            IBaseMetadataDocument document,
            string packageId,
            Package package)
        {
            document.Authors               = package.FlattenedAuthors;
            document.Copyright             = package.Copyright;
            document.Created               = AssumeUtc(package.Created);
            document.Description           = package.Description;
            document.FileSize              = package.PackageFileSize;
            document.FlattenedDependencies = package.FlattenedDependencies;
            document.Hash                      = package.Hash;
            document.HashAlgorithm             = package.HashAlgorithm;
            document.Language                  = package.Language;
            document.LastEdited                = AssumeUtc(package.LastEdited);
            document.MinClientVersion          = package.MinClientVersion;
            document.NormalizedVersion         = package.NormalizedVersion;
            document.OriginalVersion           = package.Version;
            document.PackageId                 = packageId;
            document.Prerelease                = package.IsPrerelease;
            document.ProjectUrl                = package.ProjectUrl;
            document.Published                 = package.Listed ? AssumeUtc(package.Published) : UnlistedPublished;
            document.ReleaseNotes              = package.ReleaseNotes;
            document.RequiresLicenseAcceptance = package.RequiresLicenseAcceptance;
            document.SemVerLevel               = package.SemVerLevelKey;
            document.SortableTitle             = GetSortableTitle(package.Title, packageId);
            document.Summary                   = package.Summary;
            document.Tags                      = package.Tags == null ? null : Utils.SplitTags(package.Tags);
            document.Title                     = GetTitle(package.Title, packageId);
            document.TokenizedPackageId        = packageId;

            if (package.LicenseExpression != null || package.EmbeddedLicenseType != EmbeddedLicenseFileType.Absent)
            {
                document.LicenseUrl = LicenseHelper.GetGalleryLicenseUrl(
                    packageId,
                    package.NormalizedVersion,
                    _options.Value.ParseGalleryBaseUrl());
            }
            else
            {
                document.LicenseUrl = package.LicenseUrl;
            }

            if (package.HasEmbeddedIcon ||
                (!string.IsNullOrWhiteSpace(package.IconUrl) && _options.Value.AllIconsInFlatContainer))
            {
                SetIconUrlFromFlatContainer(document);
            }
            else
            {
                document.IconUrl = package.IconUrl;
            }
        }
Beispiel #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check license
        LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);

        // Friend
        apiRequestFriendship.RunExample       += new CMSAPIExamples_Controls_APIExample.OnRunExample(RequestFriendship);
        apiApproveFriendship.RunExample       += new CMSAPIExamples_Controls_APIExample.OnRunExample(ApproveFriendship);
        apiRejectFriendship.RunExample        += new CMSAPIExamples_Controls_APIExample.OnRunExample(RejectFriendship);
        apiGetAndBulkUpdateFriends.RunExample += new CMSAPIExamples_Controls_APIExample.OnRunExample(GetAndBulkUpdateFriends);
        apiDeleteFriends.RunExample           += new CMSAPIExamples_Controls_APIExample.OnRunExample(DeleteFriends);
    }
 private static string GetEditionName(string editionChar)
 {
     try
     {
         ProductEditionEnum edition = editionChar.ToEnum <ProductEditionEnum>();
         return(LicenseHelper.GetEditionName(edition));
     }
     catch
     {
         return("#UNKNOWN#");
     }
 }
        public void PopulateMetadata(
            IBaseMetadataDocument document,
            string normalizedVersion,
            PackageDetailsCatalogLeaf leaf)
        {
            document.Authors               = leaf.Authors;
            document.Copyright             = leaf.Copyright;
            document.Created               = leaf.Created;
            document.Description           = leaf.Description;
            document.FileSize              = leaf.PackageSize;
            document.FlattenedDependencies = GetFlattenedDependencies(leaf);
            document.Hash                      = leaf.PackageHash;
            document.HashAlgorithm             = leaf.PackageHashAlgorithm;
            document.Language                  = leaf.Language;
            document.LastEdited                = leaf.LastEdited;
            document.MinClientVersion          = leaf.MinClientVersion;
            document.NormalizedVersion         = normalizedVersion;
            document.OriginalVersion           = leaf.VerbatimVersion;
            document.PackageId                 = leaf.PackageId;
            document.Prerelease                = leaf.IsPrerelease;
            document.ProjectUrl                = leaf.ProjectUrl;
            document.Published                 = leaf.Published;
            document.ReleaseNotes              = leaf.ReleaseNotes;
            document.RequiresLicenseAcceptance = leaf.RequireLicenseAcceptance;
            document.SemVerLevel               = leaf.IsSemVer2() ? SemVerLevelKey.SemVer2 : SemVerLevelKey.Unknown;
            document.SortableTitle             = GetSortableTitle(leaf.Title, leaf.PackageId);
            document.Summary                   = leaf.Summary;
            document.Tags                      = leaf.Tags == null ? null : leaf.Tags.ToArray();
            document.Title                     = GetTitle(leaf.Title, leaf.PackageId);
            document.TokenizedPackageId        = leaf.PackageId;

            if (leaf.LicenseExpression != null || leaf.LicenseFile != null)
            {
                document.LicenseUrl = LicenseHelper.GetGalleryLicenseUrl(
                    document.PackageId,
                    normalizedVersion,
                    _options.Value.ParseGalleryBaseUrl());
            }
            else
            {
                document.LicenseUrl = leaf.LicenseUrl;
            }

            if (leaf.IconFile != null ||
                (!string.IsNullOrWhiteSpace(leaf.IconUrl) && _options.Value.AllIconsInFlatContainer))
            {
                SetIconUrlFromFlatContainer(document);
            }
            else
            {
                document.IconUrl = leaf.IconUrl;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Setup page title text and image
        CurrentMaster.Title.TitleText  = GetString("Licenses_License_List.Title");
        CurrentMaster.Title.TitleImage = GetImageUrl("Objects/CMS_LicenseKey/object.png");

        CurrentMaster.Title.HelpTopicName = "licenses_list";
        CurrentMaster.Title.HelpName      = "helpTopic";

        // Prepare the new class header element
        string[,] actions = new string[3, 8];
        actions[0, 0]     = "HyperLink";
        actions[0, 1]     = GetString("Licenses_License_List.New");
        actions[0, 3]     = "~/CMSModules/Licenses/Pages/License_New.aspx";
        actions[0, 5]     = GetImageUrl("Objects/CMS_LicenseKey/add.png");
        actions[1, 0]     = "HyperLink";
        actions[1, 1]     = GetString("license.list.export");
        actions[1, 3]     = "~/CMSModules/Licenses/Pages/License_Export_Domains.aspx";
        actions[1, 5]     = GetImageUrl("Objects/CMS_LicenseKey/export.png");

        // Not supported in 5.0 final
        //actions[2, 1] = GetString("license.list.import");
        //actions[2, 3] = "~/CMSModules/Licenses/Pages/License_Import_Licenses.aspx";
        //actions[2, 5] = GetImageUrl("Objects/CMS_LicenseKey/import.png");

        CurrentMaster.HeaderActions.Actions = actions;

        UniGridLicenses.GridView.PageSize    = 20;
        UniGridLicenses.OnAction            += new OnActionEventHandler(UniGridLicenses_OnAction);
        UniGridLicenses.OnExternalDataBound += new OnExternalDataBoundEventHandler(UniGridLicenses_OnExternalDataBound);
        UniGridLicenses.ZeroRowsText         = GetString("general.nodatafound");

        // Check if valid license for current domain exists
        LicenseValidationEnum validationResult = LicenseHelper.ValidateLicenseForDomain(URLHelper.GetCurrentDomain());

        if (validationResult != LicenseValidationEnum.Valid)
        {
            // Build invalid license string
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0} <strong>{1}</strong><br /><br />", GetString("InvalidLicense.Result"), LicenseHelper.GetValidationResultString(validationResult))
            .AppendFormat("<strong>{0}</strong><br /><ul>", GetString("invalidlicense.howto"))
            .AppendFormat("<li>{0} ", GetString("invalidlicense.howto.option1.firstpart"))
            .AppendFormat("<a target=\"_blank\" href=\"{0}\" title=\"{1}\">{2}</a>", CLIENT_PORTAL, CLIENT_PORTAL, GetString("invalidlicense.clientportal"))
            .AppendFormat("{0}</li>", GetString("invalidlicense.howto.option1.secondpart"))
            .AppendFormat("<li>{0} <a href=\"mailto:{1}\">{2}</a>.</li>", GetString("invalidlicense.howto.option2"), SUPPORT_MAIL, SUPPORT_MAIL)
            .AppendFormat("<li>{0} ", GetString("invalidlicense.howto.option3.firstpart"))
            .AppendFormat("<a target=\"_blank\" href=\"{0}\" title=\"{1}\">{2}</a>", CLIENT_PORTAL, CLIENT_PORTAL, GetString("invalidlicense.clientportal"))
            .AppendFormat("{0}</li></ul>", GetString("invalidlicense.howto.option3.secondpart"));

            ShowWarning(GetString("invalidlicense.currentdomain"), sb.ToString(), null);
        }
    }
Beispiel #23
0
        public CategoryPage()
        {
            InitializeComponent();

            if (LicenseHelper.Purchased(AppConfig.PAID_VERSION))
            {
                adControl.Visibility = System.Windows.Visibility.Collapsed;
            }
            else
            {
                adControl.Visibility = System.Windows.Visibility.Visible;
            }
        }
Beispiel #24
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        // Check license limitations
        if (!CultureInfoProvider.LicenseVersionCheck())
        {
            LicenseHelper.GetAllAvailableKeys(FeatureEnum.Multilingual);
        }

        // Set selected tab
        UIContext.PropertyTab = PropertyTabEnum.Languages;
    }
Beispiel #25
0
    protected void Page_Init(object sender, EventArgs e)
    {
        // Check the license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.ObjectVersioning);
        }

        if (!QueryHelper.ValidateHash("hash"))
        {
            RedirectToAccessDenied(ResHelper.GetString("dialogs.badhashtitle"));
        }
    }
Beispiel #26
0
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        if (!LicenseHelper.CheckFeature(RequestContext.CurrentDomain, FeatureEnum.Membership))
        {
            StopProcessing = true;
            return;
        }

        TryInitByForm();
        InitSelector();
    }
Beispiel #27
0
        public RegisterViewModel()
        {
            LoaddingWindow win       = new LoaddingWindow();
            Action         initilize = () =>
            {
                this.SerialNumber = Settings.Default.SerialNumber;
                this.Registered   = LicenseHelper.ValidateLicense(Resources.ProductId, this.SerialNumber, Resources.PubKey);
                this.UIDispatcher.Invoke(new Action(() => win.Close()), null);
            };

            initilize.BeginInvoke(ar => initilize.EndInvoke(ar as IAsyncResult), initilize);
            win.ShowDialog();
        }
    /// <summary>
    /// Page load.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.WindowsLiveID);

        siteName = SiteContext.CurrentSiteName;
        // Site name must be set
        if (string.IsNullOrEmpty(siteName))
        {
            return;
        }

        ProcessLiveIDLogin();
    }
Beispiel #29
0
    /// <summary>
    /// Initializes menu.
    /// </summary>
    protected void InitalizeMenu()
    {
        bool dbseparationAvailable = LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.DBSeparation);

        string[,] tabs;
        if (dbseparationAvailable)
        {
            tabs = new string[7, 4];
        }
        else
        {
            tabs = new string[6, 4];
        }

        tabs[0, 0] = GetString("general.general");
        tabs[0, 1] = "SetHelpTopic('helpTopic', 'general_tab10');";
        tabs[0, 2] = "System.aspx";

        tabs[1, 0] = GetString("general.email");
        tabs[1, 1] = "SetHelpTopic('helpTopic', 'email_tab');";
        tabs[1, 2] = "System_Email.aspx";

        tabs[2, 0] = GetString("Administration-System.Files");
        tabs[2, 1] = "SetHelpTopic('helpTopic', 'files_tab');";
        tabs[2, 2] = "Files/System_FilesFrameset.aspx";

        tabs[3, 0] = GetString("Administration-System.Deployment");
        tabs[3, 1] = "SetHelpTopic('helpTopic', 'virtualobjects_tab');";
        tabs[3, 2] = "System_Deployment.aspx";

        // Debug tab
        tabs[4, 0] = GetString("Administration-System.Debug");
        tabs[4, 1] = "SetHelpTopic('helpTopic', 'debug_tab');";
        tabs[4, 2] = "Debug/System_DebugFrameset.aspx";

        // DB separation
        if (dbseparationAvailable)
        {
            tabs[5, 0] = GetString("separationDB.tabtitle");
            tabs[5, 1] = "SetHelpTopic('helpTopic', 'separationDB_tab');";
            tabs[5, 2] = "System_DBseparation.aspx";
        }

        // Macros tab
        //tabs[6, 0] = GetString("Administration-System.Macros");
        //tabs[6, 1] = "SetHelpTopic('helpTopic', 'macros_tab');";
        //tabs[6, 2] = "System_Macros.aspx";

        CurrentMaster.Tabs.UrlTarget = "systemContent";
        CurrentMaster.Tabs.Tabs      = tabs;
    }
Beispiel #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get data from parameters
        siteId         = QueryHelper.GetInteger("siteid", 0);
        currentCulture = QueryHelper.GetString("culture", "");

        // Strings and images
        this.btnOk.Text     = GetString("General.Ok");
        this.btnCancel.Text = GetString("General.Cancel");

        this.lblNewCulture.Text = GetString("SiteDefaultCultureChange.NewCulture");
        this.chkDocuments.Text  = GetString("SiteDefaultCultureChange.Documents");

        CurrentMaster.Title.TitleText  = GetString("SiteDefaultCultureChange.Title");
        CurrentMaster.Title.TitleImage = GetImageUrl("CMSModules/CMS_Sites/changeculture.png");

        SiteInfo si = SiteInfoProvider.GetSiteInfo(siteId);

        if (si != null)
        {
            // Check licensing policy
            if (LicenseHelper.CheckFeature(URLHelper.GetDomainName(si.DomainName), FeatureEnum.Multilingual))
            {
                // Get only site cultures
                this.cultureSelector.SiteID = siteId;
            }
            else
            {
                // Get all cultures for non multilingual
                cultureSelector.DisplayAllCultures = true;

                // Have to change culture of documents
                chkDocuments.Enabled = false;
            }

            // Check version limitations
            if (!CultureInfoProvider.LicenseVersionCheck(si.DomainName, FeatureEnum.Multilingual, VersionActionEnum.Edit))
            {
                lblError.Text    = GetString("licenselimitation.siteculturesexceeded");
                lblError.Visible = true;
                pnlForm.Enabled  = false;
            }


            currentCulture = CultureHelper.GetDefaultCulture(si.SiteName);
            if (!URLHelper.IsPostback())
            {
                this.cultureSelector.Value = currentCulture;
            }
        }
    }
Beispiel #31
0
    /// <summary>
    /// Extender initialization.
    /// </summary>
    public override void OnInit()
    {
        // Register javascript to reload application
        ScriptHelper.RegisterModule(Control, "CMS/Licenses", QueryHelper.GetBoolean("reload", false));

        Control.GridView.PageSize    = 20;
        Control.OnAction            += Control_OnAction;
        Control.OnExternalDataBound += Control_OnExternalDataBound;
        Control.ZeroRowsText         = ResHelper.GetString("general.nodatafound");

        // Add extra header actions
        ICMSPage page = Control.Page as ICMSPage;

        if (page != null)
        {
            var newAction = new HeaderAction
            {
                Text        = ResHelper.GetString("license.list.export"),
                RedirectUrl = "~/CMSModules/Licenses/Pages/License_Export_Domains.aspx",
            };

            page.HeaderActions.InsertAction(1, newAction);
        }

        // Check if valid license for current domain exists
        var validationResult = LicenseHelper.ValidateLicenseForDomain(RequestContext.CurrentDomain);

        if (validationResult != LicenseValidationEnum.Valid)
        {
            // Build invalid license string
            var sb = new StringBuilder();
            sb.AppendFormat("{0} {1} <strong>{2}</strong><br /><br />", GetString("invalidlicense.currentdomain"), GetString("InvalidLicense.Result"), LicenseHelper.GetValidationResultString(validationResult))
            .AppendFormat("<strong>{0}</strong><br /><ul>", GetString("invalidlicense.howto"))
            .AppendFormat("<li>{0} ", GetString("invalidlicense.howto.option1.firstpart"))
            .AppendFormat("<a target=\"_blank\" href=\"{0}\" title=\"{1}\">{2}</a>", CLIENT_PORTAL, CLIENT_PORTAL, GetString("invalidlicense.clientportal"))
            .AppendFormat("{0}</li>", GetString("invalidlicense.howto.option1.secondpart"))
            .AppendFormat("<li>{0} <a href=\"mailto:{1}\">{2}</a>.</li>", GetString("invalidlicense.howto.option2"), SUPPORT_MAIL, SUPPORT_MAIL)
            .AppendFormat("<li>{0} ", GetString("invalidlicense.howto.option3.firstpart"))
            .AppendFormat("<a target=\"_blank\" href=\"{0}\" title=\"{1}\">{2}</a>", CLIENT_PORTAL, CLIENT_PORTAL, GetString("invalidlicense.clientportal"))
            .AppendFormat("{0}</li>", GetString("invalidlicense.howto.option3.secondpart"));

            if (validationResult == LicenseValidationEnum.Expired)
            {
                sb.Append("<li>" + GetString("invalidlicense.trialexpired") + "</li>");
            }

            sb.Append("</ul>");

            Control.ShowInformation(sb.ToString());
        }
    }
    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);

        mode = QueryHelper.GetString("mode", string.Empty);
        if (mode.ToLowerCSafe() == "productssection")
        {
            string url = ResolveUrl("~/CMSModules/Content/CMSDesk/Edit/Edit.aspx" + RequestContext.CurrentQueryString);
            URLHelper.Redirect(url);
        }

        // Do not use content class in dialog mode
        UseDialogContentClass = false;

        DocumentManager.OnValidateData += DocumentManager_OnValidateData;
        DocumentManager.OnSaveData     += DocumentManager_OnSaveData;

        DocumentManager.Mode               = FormModeEnum.Insert;
        DocumentManager.ParentNodeID       = QueryHelper.GetInteger("parentnodeid", 0);
        DocumentManager.NewNodeCultureCode = QueryHelper.GetString("parentculture", null);
        DocumentManager.NewNodeClassID     = QueryHelper.GetInteger("classId", 0);

        // Set up the document conversion
        int convertDocumentId = QueryHelper.GetInteger("convertdocumentid", 0);

        if (convertDocumentId > 0)
        {
            DocumentManager.SourceDocumentID = convertDocumentId;
            DocumentManager.Mode             = FormModeEnum.Convert;
        }

        // Load proper class name
        DataClassInfo dci = NewNodeClass;

        if (dci != null)
        {
            pageClassName = dci.ClassName;
        }

        // Check if user is allowed to create page under this node
        if (!MembershipContext.AuthenticatedUser.IsAuthorizedToCreateNewDocument(DocumentManager.ParentNodeID, pageClassName))
        {
            RedirectToAccessDenied(GetString("cmsdesk.notauthorizedtocreatedocument"));
        }

        // Check license limitations
        if (!LicenseHelper.LicenseVersionCheck(RequestContext.CurrentDomain, FeatureEnum.Documents, ObjectActionEnum.Insert))
        {
            RedirectToAccessDenied(String.Format(GetString("cmsdesk.documentslicenselimits"), string.Empty));
        }
    }
 public LicenseServiceTestManager(LicenseHelper licenseHelper)
 {
     _licenseHelper = licenseHelper;
 }
Beispiel #34
0
			public void After_all_tests()
			{
				_serviceTestManager.Stop();

				_licenseHelper = null;
			}