From 9a729e2547a89304b3f833976c4c614cacff366c Mon Sep 17 00:00:00 2001 From: Frederico Mazzone Date: Fri, 20 May 2016 13:01:51 +0100 Subject: [PATCH] [CP-17415] XC: Add awareness of new AD feature flag Added awareness; basic license now shows upsell tab and premium license shows full feature tab. Signed-off-by: Frederico Mazzone --- XenAdmin/MainWindow.Designer.cs | 9 ++++ XenAdmin/MainWindow.cs | 5 ++- XenAdmin/MainWindow.resx | 61 +++++++++++++++++++------- XenAdmin/TabPages/UpsellTabPage.cs | 19 +++++--- XenModel/InvisibleMessages.Designer.cs | 11 ++++- XenModel/InvisibleMessages.resx | 3 ++ XenModel/Messages.Designer.cs | 22 +++++++++- XenModel/Messages.resx | 8 ++++ XenModel/XenAPI-Extensions/Host.cs | 13 ++++++ 9 files changed, 126 insertions(+), 25 deletions(-) diff --git a/XenAdmin/MainWindow.Designer.cs b/XenAdmin/MainWindow.Designer.cs index 7b3a08bb1..321bf8050 100644 --- a/XenAdmin/MainWindow.Designer.cs +++ b/XenAdmin/MainWindow.Designer.cs @@ -280,6 +280,7 @@ namespace XenAdmin this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar(); + this.TabPageADUpsell = new System.Windows.Forms.TabPage(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -353,6 +354,7 @@ namespace XenAdmin this.TheTabControl.Controls.Add(this.TabPageWLB); this.TheTabControl.Controls.Add(this.TabPageWLBUpsell); this.TheTabControl.Controls.Add(this.TabPageAD); + this.TheTabControl.Controls.Add(this.TabPageADUpsell); this.TheTabControl.Controls.Add(this.TabPageGPU); this.TheTabControl.Controls.Add(this.TabPageSearch); this.TheTabControl.Controls.Add(this.TabPageDockerProcess); @@ -1837,6 +1839,12 @@ namespace XenAdmin this.statusProgressBar.Name = "statusProgressBar"; this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; // + // TabPageADUpsell + // + resources.ApplyResources(this.TabPageADUpsell, "TabPageADUpsell"); + this.TabPageADUpsell.Name = "TabPageADUpsell"; + this.TabPageADUpsell.UseVisualStyleBackColor = true; + // // MainWindow // resources.ApplyResources(this, "$this"); @@ -2098,6 +2106,7 @@ namespace XenAdmin private CommandToolStripButton resumeContainerToolStripButton; private CommandToolStripButton restartContainerToolStripButton; private CommandToolStripMenuItem healthCheckToolStripMenuItem1; + private TabPage TabPageADUpsell; } } diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 351d29571..683658bff 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -97,6 +97,7 @@ namespace XenAdmin internal readonly PhysicalStoragePage PhysicalStoragePage = new PhysicalStoragePage(); internal readonly VMStoragePage VMStoragePage = new VMStoragePage(); internal readonly AdPage AdPage = new AdPage(); + internal readonly ADUpsellPage AdUpsellPage = new ADUpsellPage(); internal readonly GpuPage GpuPage = new GpuPage(); internal readonly DockerProcessPage DockerProcessPage = new DockerProcessPage(); internal readonly DockerDetailsPage DockerDetailsPage = new DockerDetailsPage(); @@ -178,6 +179,7 @@ namespace XenAdmin AddTabContents(WLBUpsellPage, TabPageWLBUpsell); AddTabContents(PhysicalStoragePage, TabPagePhysicalStorage); AddTabContents(AdPage, TabPageAD); + AddTabContents(AdUpsellPage, TabPageADUpsell); AddTabContents(GpuPage, TabPageGPU); AddTabContents(SearchPage, TabPageSearch); AddTabContents(DockerProcessPage, TabPageDockerProcess); @@ -1359,6 +1361,7 @@ namespace XenAdmin bool dmc_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictDMC); bool ha_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictHA); bool wlb_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictWLB); + bool ad_upsell = Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictAD); bool is_connected = selectionConnection != null && selectionConnection.IsConnected; bool multi = SelectionManager.Selection.Count > 1; @@ -1408,7 +1411,7 @@ namespace XenAdmin if(!(SelectionManager.Selection.All(s => Helpers.IsClearwater(s.Connection)) || wlb_upsell )) ShowTab(TabPageWLB, !multi && !SearchMode && isPoolSelected); - ShowTab(TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive)); + ShowTab(ad_upsell ? TabPageADUpsell : TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive)); foreach (TabPageFeature f in pluginManager.GetAllFeatures(f => !f.IsConsoleReplacement && !multi && f.ShowTab)) ShowTab(f.TabPage, true); diff --git a/XenAdmin/MainWindow.resx b/XenAdmin/MainWindow.resx index 5942f7c19..b981e1cf4 100644 --- a/XenAdmin/MainWindow.resx +++ b/XenAdmin/MainWindow.resx @@ -684,6 +684,33 @@ 16 + + 4, 22 + + + 3, 3, 3, 3 + + + 753, 592 + + + 21 + + + Users + + + TabPageADUpsell + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TheTabControl + + + 17 + 4, 22 @@ -706,7 +733,7 @@ TheTabControl - 17 + 18 Fill @@ -736,7 +763,7 @@ TheTabControl - 18 + 19 4, 22 @@ -766,7 +793,7 @@ TheTabControl - 19 + 20 Fill @@ -796,7 +823,7 @@ TheTabControl - 20 + 21 Verdana, 8.25pt @@ -1699,13 +1726,13 @@ 163, 5 - 147, 22 + 146, 22 Show &Toolbar - 148, 26 + 147, 26 ToolBarContextMenu @@ -2523,7 +2550,7 @@ False - 195, 22 + 228, 22 Help &Contents @@ -2532,46 +2559,46 @@ F1 - 195, 22 + 228, 22 Conte&xt Help - 192, 6 + 225, 6 - 195, 22 + 228, 22 View [XenCenter] &Log Files - 192, 6 + 225, 6 - 195, 22 + 228, 22 [XenServer product] on the &Web - 195, 22 + 228, 22 [XenCenter] &Plugins online - 192, 6 + 225, 6 - 195, 22 + 228, 22 PluginItemsPlaceHolder - 195, 22 + 228, 22 &About [XenCenter] @@ -3794,4 +3821,4 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + \ No newline at end of file diff --git a/XenAdmin/TabPages/UpsellTabPage.cs b/XenAdmin/TabPages/UpsellTabPage.cs index d588761d0..cb191a528 100644 --- a/XenAdmin/TabPages/UpsellTabPage.cs +++ b/XenAdmin/TabPages/UpsellTabPage.cs @@ -52,26 +52,35 @@ namespace XenAdmin.TabPages } } + public class ADUpsellPage : UpsellTabPage + { + public ADUpsellPage() + : base(Messages.ACTIVE_DIRECTORY_TAB_TITLE, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_AD : + Messages.UPSELL_BLURB_AD + Messages.UPSELL_BLURB_AD_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_AD) + { } + } + public class BallooningUpsellPage : UpsellTabPage { public BallooningUpsellPage() - : base(Messages.DYNAMIC_MEMORY_CONTROL, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_DMC : Messages.UPSELL_BLURB_DMC + Messages.UPSELL_BLURB_DMC_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_DMC) + : base(Messages.DYNAMIC_MEMORY_CONTROL, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_DMC : + Messages.UPSELL_BLURB_DMC + Messages.UPSELL_BLURB_DMC_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_DMC) { } } public class HAUpsellPage : UpsellTabPage { public HAUpsellPage() - : base(Messages.HIGH_AVAILABILITY, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_HA : Messages.UPSELL_BLURB_HA + Messages.UPSELL_BLURB_HA_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_HA) + : base(Messages.HIGH_AVAILABILITY, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_HA : + Messages.UPSELL_BLURB_HA + Messages.UPSELL_BLURB_HA_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_HA) { } } public class WLBUpsellPage : UpsellTabPage { public WLBUpsellPage() - : base(Messages.WORKLOAD_BALANCING, - HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_WLB : Messages.UPSELL_BLURB_WLB + Messages.UPSELL_BLURB_WLB_MORE, - InvisibleMessages.UPSELL_LEARNMOREURL_WLB) + : base(Messages.WORKLOAD_BALANCING, HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_WLB : + Messages.UPSELL_BLURB_WLB + Messages.UPSELL_BLURB_WLB_MORE, InvisibleMessages.UPSELL_LEARNMOREURL_WLB) { } } } diff --git a/XenModel/InvisibleMessages.Designer.cs b/XenModel/InvisibleMessages.Designer.cs index 27c2a112f..2cd11945e 100644 --- a/XenModel/InvisibleMessages.Designer.cs +++ b/XenModel/InvisibleMessages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -258,6 +258,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/ad. + /// + public static string UPSELL_LEARNMOREURL_AD { + get { + return ResourceManager.GetString("UPSELL_LEARNMOREURL_AD", resourceCulture); + } + } + /// /// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/alerts. /// diff --git a/XenModel/InvisibleMessages.resx b/XenModel/InvisibleMessages.resx index 442e463d4..2081b8576 100644 --- a/XenModel/InvisibleMessages.resx +++ b/XenModel/InvisibleMessages.resx @@ -246,4 +246,7 @@ http://updates.xensource.com/XenServer/updates.xml + + http://www.citrix.com/xenserver/le/features/ad + \ No newline at end of file diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 9c32858c1..687f58fe0 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -33147,6 +33147,26 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Upgrade your [XenServer] license to enable Active Directory. Active Directory allows you to configure [XenServer] access control by adding named user accounts.. + /// + public static string UPSELL_BLURB_AD { + get { + return ResourceManager.GetString("UPSELL_BLURB_AD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// + ///To learn more about the [XenServer] Active Directory feature or to start a [XenServer] trial, click the button below.. + /// + public static string UPSELL_BLURB_AD_MORE { + get { + return ResourceManager.GetString("UPSELL_BLURB_AD_MORE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Upgrade your [XenServer] license to enable Alerting and Reporting capabilities. Email based performance and error alerting will proactively notify administrators of error conditions or performance problems before they affect critical services.. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index fd8f4e02b..5a5270c67 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -11491,6 +11491,14 @@ Note that if RBAC is enabled, only updates which you have privileges to dismiss Uploaded + + Upgrade your [XenServer] license to enable Active Directory. Active Directory allows you to configure [XenServer] access control by adding named user accounts. + + + + +To learn more about the [XenServer] Active Directory feature or to start a [XenServer] trial, click the button below. + Upgrade your [XenServer] license to enable Alerting and Reporting capabilities. Email based performance and error alerting will proactively notify administrators of error conditions or performance problems before they affect critical services. diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 060398d6e..d279dab33 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -456,6 +456,19 @@ namespace XenAPI return h._RestrictIntraPoolMigrate; } + /// + /// Active directory is restricted only if the "restrict_ad" key exists and it is true + /// + private bool _RestrictAD + { + get { return BoolKey(license_params, "restrict_ad"); } + } + + public static bool RestrictAD(Host h) + { + return h._RestrictAD; + } + private bool _RestrictReadCaching { get { return BoolKeyPreferTrue(license_params, "restrict_read_caching"); }