From 4a1ca0fbdf7ec45e073f52fe263a538a0a96cd8e Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Fri, 22 May 2026 14:18:15 +0200 Subject: [PATCH 01/26] Introduction of settings necessary for an MVC Pipeline --- .../Portals/IPortalSettings.cs | 3 + .../Portals/PagePipelineConstants.cs | 30 ++ DNN Platform/Library/Data/DataProvider.cs | 10 +- .../Library/Entities/Modules/ControlInfo.cs | 9 + .../Modules/ModuleControlController.cs | 2 + .../Library/Entities/Modules/ModuleInfo.cs | 5 + .../Portals/IPortalSettingsController.cs | 2 + .../Entities/Portals/PortalSettings.cs | 3 + .../Portals/PortalSettingsController.cs | 16 +- DNN Platform/Library/Entities/Tabs/TabInfo.cs | 25 ++ .../Installer/Writers/ModulePackageWriter.cs | 2 +- .../Library/Services/Upgrade/Upgrade.cs | 13 +- .../SqlDataProvider/10.99.00.SqlDataProvider | 129 +++++++++ .../Controls/ControlFields.jsx | 7 + .../Pages.Web/src/components/More/More.jsx | 34 +++ .../Pages.Web/src/services/pageService.js | 1 + .../src/components/moreSettings/index.jsx | 27 ++ .../Dto/Editors/ModuleControlDto.cs | 11 +- .../Components/Pages/Converters.cs | 262 +++++++++--------- .../Components/Pages/PagesControllerImpl.cs | 4 + .../Services/DTO/PageItem.cs | 17 +- .../Services/DTO/PageSettings.cs | 55 ++-- .../UpdateOtherSettingsRequest.cs | 24 +- .../Services/SiteSettingsController.cs | 2 + .../App_LocalResources/Extensions.resx | 6 + .../Dnn.Pages/App_LocalResources/Pages.resx | 18 ++ .../App_LocalResources/SiteSettings.resx | 18 ++ 27 files changed, 549 insertions(+), 186 deletions(-) create mode 100644 DNN Platform/DotNetNuke.Abstractions/Portals/PagePipelineConstants.cs create mode 100644 DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 7b18617461b..440e677de0b 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -359,5 +359,8 @@ public interface IPortalSettings /// Gets a value indicating whether to display the dropdowns to quickly add a moduel to the page in the edit bar. bool ShowQuickModuleAddMenu { get; } + + /// Gets the pipeline type for the portal. + string PagePipeline { get; } } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/PagePipelineConstants.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/PagePipelineConstants.cs new file mode 100644 index 00000000000..37e51a1f20c --- /dev/null +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/PagePipelineConstants.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information +namespace DotNetNuke.Abstractions.Portals +{ + /// + /// Provides constants for the page pipelines used in the DNN platform, + /// such as WebForms and MVC. + /// + public static class PagePipelineConstants + { + /// WebForms. + public const string WebForms = "webforms"; + + /// MVC. + public const string Mvc = "mvc"; + + /// Auto. + public const string Auto = "auto"; + + /// QueryString key. + public const string QueryStringKey = "pipeline"; + + /// QueryString WebForms. + public const string QueryStringWebForms = "webforms"; + + /// QueryString MVC. + public const string QueryStringMvc = "mvc"; + } +} diff --git a/DNN Platform/Library/Data/DataProvider.cs b/DNN Platform/Library/Data/DataProvider.cs index dea87b3dad4..d89957d4e69 100644 --- a/DNN Platform/Library/Data/DataProvider.cs +++ b/DNN Platform/Library/Data/DataProvider.cs @@ -1329,7 +1329,13 @@ public virtual void UpdateModuleDefinition(int moduleDefId, string friendlyName, lastModifiedByUserID); } + [Obsolete("Deprecated in DotNetNuke 10.99.0. Scheduled removal in v12.0.0.")] public virtual int AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, int controlType, int viewOrder, string helpUrl, bool supportsPartialRendering, bool supportsPopUps, int createdByUserID) + { + return this.AddModuleControl(moduleDefId, controlKey, controlTitle, controlSrc, null, iconFile, controlType, viewOrder, helpUrl, supportsPartialRendering, supportsPopUps, createdByUserID); + } + + public virtual int AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string mvcControlClass, string iconFile, int controlType, int viewOrder, string helpUrl, bool supportsPartialRendering, bool supportsPopUps, int createdByUserID) { return this.ExecuteScalar( "AddModuleControl", @@ -1337,6 +1343,7 @@ public virtual int AddModuleControl(int moduleDefId, string controlKey, string c this.GetNull(controlKey), this.GetNull(controlTitle), controlSrc, + this.GetNull(mvcControlClass), this.GetNull(iconFile), controlType, this.GetNull(viewOrder), @@ -1356,7 +1363,7 @@ public virtual IDataReader GetModuleControls() return this.ExecuteReader("GetModuleControls"); } - public virtual void UpdateModuleControl(int moduleControlId, int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, int controlType, int viewOrder, string helpUrl, bool supportsPartialRendering, bool supportsPopUps, int lastModifiedByUserID) + public virtual void UpdateModuleControl(int moduleControlId, int moduleDefId, string controlKey, string controlTitle, string controlSrc, string mvcControlClass, string iconFile, int controlType, int viewOrder, string helpUrl, bool supportsPartialRendering, bool supportsPopUps, int lastModifiedByUserID) { this.ExecuteNonQuery( "UpdateModuleControl", @@ -1365,6 +1372,7 @@ public virtual void UpdateModuleControl(int moduleControlId, int moduleDefId, st this.GetNull(controlKey), this.GetNull(controlTitle), controlSrc, + this.GetNull(mvcControlClass), this.GetNull(iconFile), controlType, this.GetNull(viewOrder), diff --git a/DNN Platform/Library/Entities/Modules/ControlInfo.cs b/DNN Platform/Library/Entities/Modules/ControlInfo.cs index 6f6e3d17c25..d435410a479 100644 --- a/DNN Platform/Library/Entities/Modules/ControlInfo.cs +++ b/DNN Platform/Library/Entities/Modules/ControlInfo.cs @@ -27,6 +27,10 @@ protected ControlInfo() /// A String. public string ControlSrc { get; set; } + /// Gets or sets the Mvc Control Class. + /// A String. + public string MvcControlClass { get; set; } + /// /// Gets or sets a value indicating whether the control support the AJAX /// Update Panel. @@ -42,6 +46,7 @@ protected override void FillInternal(IDataReader dr) base.FillInternal(dr); this.ControlKey = Null.SetNullString(dr["ControlKey"]); this.ControlSrc = Null.SetNullString(dr["ControlSrc"]); + this.MvcControlClass = Null.SetNullString(dr["MvcControlClass"]); this.SupportsPartialRendering = Null.SetNullBoolean(dr["SupportsPartialRendering"]); } @@ -55,6 +60,9 @@ protected void ReadXmlInternal(XmlReader reader) case "controlSrc": this.ControlSrc = reader.ReadElementContentAsString(); break; + case "mvcControlClass": + this.MvcControlClass = reader.ReadElementContentAsString(); + break; case "supportsPartialRendering": string elementvalue = reader.ReadElementContentAsString(); if (!string.IsNullOrEmpty(elementvalue)) @@ -71,6 +79,7 @@ protected void WriteXmlInternal(XmlWriter writer) // write out properties writer.WriteElementString("controlKey", this.ControlKey); writer.WriteElementString("controlSrc", this.ControlSrc); + writer.WriteElementString("mvcControlClass", this.MvcControlClass); writer.WriteElementString("supportsPartialRendering", this.SupportsPartialRendering.ToString()); } } diff --git a/DNN Platform/Library/Entities/Modules/ModuleControlController.cs b/DNN Platform/Library/Entities/Modules/ModuleControlController.cs index ed36766881d..beefc2d8bc3 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleControlController.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleControlController.cs @@ -110,6 +110,7 @@ public static int SaveModuleControl(ModuleControlInfo moduleControl, bool clearC moduleControl.ControlKey, moduleControl.ControlTitle, moduleControl.ControlSrc, + moduleControl.MvcControlClass, moduleControl.IconFile, (int)moduleControl.ControlType, moduleControl.ViewOrder, @@ -127,6 +128,7 @@ public static int SaveModuleControl(ModuleControlInfo moduleControl, bool clearC moduleControl.ControlKey, moduleControl.ControlTitle, moduleControl.ControlSrc, + moduleControl.MvcControlClass, moduleControl.IconFile, (int)moduleControl.ControlType, moduleControl.ViewOrder, diff --git a/DNN Platform/Library/Entities/Modules/ModuleInfo.cs b/DNN Platform/Library/Entities/Modules/ModuleInfo.cs index 271995d0c2e..04d905ba243 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleInfo.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleInfo.cs @@ -839,6 +839,11 @@ public string GetProperty(string propertyName, string format, CultureInfo format propertyNotFound = false; result = PropertyAccess.FormatString(this.ModuleControl.ControlSrc, format); break; + case "mvcControlClass": + isPublic = false; + propertyNotFound = false; + result = PropertyAccess.FormatString(this.ModuleControl.MvcControlClass, format); + break; case "controltitle": propertyNotFound = false; result = PropertyAccess.FormatString(this.ModuleControl.ControlTitle, format); diff --git a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs index 177f3bda2dd..0f6245f813f 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs @@ -14,6 +14,8 @@ public interface IPortalSettingsController PortalSettings.PortalAliasMapping GetPortalAliasMappingMode(int portalId); + string GetPortalPagePipeline(int portalId); + /// The GetActiveTab method gets the active Tab for the current request. /// The current tab's id. /// The current PortalSettings. diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index 1886fb6ccb9..d09ff030c22 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -554,6 +554,9 @@ public string AddCompatibleHttpHeader /// public bool ShowQuickModuleAddMenu => PortalController.GetPortalSettingAsBoolean("ShowQuickModuleAddMenu", this.PortalId, false); + /// + public string PagePipeline { get; internal set; } + /// Create an instance. /// A new instance. public static IPortalSettings Create() diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs index 8ca8cb228b9..974c4789393 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs @@ -12,6 +12,7 @@ namespace DotNetNuke.Entities.Portals using System.Linq; using DotNetNuke.Abstractions.Application; + using DotNetNuke.Abstractions.Portals; using DotNetNuke.Collections; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -125,7 +126,18 @@ public virtual PortalSettings.PortalAliasMapping GetPortalAliasMappingMode(int p return aliasMapping; } - /// + /// + public virtual string GetPortalPagePipeline(int portalId) + { + if (PortalController.Instance.GetPortalSettings(portalId).TryGetValue("PagePipeline", out var setting)) + { + return string.IsNullOrEmpty(setting) ? PagePipelineConstants.WebForms : setting; + } + + return PagePipelineConstants.WebForms; + } + + /// public virtual IList GetTabModules(PortalSettings portalSettings) { return portalSettings.ActiveTab.Modules.Cast().Select(m => m).ToList(); @@ -280,7 +292,7 @@ public virtual void LoadPortalSettings(PortalSettings portalSettings) portalSettings.DataConsentDelayMeasurement = setting; setting = settings.GetValueOrDefault("AllowedExtensionsWhitelist", this.hostSettingsService.GetString("DefaultEndUserExtensionWhitelist")); portalSettings.AllowedExtensionsWhitelist = new FileExtensionWhitelist(setting); - + portalSettings.PagePipeline = settings.GetValueOrDefault("PagePipeline", "webforms"); setting = settings.GetValueOrDefault("CspHeaderMode", "OFF"); switch (setting.ToUpperInvariant()) { diff --git a/DNN Platform/Library/Entities/Tabs/TabInfo.cs b/DNN Platform/Library/Entities/Tabs/TabInfo.cs index 72bd06b0763..b09eb0a8e45 100644 --- a/DNN Platform/Library/Entities/Tabs/TabInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabInfo.cs @@ -699,6 +699,27 @@ public string SkinDoctype [JsonIgnore] public bool UseBaseFriendlyUrls { get; set; } + /// Gets a value indicating the pipeline type. + [XmlIgnore] + [JsonIgnore] + public string PagePipeline + { + get + { + string pagePipeline; + if (this.TabSettings.ContainsKey("PagePipeline") && !string.IsNullOrEmpty(this.TabSettings["PagePipeline"].ToString())) + { + pagePipeline = this.TabSettings["PagePipeline"].ToString(); + } + else + { + pagePipeline = string.Empty; + } + + return pagePipeline; + } + } + /// [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", Justification = "Breaking change")] public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound) @@ -855,6 +876,10 @@ public string GetProperty(string propertyName, string format, CultureInfo format propertyNotFound = false; result = PropertyAccess.FormatString(this.SiteMapPriority.ToString(formatProvider), format); break; + case "pagepipeline": + propertyNotFound = false; + result = PropertyAccess.FormatString(this.PagePipeline, format); + break; } if (!isPublic && currentScope != Scope.Debug) diff --git a/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs index 4cef70e114c..925c8cfccd0 100644 --- a/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs @@ -138,7 +138,7 @@ private static void ProcessControls(XPathNavigator controlNav, string moduleFold controlSrc = controlSrc.Replace('\\', '/'); moduleControl.ControlSrc = controlSrc; - + moduleControl.MvcControlClass = Util.ReadElement(controlNav, "mvcControlClass"); moduleControl.IconFile = Util.ReadElement(controlNav, "iconfile"); string controlType = Util.ReadElement(controlNav, "type"); diff --git a/DNN Platform/Library/Services/Upgrade/Upgrade.cs b/DNN Platform/Library/Services/Upgrade/Upgrade.cs index ccabbbc129b..59bf09ab036 100644 --- a/DNN Platform/Library/Services/Upgrade/Upgrade.cs +++ b/DNN Platform/Library/Services/Upgrade/Upgrade.cs @@ -238,13 +238,14 @@ public static TabInfo AddHostPage(string tabName, string description, string tab /// The key for this control in the Definition. /// The title of this control. /// The source of ths control. + /// The mvc control class of ths control. /// The icon file. /// The type of control. /// The vieworder for this module. - public static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, SecurityAccessLevel controlType, int viewOrder) + public static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string mvcControlClass, string iconFile, SecurityAccessLevel controlType, int viewOrder) { // Call Overload with HelpUrl = Null.NullString - AddModuleControl(moduleDefId, controlKey, controlTitle, controlSrc, iconFile, controlType, viewOrder, Null.NullString); + AddModuleControl(moduleDefId, controlKey, controlTitle, controlSrc, mvcControlClass, iconFile, controlType, viewOrder, Null.NullString); } /// AddModuleDefinition adds a new Core Module Definition to the system. @@ -2134,16 +2135,17 @@ protected static bool IsLanguageEnabled(int portalid, string code) /// The key for this control in the Definition. /// The title of this control. /// Te source of ths control. + /// The mvc control class. /// The icon file. /// The type of control. /// The vieworder for this module. /// The Help Url. - private static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, SecurityAccessLevel controlType, int viewOrder, string helpURL) + private static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string mvcControlClass, string iconFile, SecurityAccessLevel controlType, int viewOrder, string helpURL) { - AddModuleControl(moduleDefId, controlKey, controlTitle, controlSrc, iconFile, controlType, viewOrder, helpURL, false); + AddModuleControl(moduleDefId, controlKey, controlTitle, controlSrc, mvcControlClass, iconFile, controlType, viewOrder, helpURL, false); } - private static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, SecurityAccessLevel controlType, int viewOrder, string helpURL, bool supportsPartialRendering) + private static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string mvcControlClass, string iconFile, SecurityAccessLevel controlType, int viewOrder, string helpURL, bool supportsPartialRendering) { DnnInstallLogger.InstallLogInfo(Localization.GetString("LogStart", Localization.GlobalResourceFile) + "AddModuleControl:" + moduleDefId); @@ -2161,6 +2163,7 @@ private static void AddModuleControl(int moduleDefId, string controlKey, string ControlKey = controlKey, ControlTitle = controlTitle, ControlSrc = controlSrc, + MvcControlClass = mvcControlClass, ControlType = controlType, ViewOrder = viewOrder, IconFile = iconFile, diff --git a/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider new file mode 100644 index 00000000000..19e67ee8441 --- /dev/null +++ b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider @@ -0,0 +1,129 @@ +/************************************************************/ +/* MVC Pipeline */ +/************************************************************/ + +/* Add MvcControlClass Column to ModuleControls Table */ +/*****************************************************/ + +IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME='{objectQualifier}ModuleControls' AND COLUMN_NAME='MvcControlClass') + BEGIN + -- Add new Column + ALTER TABLE {databaseOwner}{objectQualifier}ModuleControls + ADD MvcControlClass [nvarchar] (256) NULL + END +GO + +/* Update AddModuleControl */ +/***************************/ + +IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddModuleControl]') AND type in (N'P', N'PC')) + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddModuleControl] +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddModuleControl] + + @ModuleDefID int, + @ControlKey nvarchar(50), + @ControlTitle nvarchar(50), + @ControlSrc nvarchar(256), + @MvcControlClass nvarchar(256) = null, + @IconFile nvarchar(100), + @ControlType int, + @ViewOrder int, + @HelpUrl nvarchar(200), + @SupportsPartialRendering bit, + @SupportsPopUps bit, + @CreatedByUserID int + +AS + INSERT INTO {databaseOwner}{objectQualifier}ModuleControls ( + ModuleDefID, + ControlKey, + ControlTitle, + ControlSrc, + MvcControlClass, + IconFile, + ControlType, + ViewOrder, + HelpUrl, + SupportsPartialRendering, + SupportsPopUps, + CreatedByUserID, + CreatedOnDate, + LastModifiedByUserID, + LastModifiedOnDate + ) + VALUES ( + @ModuleDefID, + @ControlKey, + @ControlTitle, + @ControlSrc, + @MvcControlClass, + @IconFile, + @ControlType, + @ViewOrder, + @HelpUrl, + @SupportsPartialRendering, + @SupportsPopUps, + @CreatedByUserID, + getdate(), + @CreatedByUserID, + getdate() + ) + + SELECT SCOPE_IDENTITY() +GO + +/* Update UpdateModuleControl */ +/******************************/ + +IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateModuleControl]') AND type in (N'P', N'PC')) + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateModuleControl] +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateModuleControl] + @ModuleControlId int, + @ModuleDefID int, + @ControlKey nvarchar(50), + @ControlTitle nvarchar(50), + @ControlSrc nvarchar(256), + @MvcControlClass nvarchar(256) = null, + @IconFile nvarchar(100), + @ControlType int, + @ViewOrder int, + @HelpUrl nvarchar(200), + @SupportsPartialRendering bit, + @SupportsPopUps bit, + @LastModifiedByUserID int + +AS + UPDATE {databaseOwner}{objectQualifier}ModuleControls + SET + ModuleDefId = @ModuleDefId, + ControlKey = @ControlKey, + ControlTitle = @ControlTitle, + ControlSrc = @ControlSrc, + MvcControlClass = @MvcControlClass, + IconFile = @IconFile, + ControlType = @ControlType, + ViewOrder = ViewOrder, + HelpUrl = @HelpUrl, + SupportsPartialRendering = @SupportsPartialRendering, + SupportsPopUps = @SupportsPopUps, + LastModifiedByUserID = @LastModifiedByUserID, + LastModifiedOnDate = getdate() + WHERE ModuleControlId = @ModuleControlId +GO + +/* Update Terms and privacy */ +/************************************************/ + +UPDATE {databaseOwner}{objectQualifier}ModuleControls + SET + MvcControlClass = 'DotNetNuke.Common.Controls.PrivacyControl, DotNetNuke.Website' + WHERE ControlSrc = 'Admin/Portal/Privacy.ascx' + +UPDATE {databaseOwner}{objectQualifier}ModuleControls + SET + MvcControlClass = 'DotNetNuke.Common.Controls.TermsControl, DotNetNuke.Website' + WHERE ControlSrc = 'Admin/Portal/Terms.ascx' diff --git a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/EditExtension/CustomSettings/Module/ModuleDefinitions/ModuleDefinitionRow/Controls/ControlFields.jsx b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/EditExtension/CustomSettings/Module/ModuleDefinitions/ModuleDefinitionRow/Controls/ControlFields.jsx index 6a2e4d5b21a..a5ee6e2a22a 100644 --- a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/EditExtension/CustomSettings/Module/ModuleDefinitions/ModuleDefinitionRow/Controls/ControlFields.jsx +++ b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/EditExtension/CustomSettings/Module/ModuleDefinitions/ModuleDefinitionRow/Controls/ControlFields.jsx @@ -65,6 +65,13 @@ class ControlFields extends Component { error={props.triedToSave && props.error.source} onSelect={this.onSelect.bind(this, "source")} /> + +
diff --git a/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx b/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx index 5709657e6bb..887976dad17 100644 --- a/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx +++ b/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx @@ -21,6 +21,19 @@ class More extends Component { onChangeField(key, event.target.value); } + onPagePipelineSelected(option) { + const {onChangeField} = this.props; + onChangeField("pagePipeline", option.value); + } + + getPagePipelineOptions() { + const options = []; + options.push({ value: "", label: Localization.get("Inherited") }); + options.push({ value: "webforms", label: Localization.get("WebForms") }); + options.push({ value: "mvc", label: Localization.get("Mvc") }); + return options; + } + onCacheProviderSelected(option) { this.props.onChangeField("cacheProvider", option.value); if (!this.props.page.cacheProvider && option.value) { @@ -215,7 +228,28 @@ class More extends Component { } + + } +
+ {Localization.get("PipelineSettings")} +
+ + + + + + + +
); } diff --git a/Dnn.AdminExperience/ClientSide/Pages.Web/src/services/pageService.js b/Dnn.AdminExperience/ClientSide/Pages.Web/src/services/pageService.js index 4565633c985..08a4ff87418 100644 --- a/Dnn.AdminExperience/ClientSide/Pages.Web/src/services/pageService.js +++ b/Dnn.AdminExperience/ClientSide/Pages.Web/src/services/pageService.js @@ -93,6 +93,7 @@ const PageService = function () { page.iconFile = null; page.iconFileLarge = null; page.sitemapPriority = 0.5; + page.pagePipeline = ""; return page; }); }; diff --git a/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/moreSettings/index.jsx b/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/moreSettings/index.jsx index 1aa15772014..93bfc4082d2 100644 --- a/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/moreSettings/index.jsx +++ b/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/moreSettings/index.jsx @@ -286,6 +286,14 @@ class MoreSettingsPanelBody extends Component { } return options; } + + getPagePipelineOptions() { + const options = []; + options.push({ value: "webforms", label: resx.get("WebForms") }); + options.push({ value: "mvc", label: resx.get("Mvc") }); + options.push({ value: "auto", label: resx.get("Auto") }); + return options; + } onDropDownChange(key, option) { let { state, props } = this; @@ -519,6 +527,25 @@ class MoreSettingsPanelBody extends Component { }
} +
+ {resx.get("PipelineSettings")} +
+ + +
+
+
+ +
+
MVC, } - - /// - /// Gets the portal rendering pipeline configuration from the specified dictionary. - /// - /// The dictionary containing the portal settings. - /// The name of the setting to retrieve. - /// The portal rendering pipeline configuration, or WebForms if not found or invalid. - public static PortalRenderingPipeline GetPortalPipeline(this Dictionary input, string settingName) - { - if (input != null && input.TryGetValue(settingName, out var pipeline)) - { - return string.IsNullOrEmpty(pipeline) ? - PortalRenderingPipeline.WebForms : - Enum.TryParse(pipeline, true, out var result) ? result : PortalRenderingPipeline.WebForms; - } - - return PortalRenderingPipeline.WebForms; - } - - /// - /// Gets the page rendering pipeline configuration from the specified hashtable. - /// - /// The hashtable containing the page settings. - /// The name of the setting to retrieve. - /// The page rendering pipeline configuration, or Inherited if not found or invalid. - public static PageRenderingPipeline GetPagePipeline(this Hashtable input, string settingName) - { - if (input != null && input.ContainsKey(settingName)) - { - var pipeline = Convert.ToString(input[settingName], System.Globalization.CultureInfo.InvariantCulture); - return string.IsNullOrEmpty(pipeline) ? - PageRenderingPipeline.Inherited : - Enum.TryParse(pipeline, true, out var result) ? result : PageRenderingPipeline.Inherited; - } - - return PageRenderingPipeline.Inherited; - } } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index e2d0504c532..48984d065b3 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -6,6 +6,8 @@ namespace DotNetNuke.Abstractions.Portals using System; using System.Diagnostics.CodeAnalysis; + using DotNetNuke.Abstractions.Framework; + /// /// The PortalSettings class encapsulates all of the settings for the Portal, /// as well as the configuration settings required to execute the current tab diff --git a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs index 8720b0b757b..433ecd2f65c 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs @@ -5,7 +5,7 @@ namespace DotNetNuke.Entities.Portals { using System.Collections.Generic; - using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index 79607c42774..a84c0b8d279 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -9,6 +9,7 @@ namespace DotNetNuke.Entities.Portals using System.Linq; using System.Web; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Abstractions.Portals; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs index 18a2f9c5df8..d58c304c0c0 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs @@ -12,12 +12,13 @@ namespace DotNetNuke.Entities.Portals using System.Linq; using DotNetNuke.Abstractions.Application; - using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Collections; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; + using DotNetNuke.Framework; using DotNetNuke.Security; using DotNetNuke.Services.Localization; using DotNetNuke.UI.Skins; @@ -190,13 +191,13 @@ public virtual void LoadPortalSettings(PortalSettings portalSettings) var settings = PortalController.Instance.GetPortalSettings(portalSettings.PortalId); portalSettings.Registration = new RegistrationSettings(settings); - var clientResourcesSettings = new ClientResourceSettings(); + var clientResourcesSettings = new Web.Client.ClientResourceSettings(); bool overridingDefaultSettings = clientResourcesSettings.IsOverridingDefaultSettingsEnabled(portalSettings.PortalId); int crmVersion; if (overridingDefaultSettings) { - int? globalVersion = new ClientResourceSettings().GetVersion(portalSettings.PortalId); + int? globalVersion = new Web.Client.ClientResourceSettings().GetVersion(portalSettings.PortalId); crmVersion = globalVersion ?? default(int); } else diff --git a/DNN Platform/Library/Entities/Tabs/TabInfo.cs b/DNN Platform/Library/Entities/Tabs/TabInfo.cs index e5493517416..d1ee4f2f48d 100644 --- a/DNN Platform/Library/Entities/Tabs/TabInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabInfo.cs @@ -18,7 +18,7 @@ namespace DotNetNuke.Entities.Tabs using System.Xml.Serialization; using DotNetNuke.Abstractions.Application; - using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Collections.Internal; using DotNetNuke.Common; using DotNetNuke.Common.Internal; @@ -28,6 +28,7 @@ namespace DotNetNuke.Entities.Tabs using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs.TabVersions; using DotNetNuke.Entities.Users; + using DotNetNuke.Framework; using DotNetNuke.Security.Permissions; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.FileSystem; @@ -707,7 +708,7 @@ public PagePipeline.PageRenderingPipeline PagePipeline { get { - return this.TabSettings.GetPagePipeline(DotNetNuke.Abstractions.Portals.PagePipeline.SettingName); + return this.TabSettings.GetPagePipeline(Abstractions.Framework.PagePipeline.SettingName); } } diff --git a/DNN Platform/Library/Framework/PagePipelineExtensions.cs b/DNN Platform/Library/Framework/PagePipelineExtensions.cs new file mode 100644 index 00000000000..549c7a914ba --- /dev/null +++ b/DNN Platform/Library/Framework/PagePipelineExtensions.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +namespace DotNetNuke.Framework +{ + using System; + using System.Collections; + using System.Collections.Generic; + + using DotNetNuke.Abstractions.Framework; + + public static class PagePipelineExtensions + { + /// + /// Gets the portal rendering pipeline configuration from the specified dictionary. + /// + /// The dictionary containing the portal settings. + /// The name of the setting to retrieve. + /// The portal rendering pipeline configuration, or WebForms if not found or invalid. + public static PagePipeline.PortalRenderingPipeline GetPortalPipeline(this Dictionary input, string settingName) + { + if (input != null && input.TryGetValue(settingName, out var pipeline)) + { + return string.IsNullOrEmpty(pipeline) ? + PagePipeline.PortalRenderingPipeline.WebForms : + Enum.TryParse(pipeline, true, out var result) ? result : PagePipeline.PortalRenderingPipeline.WebForms; + } + + return PagePipeline.PortalRenderingPipeline.WebForms; + } + + /// + /// Gets the page rendering pipeline configuration from the specified hashtable. + /// + /// The hashtable containing the page settings. + /// The name of the setting to retrieve. + /// The page rendering pipeline configuration, or Inherited if not found or invalid. + public static PagePipeline.PageRenderingPipeline GetPagePipeline(this Hashtable input, string settingName) + { + if (input != null && input.ContainsKey(settingName)) + { + var pipeline = Convert.ToString(input[settingName], System.Globalization.CultureInfo.InvariantCulture); + return string.IsNullOrEmpty(pipeline) ? + PagePipeline.PageRenderingPipeline.Inherited : + Enum.TryParse(pipeline, true, out var result) ? result : PagePipeline.PageRenderingPipeline.Inherited; + } + + return PagePipeline.PageRenderingPipeline.Inherited; + } + } +} diff --git a/DNN Platform/Skins/Aperture/package.json b/DNN Platform/Skins/Aperture/package.json index 887d3b11cd1..e0b91261fcb 100644 --- a/DNN Platform/Skins/Aperture/package.json +++ b/DNN Platform/Skins/Aperture/package.json @@ -1,6 +1,6 @@ { "name": "aperture", - "version": "10.99.0", + "version": "10.3.3", "description": "Default theme for DNN 10.", "main": "src/scripts/main.ts", "author": "DNN Community", diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs index b066b103633..c7815f3552d 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs @@ -14,7 +14,7 @@ namespace Dnn.PersonaBar.Pages.Components using Dnn.PersonaBar.Themes.Components; using Dnn.PersonaBar.Themes.Components.DTO; using DotNetNuke.Abstractions; - using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs index eeaae1af5f5..b7f706c18a4 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs @@ -18,6 +18,7 @@ namespace Dnn.PersonaBar.Pages.Components using Dnn.PersonaBar.Pages.Services.Dto; using DotNetNuke.Abstractions.Application; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Abstractions.Modules; using DotNetNuke.Abstractions.Portals; using DotNetNuke.Abstractions.Security.Permissions; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs index 821c8c189c3..07b7f7d80ab 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs @@ -24,6 +24,7 @@ namespace Dnn.PersonaBar.SiteSettings.Services using Dnn.PersonaBar.SiteSettings.Services.Dto; using DotNetNuke.Abstractions; using DotNetNuke.Abstractions.Application; + using DotNetNuke.Abstractions.Framework; using DotNetNuke.Abstractions.Logging; using DotNetNuke.Abstractions.Portals; using DotNetNuke.Abstractions.Security; From 9cbb27c4b8ae10ef4f00979cff47cacd9519ef56 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Sun, 31 May 2026 22:09:30 +0200 Subject: [PATCH 11/26] Make the page pipeline setting a column on the tabs table --- .../Framework/PagePipeline.cs | 6 +- DNN Platform/Library/Data/DataProvider.cs | 5 +- .../Library/Entities/Tabs/TabController.cs | 6 +- DNN Platform/Library/Entities/Tabs/TabInfo.cs | 16 +- .../Website/DotNetNuke.Website.csproj | 4 + .../SqlDataProvider/10.99.00.SqlDataProvider | 188 +++++++++++++++++- .../Pages.Web/src/components/More/More.jsx | 6 +- .../Components/Pages/Converters.cs | 2 +- .../Components/Pages/PagesControllerImpl.cs | 6 +- .../Services/DTO/PageSettings.cs | 2 +- 10 files changed, 213 insertions(+), 28 deletions(-) diff --git a/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs b/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs index a684a23fbe4..3c08407a885 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs @@ -50,17 +50,17 @@ public enum PageRenderingPipeline /// /// Specifies that the pipeline type should be taken from the portal. /// - Inherited, + Inherited = -1, /// /// Specifies that pages should be rendered using the WebForms pipeline. /// - WebForms, + WebForms = 0, /// /// Specifies that pages should be rendered using the MVC pipeline. /// - MVC, + MVC = 1, } } } diff --git a/DNN Platform/Library/Data/DataProvider.cs b/DNN Platform/Library/Data/DataProvider.cs index 122b5c43457..a5bb921a88c 100644 --- a/DNN Platform/Library/Data/DataProvider.cs +++ b/DNN Platform/Library/Data/DataProvider.cs @@ -889,7 +889,7 @@ public virtual int SaveTabVersionDetail(int tabVersionDetailId, int tabVersionId return this.ExecuteScalar("SaveTabVersionDetail", tabVersionDetailId, tabVersionId, moduleId, moduleVersion, paneName, moduleOrder, action, createdByUserID, modifiedByUserID); } - public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid versionGuid, Guid defaultLanguageGuid, Guid localizedVersionGuid, string tabName, bool isVisible, bool disableLink, int parentId, string iconFile, string iconFileLarge, string title, string description, string keyWords, bool isDeleted, string url, string skinSrc, string containerSrc, DateTime startDate, DateTime endDate, int refreshInterval, string pageHeadText, bool isSecure, bool permanentRedirect, float siteMapPriority, int lastModifiedByuserID, string cultureCode, bool isSystem) + public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid versionGuid, Guid defaultLanguageGuid, Guid localizedVersionGuid, string tabName, bool isVisible, bool disableLink, int parentId, string iconFile, string iconFileLarge, string title, string description, string keyWords, bool isDeleted, string url, string skinSrc, string containerSrc, DateTime startDate, DateTime endDate, int refreshInterval, string pageHeadText, bool isSecure, bool permanentRedirect, float siteMapPriority, int lastModifiedByuserID, string cultureCode, bool isSystem, int pagePipeline) { this.ExecuteNonQuery( "UpdateTab", @@ -921,7 +921,8 @@ public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid v siteMapPriority, lastModifiedByuserID, this.GetNull(cultureCode), - isSystem); + isSystem, + pagePipeline); } public virtual void UpdateTabOrder(int tabId, int tabOrder, int parentId, int lastModifiedByUserID) diff --git a/DNN Platform/Library/Entities/Tabs/TabController.cs b/DNN Platform/Library/Entities/Tabs/TabController.cs index e1ccc65539c..536f243cd04 100644 --- a/DNN Platform/Library/Entities/Tabs/TabController.cs +++ b/DNN Platform/Library/Entities/Tabs/TabController.cs @@ -150,7 +150,8 @@ public static void CopyDesignToChildren(IEventLogger eventLogger, TabInfo parent tab.SiteMapPriority, UserController.Instance.GetCurrentUserInfo().UserID, tab.CultureCode, - tab.IsSystem); + tab.IsSystem, + (int)tab.PagePipeline); UpdateTabVersion(tab.TabID); @@ -2124,7 +2125,8 @@ public void UpdateTab(TabInfo updatedTab) updatedTab.SiteMapPriority, UserController.Instance.GetCurrentUserInfo().UserID, updatedTab.CultureCode, - updatedTab.IsSystem); + updatedTab.IsSystem, + (int)updatedTab.PagePipeline); // Update Tags List terms = updatedTab.Terms; diff --git a/DNN Platform/Library/Entities/Tabs/TabInfo.cs b/DNN Platform/Library/Entities/Tabs/TabInfo.cs index d1ee4f2f48d..95bdc1c9e52 100644 --- a/DNN Platform/Library/Entities/Tabs/TabInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabInfo.cs @@ -527,6 +527,10 @@ public CacheLevel Cacheability [XmlElement("localizedVersionGuid")] public Guid LocalizedVersionGuid { get; set; } + /// Gets or sets the rendering pipeline of the page. + [XmlElement("pagepipeline")] + public PagePipeline.PageRenderingPipeline PagePipeline { get; set; } + /// Gets or sets a collection of the modules on this page. /// An of . [XmlIgnore] @@ -701,17 +705,6 @@ public string SkinDoctype [JsonIgnore] public bool UseBaseFriendlyUrls { get; set; } - /// Gets a value indicating the pipeline type. - [XmlIgnore] - [JsonIgnore] - public PagePipeline.PageRenderingPipeline PagePipeline - { - get - { - return this.TabSettings.GetPagePipeline(Abstractions.Framework.PagePipeline.SettingName); - } - } - /// [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", Justification = "Breaking change")] public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound) @@ -1002,6 +995,7 @@ public override void Fill(IDataReader dr) this.BreadCrumbs = null; this.Modules = null; this.IsSystem = Null.SetNullBoolean(dr["IsSystem"]); + this.PagePipeline = (PagePipeline.PageRenderingPipeline)Null.SetNullInteger(dr["PagePipeline"]); } /// Gets the URL for the given . diff --git a/DNN Platform/Website/DotNetNuke.Website.csproj b/DNN Platform/Website/DotNetNuke.Website.csproj index f8e658b25ab..74d879a75fa 100644 --- a/DNN Platform/Website/DotNetNuke.Website.csproj +++ b/DNN Platform/Website/DotNetNuke.Website.csproj @@ -3272,6 +3272,10 @@ + + + + diff --git a/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider index 19e67ee8441..5719928a896 100644 --- a/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider +++ b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/10.99.00.SqlDataProvider @@ -26,7 +26,7 @@ CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddModuleControl] @ControlKey nvarchar(50), @ControlTitle nvarchar(50), @ControlSrc nvarchar(256), - @MvcControlClass nvarchar(256) = null, + @MvcControlClass nvarchar(256) = null, @IconFile nvarchar(100), @ControlType int, @ViewOrder int, @@ -103,7 +103,7 @@ AS ControlKey = @ControlKey, ControlTitle = @ControlTitle, ControlSrc = @ControlSrc, - MvcControlClass = @MvcControlClass, + MvcControlClass = @MvcControlClass, IconFile = @IconFile, ControlType = @ControlType, ViewOrder = ViewOrder, @@ -127,3 +127,187 @@ UPDATE {databaseOwner}{objectQualifier}ModuleControls SET MvcControlClass = 'DotNetNuke.Common.Controls.TermsControl, DotNetNuke.Website' WHERE ControlSrc = 'Admin/Portal/Terms.ascx' + +/* Add PagePipeline Column to Tabs Table */ +/*****************************************************/ + +IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME='{objectQualifier}Tabs' AND COLUMN_NAME='PagePipeline') + BEGIN + -- Add new Column + ALTER TABLE {databaseOwner}{objectQualifier}Tabs + ADD PagePipeline [int] NULL + END +GO + +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +ALTER VIEW {databaseOwner}[{objectQualifier}vw_Tabs] +AS + SELECT + T.TabID, + T.TabOrder, + T.PortalID, + T.TabName, + T.ParentId, + T.[Level], + T.TabPath, + T.UniqueId, + T.VersionGuid, + T.DefaultLanguageGuid, + T.LocalizedVersionGuid, + T.IsVisible, + T.HasBeenPublished, + Case when t.IconFile LIKE 'fileid=%' + then (SELECT IsNull(Folder, '') + [FileName] FROM {databaseOwner}[{objectQualifier}vw_Files] + WHERE fileid = CAST(SUBSTRING(t.IconFile, 8, 10) AS Int)) + else Coalesce(t.IconFile,'') + end as IconFile + , + Case when t.IconFileLarge LIKE 'fileid=%' + then (SELECT IsNull(Folder, '') + [FileName] FROM {databaseOwner}[{objectQualifier}vw_Files] + WHERE fileid = CAST(SUBSTRING(t.IconFileLarge, 8, 10) AS Int)) + else Coalesce(t.IconFileLarge,'') + end as IconFileLarge + ,T.DisableLink, + T.Title, + T.Description, + T.KeyWords, + T.IsDeleted, + T.SkinSrc, + T.ContainerSrc, + T.StartDate, + T.EndDate, + T.Url, + CASE WHEN {databaseOwner}{objectQualifier}HasChildTab(T.TabID) = 1 THEN 'true' ELSE 'false' END AS HasChildren, + T.RefreshInterval, + T.PageHeadText, + T.IsSecure, + T.PermanentRedirect, + T.SiteMapPriority, + CI.ContentItemID, + CI.[Content], + CI.ContentTypeID, + CI.ModuleID, + CI.ContentKey, + CI.Indexed, + CI.StateID, + T.CultureCode, + T.CreatedByUserID, + T.CreatedOnDate, + T.LastModifiedByUserID, + T.LastModifiedOnDate, + T.IsSystem, + T.PagePipeline + FROM {databaseOwner}[{objectQualifier}Tabs] AS T + LEFT JOIN {databaseOwner}[{objectQualifier}ContentItems] AS CI ON T.ContentItemID = CI.ContentItemID +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}UpdateTab]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) +BEGIN + DROP PROCEDURE {databaseOwner} [{objectQualifier}UpdateTab] +END +GO + +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateTab] + @TabId Int, + @ContentItemID Int, + @PortalId Int, + @VersionGuid UniqueIdentifier, + @DefaultLanguageGuid UniqueIdentifier, + @LocalizedVersionGuid UniqueIdentifier, + @TabName nVarChar(200), + @IsVisible Bit, + @DisableLink Bit, + @ParentId Int, + @IconFile nVarChar(255), + @IconFileLarge nVarChar(255), + @Title nVarChar(200), + @Description nVarChar(500), + @KeyWords nVarChar(500), + @IsDeleted Bit, + @Url nVarChar(255), + @SkinSrc nVarChar(200), + @ContainerSrc nVarChar(200), + @StartDate DateTime, + @EndDate DateTime, + @RefreshInterval Int, + @PageHeadText nVarChar(max), + @IsSecure Bit, + @PermanentRedirect Bit, + @SiteMapPriority Float, + @LastModifiedByUserID Int, + @CultureCode nVarChar( 10), + @IsSystem Bit, + @PagePipeline Int +AS +BEGIN + DECLARE @OldParentId Int + SET @OldParentId = (SELECT ParentId FROM {databaseOwner}[{objectQualifier}Tabs] WHERE TabID = @TabId) + + DECLARE @TabOrder Int + SET @TabOrder = (SELECT TabOrder FROM {databaseOwner}[{objectQualifier}Tabs] WHERE TabID = @TabId) + + -- Get New TabOrder + DECLARE @NewTabOrder Int + SET @NewTabOrder = (SELECT MAX(TabOrder) FROM {databaseOwner}[{objectQualifier}Tabs] WHERE (ParentId = @ParentId OR (ParentId IS NULL AND @ParentId IS NULL))) + IF @NewTabOrder IS NULL + SET @NewTabOrder = 1 + ELSE + SET @NewTabOrder = @NewTabOrder + 2 + + UPDATE {databaseOwner}[{objectQualifier}Tabs] + SET + ContentItemID = @ContentItemID, + PortalId = @PortalId, + VersionGuid = @VersionGuid, + DefaultLanguageGuid = @DefaultLanguageGuid, + LocalizedVersionGuid = @LocalizedVersionGuid, + TabName = @TabName, + IsVisible = @IsVisible, + DisableLink = @DisableLink, + ParentId = @ParentId, + IconFile = @IconFile, + IconFileLarge = @IconFileLarge, + Title = @Title, + Description = @Description, + KeyWords = @KeyWords, + IsDeleted = @IsDeleted, + Url = @Url, + SkinSrc = @SkinSrc, + ContainerSrc = @ContainerSrc, + StartDate = @StartDate, + EndDate = @EndDate, + RefreshInterval = @RefreshInterval, + PageHeadText = @PageHeadText, + IsSecure = @IsSecure, + PermanentRedirect = @PermanentRedirect, + SiteMapPriority = @SiteMapPriority, + LastModifiedByUserID = @LastModifiedByUserID, + LastModifiedOnDate = getdate(), + CultureCode = @CultureCode, + IsSystem = @IsSystem, + PagePipeline = @PagePipeline + WHERE TabId = @TabId; + + IF (@OldParentId <> @ParentId) BEGIN + -- update TabOrder of Tabs with same original Parent + UPDATE {databaseOwner}[{objectQualifier}Tabs] + SET TabOrder = TabOrder - 2 + WHERE (ParentId = @OldParentId) + AND TabOrder > @TabOrder + + -- Update Tab with new TabOrder + UPDATE {databaseOwner}[{objectQualifier}Tabs] + SET TabOrder = @NewTabOrder + WHERE TabID = @TabId + END /* IF */ + + EXEC {databaseOwner}{objectQualifier}BuildTabLevelAndPath @TabId, 1 +END /* Procedure */ +GO diff --git a/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx b/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx index c678fac5a5b..59cce2882fd 100644 --- a/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx +++ b/Dnn.AdminExperience/ClientSide/Pages.Web/src/components/More/More.jsx @@ -28,9 +28,9 @@ class More extends Component { getPagePipelineOptions() { const options = []; - options.push({ value: "0", label: Localization.get("Inherited") }); - options.push({ value: "1", label: Localization.get("WebForms") }); - options.push({ value: "2", label: Localization.get("Mvc") }); + options.push({ value: -1, label: Localization.get("Inherited") }); + options.push({ value: 0, label: Localization.get("WebForms") }); + options.push({ value: 1, label: Localization.get("Mvc") }); return options; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs index c7815f3552d..6871ec7d7f0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs @@ -140,7 +140,7 @@ public static T ConvertToPageSettings(TabInfo tab) ParentId = tab.ParentId, IsSpecial = TabController.IsSpecialTab(tab.TabID, PortalSettings.Current), PagePermissions = SecurityService.Instance.GetPagePermissions(tab), - PagePipeline = (string)tab.TabSettings[PagePipeline.SettingName], + PagePipeline = (int)tab.PagePipeline, }; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs index b7f706c18a4..6d09f94cf65 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs @@ -866,7 +866,7 @@ public PageSettings GetPageSettings(int pageId, PortalSettings requestPortalSett page.IsWorkflowCompleted = isWorkflowCompleted; page.IsWorkflowOnDraft = isWorkflowOnDraft; page.PublishStatus = tab.HasBeenPublished && isWorkflowCompleted ? "Published" : "Draft"; - page.PagePipeline = ((int)tab.PagePipeline).ToString(System.Globalization.CultureInfo.InvariantCulture); + page.PagePipeline = (int)tab.PagePipeline; return page; } @@ -1036,7 +1036,7 @@ public virtual PageSettings GetDefaultSettings(int pageId = 0) pageSettings.EnabledVersioning = tabVersionSettings.IsVersioningEnabled(portalSettings.PortalId); pageSettings.WorkflowEnabled = tabWorkflowSettings.IsWorkflowEnabled(portalSettings.PortalId); pageSettings.WorkflowId = tabWorkflowSettings.GetDefaultTabWorkflowId(portalSettings.PortalId); - pageSettings.PagePipeline = string.Empty; + pageSettings.PagePipeline = Null.NullInteger; return pageSettings; } @@ -1363,7 +1363,7 @@ protected virtual void UpdateTabInfoFromPageSettings(TabInfo tab, PageSettings p tab.IconFileLarge = null; } - tab.TabSettings[PagePipeline.SettingName] = pageSettings.PagePipeline; + tab.PagePipeline = (PagePipeline.PageRenderingPipeline)pageSettings.PagePipeline; } [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Breaking change")] diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/DTO/PageSettings.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/DTO/PageSettings.cs index 1b8a9f6dbb4..41738b71f55 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/DTO/PageSettings.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/DTO/PageSettings.cs @@ -224,6 +224,6 @@ public class PageSettings public string PublishStatus { get; set; } [DataMember(Name = "pagePipeline")] - public string PagePipeline { get; set; } + public int PagePipeline { get; set; } } } From 9004c9ca1d865e2d7ae81265404589387f900761 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 4 Jun 2026 11:20:18 +0200 Subject: [PATCH 12/26] Increase version of IPortalSettings interface --- .../Common/Controllers/JwtController.cs | 4 +- .../INavigationManager.cs | 8 ++-- .../Logging/IEventLogger.cs | 12 +++--- .../Portals/IPortalSettings.cs | 3 -- .../Portals/IPortalSettingsV2.cs | 19 ++++++++++ .../Prompt/IConsoleCommand.cs | 2 +- .../Api/Auth/ApiTokens/ApiTokenController.cs | 2 +- .../InternalServices/FileUploadController.cs | 4 +- .../DotNetNuke.Web/Prompt/ListServices.cs | 2 +- .../UI/WebControls/DnnFileUpload.cs | 2 +- .../MobileRedirect/MobileRedirectModule.cs | 2 +- .../OutputCaching/OutputCacheModule.cs | 2 +- .../UrlRewrite/DNNFriendlyUrlProvider.cs | 2 +- DNN Platform/Library/Common/Globals.cs | 14 +++---- .../Library/Common/Internal/GlobalsImpl.cs | 4 +- .../Library/Common/NavigationManager.cs | 8 ++-- .../Library/Common/Utilities/UrlUtils.cs | 18 ++++++--- .../Content/Workflow/WorkflowSecurity.cs | 4 +- .../Entities/Modules/Prompt/AddModule.cs | 2 +- .../Entities/Modules/Prompt/ListModules.cs | 2 +- .../Extensions/IPortalSettingsExtensions.cs | 4 +- .../Entities/Portals/IPortalController.cs | 2 +- .../Entities/Portals/PortalController.cs | 2 +- .../Entities/Portals/PortalSettings.cs | 38 +++++++++---------- .../Urls/AdvancedFriendlyUrlProvider.cs | 2 +- .../Entities/Urls/BasicFriendlyUrlProvider.cs | 4 +- .../Entities/Urls/FriendlyUrlController.cs | 4 +- .../Entities/Urls/FriendlyUrlProviderBase.cs | 2 +- .../Entities/Urls/RewriteController.cs | 4 +- .../Users/Profile/ProfilePropertyAccess.cs | 6 +-- .../Library/Entities/Users/UserController.cs | 2 +- .../JavaScriptLibraries/JavaScript.cs | 16 ++++---- .../Library/Obsolete/EventLogController.cs | 24 ++++++------ DNN Platform/Library/Prompt/ConsoleCommand.cs | 4 +- .../Library/Security/PortalSecurity.cs | 16 ++++---- .../Library/Security/Roles/RoleController.cs | 10 ++--- .../Library/Services/FileSystem/FileInfo.cs | 2 +- .../Library/Services/FileSystem/FolderInfo.cs | 2 +- .../Installer/Packages/PackageController.cs | 2 +- .../Localization/Internal/LocalizationImpl.cs | 4 +- .../Services/Localization/Localization.cs | 20 +++++----- .../Localization/LocalizationProvider.cs | 2 +- .../Log/EventLog/EventLogController.cs | 12 +++--- .../Log/EventLog/IEventLogController.cs | 10 ++--- .../Services/Mail/SendTokenizedBulkEmail.cs | 2 +- .../Controllers/UserResultController.cs | 2 +- .../Services/Sitemap/CoreSitemapProvider.cs | 2 +- .../Services/Sitemap/SitemapBuilder.cs | 6 +-- .../Scheduler/CoreMessagingScheduler.cs | 2 +- .../Url/FriendlyUrl/FriendlyUrlProvider.cs | 4 +- .../Library/UI/Containers/ActionManager.cs | 2 +- .../Services/SubscriptionsController.cs | 2 +- DNN Platform/Modules/DDRMenu/MenuBase.cs | 6 +-- .../DNNConnect.CKE/Browser/Browser.aspx.cs | 6 +-- .../DNNConnect.CKE/CKEditorOptions.ascx.cs | 6 +-- .../DNNConnect.CKE/Options.aspx.cs | 8 ++-- .../DNNConnect.CKE/Utilities/SettingsUtil.cs | 8 ++-- .../DNNConnect.CKE/Utilities/Utility.cs | 10 ++--- .../Common/NavigationManagerTests.cs | 4 +- .../AdminLogs/AdminLogsController.cs | 2 +- .../Components/Pages/BulkPagesController.cs | 2 +- .../Security/Checks/CheckUserProfilePage.cs | 4 +- .../Components/Security/SecurityController.cs | 2 +- .../Components/Sites/SitesController.cs | 2 +- .../Components/Users/Dto/UserBasicDto.cs | 2 +- .../Controllers/TabsController.cs | 2 +- .../Checks/CheckUserProfilePageTests.cs | 4 +- 67 files changed, 212 insertions(+), 188 deletions(-) create mode 100644 DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs index ea18e9ec363..34064e306d5 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs @@ -164,7 +164,7 @@ public LoginResultData LoginUser(HttpRequestMessage request, LoginData loginData } var obsoletePortalSettings = PortalSettings.Current; - IPortalSettings portalSettings = obsoletePortalSettings; + IPortalSettingsV2 portalSettings = obsoletePortalSettings; if (portalSettings == null) { Logger.Trace("portalSettings = null"); @@ -533,7 +533,7 @@ private LoginResultData UpdateToken(string renewalToken, PersistedToken persiste persistedToken.TokenExpiry = expiry; var obsoletePortalSettings = PortalSettings.Current; - IPortalSettings portalSettings = obsoletePortalSettings; + IPortalSettingsV2 portalSettings = obsoletePortalSettings; IPortalAliasInfo portalAlias = obsoletePortalSettings.PortalAlias; var secret = ObtainSecret(persistedToken.TokenId, portalSettings.GUID, userInfo.Membership.LastPasswordChangeDate); var accessToken = CreateJwtToken(secret, portalAlias.HttpAlias, persistedToken, userInfo.Roles); diff --git a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs index 8bf5981a165..06240060a2f 100644 --- a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs +++ b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs @@ -53,7 +53,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters); + string NavigateURL(int tabID, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -62,7 +62,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -72,7 +72,7 @@ public interface INavigationManager /// The language code. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -83,6 +83,6 @@ public interface INavigationManager /// The page name to pass. /// Any additional parameters. /// Formatted url. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, string pageName, params string[] additionalParameters); } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs b/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs index d3892445f68..2a2b2339035 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs @@ -23,7 +23,7 @@ public interface IEventLogger /// The portal settings. /// The user id. /// The log type. - void AddLog(string name, string value, IPortalSettings portalSettings, int userID, EventLogType logType); + void AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, EventLogType logType); /// Adds an Event Log. /// The log property name. @@ -31,7 +31,7 @@ public interface IEventLogger /// The portal settings. /// The user id. /// The log type. - void AddLog(string name, string value, IPortalSettings portalSettings, int userID, string logType); + void AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, string logType); /// Adds an Event Log. /// The properties of the log. @@ -39,13 +39,13 @@ public interface IEventLogger /// The user id. /// The log type key. /// The bypass buffering. - void AddLog(ILogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering); + void AddLog(ILogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering); /// Adds an Event Log. /// The portal settings. /// The user id. /// The log type. - void AddLog(IPortalSettings portalSettings, int userID, EventLogType logType); + void AddLog(IPortalSettingsV2 portalSettings, int userID, EventLogType logType); /// Adds an Event Log. /// The business object. @@ -53,7 +53,7 @@ public interface IEventLogger /// The user id. /// The user name. /// The log type. - void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogType logType); + void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogType logType); /// Adds an Event Log. /// The business object. @@ -61,7 +61,7 @@ public interface IEventLogger /// The user id. /// The user name. /// The log type. - void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType); + void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType); /// Adds an Event Log. /// The log info. diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 48984d065b3..2da449d9001 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -361,8 +361,5 @@ public interface IPortalSettings /// Gets a value indicating whether to display the dropdowns to quickly add a moduel to the page in the edit bar. bool ShowQuickModuleAddMenu { get; } - - /// Gets the pipeline type for the portal. - PagePipeline.PortalRenderingPipeline PagePipeline { get; } } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs new file mode 100644 index 00000000000..ceead420b83 --- /dev/null +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +namespace DotNetNuke.Abstractions.Portals +{ + using DotNetNuke.Abstractions.Framework; + + /// + /// The PortalSettings class encapsulates all of the settings for the Portal, + /// as well as the configuration settings required to execute the current tab + /// view within the portal. + /// + public interface IPortalSettingsV2 : IPortalSettings + { + /// Gets the pipeline type for the portal. + PagePipeline.PortalRenderingPipeline PagePipeline { get; } + } +} diff --git a/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs b/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs index 8cce25bc5f6..a06de09090a 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs @@ -25,7 +25,7 @@ public interface IConsoleCommand /// PortalSettings for the portal we're operating under or if PortalId is specified, that portal. /// Current user. /// Current page/tab. - void Initialize(string[] args, Portals.IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId); + void Initialize(string[] args, Portals.IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId); /// The main method of the command which executes it. /// A class used by the client to display results. diff --git a/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs b/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs index ecc0752254c..c2fcee37b41 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs @@ -63,7 +63,7 @@ public ApiTokenController(IApiTokenRepository apiTokenRepository, IEventLogger e /// public string SchemeType => "ApiToken"; - private static Abstractions.Portals.IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static Abstractions.Portals.IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); /// public (ApiToken Token, UserInfo User) ValidateToken(HttpRequestMessage request) diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs index 06cece5d667..07e08e23455 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs @@ -170,7 +170,7 @@ public Task PostFile() var provider = new MultipartMemoryStreamProvider(); // local references for use in closure - IPortalSettings portalSettings = this.PortalSettings; + IPortalSettingsV2 portalSettings = this.PortalSettings; var currentSynchronizationContext = SynchronizationContext.Current; var userInfo = this.UserInfo; var task = request.Content.ReadAsMultipartAsync(provider) @@ -435,7 +435,7 @@ private static SavedFileDTO SaveFile( IApplicationStatusInfo appStatus, IPortalGroupController portalGroupController, IHostSettings hostSettings, - IPortalSettings portalSettings, + IPortalSettingsV2 portalSettings, UserInfo userInfo, string folder, string filter, diff --git a/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs b/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs index 059ec1fa912..1ae1d38274d 100644 --- a/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs +++ b/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs @@ -21,7 +21,7 @@ public class ListServices : ConsoleCommand public override string LocalResourceFile => Constants.DefaultPromptResourceFile; /// - public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); if (!userInfo.IsSuperUser) diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs index ee6ced9498a..8968908ff22 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs @@ -130,7 +130,7 @@ protected override void OnPreRender(EventArgs e) this.RegisterStartupScript(); } - private static void RegisterClientScript(IClientResourceController clientResourceController, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string skin) + private static void RegisterClientScript(IClientResourceController clientResourceController, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string skin) { DnnDropDownList.RegisterClientScript(clientResourceController, skin); diff --git a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs index 6b1ca759504..969c1d64771 100644 --- a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs +++ b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs @@ -114,7 +114,7 @@ public void OnBeginRequest(object s, EventArgs e) app.Response.Redirect(redirectUrl); } - private bool IsRedirectAllowed(string url, HttpApplication app, IPortalSettings portalSettings) + private bool IsRedirectAllowed(string url, HttpApplication app, IPortalSettingsV2 portalSettings) { var urlAction = new UrlAction(app.Request); urlAction.SetRedirectAllowed(url, new FriendlyUrlSettings(this.portalController, this.hostSettings, this.hostSettingsService, portalSettings.PortalId)); diff --git a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs index ab7e663a4aa..6d28c298e69 100644 --- a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs +++ b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs @@ -88,7 +88,7 @@ private void OnResolveRequestCache(object sender, EventArgs e) } int portalId = portalSettings.PortalId; - string locale = Localization.GetPageLocale((IPortalSettings)portalSettings).Name; + string locale = Localization.GetPageLocale((IPortalSettingsV2)portalSettings).Name; IncludeExcludeType includeExclude = IncludeExcludeType.ExcludeByDefault; if (tabSettings["CacheIncludeExclude"] != null && !string.IsNullOrEmpty(tabSettings["CacheIncludeExclude"].ToString())) diff --git a/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs b/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs index 9859fd8cc15..65ff58a4c8e 100644 --- a/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs +++ b/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs @@ -73,7 +73,7 @@ public DNNFriendlyUrlProvider() public override string FriendlyUrl(TabInfo tab, string path, string pageName) => this.providerInstance.FriendlyUrl(tab, path, pageName); /// - public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) => this.providerInstance.FriendlyUrl(tab, path, pageName, settings); + public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) => this.providerInstance.FriendlyUrl(tab, path, pageName, settings); /// public override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) => this.providerInstance.FriendlyUrl(tab, path, pageName, portalAlias); diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index a58dc8af5f7..60f15ef630b 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -2344,7 +2344,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName) [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public static partial string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) { - return FriendlyUrl(tab, path, (IPortalSettings)settings); + return FriendlyUrl(tab, path, (IPortalSettingsV2)settings); } /// Generates the correctly formatted friendly URL. @@ -2355,7 +2355,7 @@ public static partial string FriendlyUrl(TabInfo tab, string path, PortalSetting /// The path to format. /// The portal settings. /// The formatted (friendly) URL. - public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, IPortalSettingsV2 settings) { return FriendlyUrl(tab, path, glbDefaultPage, settings); } @@ -2373,7 +2373,7 @@ public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings setti [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public static partial string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); + return FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); } /// Generates the correctly formatted friendly URL. @@ -2386,7 +2386,7 @@ public static partial string FriendlyUrl(TabInfo tab, string path, string pageNa /// The page to include in the URL. /// The portal settings. /// The formatted (friendly) url. - public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) { return FriendlyUrlProvider.Instance().FriendlyUrl(tab, path, pageName, settings); } @@ -2553,7 +2553,7 @@ public static string LoginURL(string returnUrl, bool overrideSetting) [DnnDeprecated(9, 8, 1, "Use the overload that takes IPortalSettings instead")] public static partial string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings) { - return LoginURL(returnUrl, overrideSetting, (IPortalSettings)portalSettings); + return LoginURL(returnUrl, overrideSetting, (IPortalSettingsV2)portalSettings); } /// Gets the login URL. @@ -2561,7 +2561,7 @@ public static partial string LoginURL(string returnUrl, bool overrideSetting, Po /// if set to , show the login control on the current page, even if there is a login page defined for the site. /// The Portal Settings. /// Formatted URL. - public static string LoginURL(string returnUrl, bool overrideSetting, IPortalSettings portalSettings) + public static string LoginURL(string returnUrl, bool overrideSetting, IPortalSettingsV2 portalSettings) { string loginUrl; var currentTabId = TabController.CurrentPage.TabID; @@ -3573,7 +3573,7 @@ public static partial string PreventSQLInjection(string strSQL) /// if set to [is super tab]. /// The settings. /// return the tab's culture code, if ths tab doesn't exist, it will return current culture name. - internal static string GetCultureCode(int tabId, bool isSuperTab, IPortalSettings settings) + internal static string GetCultureCode(int tabId, bool isSuperTab, IPortalSettingsV2 settings) { string cultureCode = Null.NullString; if (settings != null) diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 5804b8fa314..5d48f84b246 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -282,13 +282,13 @@ public string FriendlyUrl(TabInfo tab, string path, string pageName) /// public string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) { - return Globals.FriendlyUrl(tab, path, (IPortalSettings)settings); + return Globals.FriendlyUrl(tab, path, (IPortalSettingsV2)settings); } /// public string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return Globals.FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); + return Globals.FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); } /// diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs index 5f795d435f1..c1b665d825a 100644 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -111,7 +111,7 @@ public string NavigateURL(int tabID, string controlKey, params string[] addition /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters) { var isSuperTab = Globals.IsHostTab(tabID); return this.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); @@ -124,7 +124,7 @@ public string NavigateURL(int tabID, IPortalSettings settings, string controlKey /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters) { var cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); return this.NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); @@ -138,7 +138,7 @@ public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, /// The language code. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, params string[] additionalParameters) { return this.NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); } @@ -152,7 +152,7 @@ public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, /// The page name to pass to . /// Any additional parameters. /// Formatted url. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, string pageName, params string[] additionalParameters) { var url = tabID == Null.NullInteger ? Globals.ApplicationURL() : Globals.ApplicationURL(tabID); if (!string.IsNullOrEmpty(controlKey)) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 6f2f07340b5..622a2cdb82b 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -56,18 +56,22 @@ public static string DecodeParameter(string value) return Encoding.UTF8.GetString(arrBytes); } - /// Decrypts an encrypted value generated via . Decrypted using the current portal's . +#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved + /// Decrypts an encrypted value generated via . Decrypted using the current portal's . /// The encrypted value. /// The decrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] +#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved public static partial string DecryptParameter(string value) => DecryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); - /// Decrypts an encrypted value generated via . Decrypted using the current portal's . +#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved + /// Decrypts an encrypted value generated via . Decrypted using the current portal's . /// The cryptography provider. /// The encrypted value. /// The decrypted value. public static string DecryptParameter(ICryptographyProvider cryptographyProvider, string value) +#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved => DecryptParameter(cryptographyProvider, value, PortalController.Instance.GetCurrentSettings().GUID.ToString()); /// Decrypts an encrypted value generated via . @@ -108,18 +112,22 @@ public static string EncodeParameter(string value) return toEncode.ToString(); } - /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . +#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved + /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . /// The value to encrypt. /// The encrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] +#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved public static partial string EncryptParameter(string value) => EncryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); - /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . +#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved + /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . /// The cryptography provider. /// The value to encrypt. /// The encrypted value. public static string EncryptParameter(ICryptographyProvider cryptographyProvider, string value) +#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved => EncryptParameter(cryptographyProvider, value, PortalController.Instance.GetCurrentSettings().GUID.ToString()); /// Encrypt a parameter for placing in a URL. @@ -556,7 +564,7 @@ public static void Handle404Exception(HttpResponse response, PortalSettings port /// Redirect current response to 404 error page or output 404 content if error page not defined. /// The response. /// The portal settings. - public static void Handle404Exception(HttpResponseBase response, IPortalSettings portalSetting) + public static void Handle404Exception(HttpResponseBase response, IPortalSettingsV2 portalSetting) { if (portalSetting?.ErrorPage404 > Null.NullInteger) { diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs index 05f86d258fe..2af5f436b42 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs @@ -41,10 +41,10 @@ public WorkflowSecurity() /// [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", Justification = "Breaking change")] public bool HasStateReviewerPermission(PortalSettings settings, UserInfo user, int stateId) - => this.HasStateReviewerPermission((IPortalSettings)settings, user, stateId); + => this.HasStateReviewerPermission((IPortalSettingsV2)settings, user, stateId); /// - public bool HasStateReviewerPermission(IPortalSettings settings, UserInfo user, int stateId) + public bool HasStateReviewerPermission(IPortalSettingsV2 settings, UserInfo user, int stateId) { var permissions = this.statePermissionsRepository.GetWorkflowStatePermissionByState(stateId); diff --git a/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs b/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs index 847f921a954..51e15d9b371 100644 --- a/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs +++ b/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs @@ -42,7 +42,7 @@ public class AddModule : ConsoleCommand public string ModuleTitle { get; set; } // title for the new module. defaults to friendly name /// - public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); this.ParseParameters(this); diff --git a/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs b/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs index 55bfbc372b8..1ca6288e8c2 100644 --- a/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs +++ b/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs @@ -40,7 +40,7 @@ public class ListModules : ConsoleCommand public bool? Deleted { get; set; } /// - public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); this.ParseParameters(this); diff --git a/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs b/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs index 9518c2fd467..4e5e2fc18e1 100644 --- a/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs +++ b/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs @@ -7,7 +7,7 @@ namespace DotNetNuke.Entities.Portals.Extensions using DotNetNuke.Abstractions.Portals; /// - /// Extends the interface. + /// Extends the interface. /// public static class IPortalSettingsExtensions { @@ -16,7 +16,7 @@ public static class IPortalSettingsExtensions /// /// The portal settings to the the styles from. /// . - public static IPortalStyles GetStyles(this IPortalSettings portalSettings) + public static IPortalStyles GetStyles(this IPortalSettingsV2 portalSettings) { var repo = new PortalStylesRepository(); return repo.GetSettings(portalSettings.PortalId); diff --git a/DNN Platform/Library/Entities/Portals/IPortalController.cs b/DNN Platform/Library/Entities/Portals/IPortalController.cs index aa50d25cd91..d20b6046e90 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalController.cs @@ -102,7 +102,7 @@ public interface IPortalController /// Gets the current portal settings. /// portal settings. - IPortalSettings GetCurrentSettings(); + IPortalSettingsV2 GetCurrentSettings(); /// Gets information of a portal. /// ID of the portal. diff --git a/DNN Platform/Library/Entities/Portals/PortalController.cs b/DNN Platform/Library/Entities/Portals/PortalController.cs index bbab9980100..bf651d62250 100644 --- a/DNN Platform/Library/Entities/Portals/PortalController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalController.cs @@ -53,7 +53,7 @@ namespace DotNetNuke.Entities.Portals using Microsoft.Extensions.DependencyInjection; - using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettings; + using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettingsV2; using ICryptographyProvider = DotNetNuke.Abstractions.Security.ICryptographyProvider; /// PortalController provides business layer of portal. diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index a84c0b8d279..021d1048cb0 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -25,7 +25,7 @@ namespace DotNetNuke.Entities.Portals /// view within the portal. /// [Serializable] - public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettings + public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettingsV2 { /// Initializes a new instance of the class. public PortalSettings() @@ -558,44 +558,44 @@ public string AddCompatibleHttpHeader /// public PagePipeline.PortalRenderingPipeline PagePipeline { get; internal set; } - /// Create an instance. - /// A new instance. - public static IPortalSettings Create() + /// Create an instance. + /// A new instance. + public static IPortalSettingsV2 Create() => new PortalSettings(); - /// Create an instance. + /// Create an instance. /// A portal controller. /// The portal ID. - /// A new instance. - public static IPortalSettings Create(IPortalController portalController, int portalId) + /// A new instance. + public static IPortalSettingsV2 Create(IPortalController portalController, int portalId) => new PortalSettings(Null.NullInteger, portalController.GetPortal(portalId)); - /// Create an instance. + /// Create an instance. /// A portal controller. /// The active tab ID. /// The portal ID. - /// A new instance. - public static IPortalSettings Create(IPortalController portalController, int tabId, int portalId) + /// A new instance. + public static IPortalSettingsV2 Create(IPortalController portalController, int tabId, int portalId) => new PortalSettings(tabId, portalController.GetPortal(portalId)); - /// Create an instance. + /// Create an instance. /// The active tab ID. /// The portal alias. - /// A new instance. - public static IPortalSettings Create(int tabId, IPortalAliasInfo portalAlias) + /// A new instance. + public static IPortalSettingsV2 Create(int tabId, IPortalAliasInfo portalAlias) => portalAlias is PortalAliasInfo alias ? new PortalSettings(tabId, alias) : new PortalSettings(tabId, portalAlias.PortalId); - /// Create an instance. + /// Create an instance. /// The portal info. - /// A new instance. - public static IPortalSettings Create(IPortalInfo portal) + /// A new instance. + public static IPortalSettingsV2 Create(IPortalInfo portal) => portal is PortalInfo portalInfo ? new PortalSettings(portalInfo) : new PortalSettings(Null.NullInteger, portal.PortalId); - /// Create an instance. + /// Create an instance. /// The tab ID. /// The portal info. - /// A new instance. - public static IPortalSettings Create(int tabId, IPortalInfo portal) + /// A new instance. + public static IPortalSettingsV2 Create(int tabId, IPortalInfo portal) => portal is PortalInfo portalInfo ? new PortalSettings(tabId, portalInfo) : new PortalSettings(tabId, portal.PortalId); /// diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index 720d7e184e0..c5ee1a25248 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -212,7 +212,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) } /// - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 portalSettings) { if (portalSettings == null) { diff --git a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs index b23c9706199..c0ce9a6962f 100644 --- a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs @@ -65,7 +65,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) } /// - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) { IPortalAliasInfo portalAliasInfo = ((PortalSettings)settings)?.PortalAlias; return this.FriendlyUrl(tab, path, pageName, portalAliasInfo?.HttpAlias, settings); @@ -306,7 +306,7 @@ private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) return AddPage(friendlyPath, pageName); } - private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettings portalSettings) + private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettingsV2 portalSettings) { string friendlyPath = path; bool isPagePath = tab != null; diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs index 3b896db2cad..39146ac60b7 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs @@ -135,9 +135,9 @@ public static TabInfo GetTab(int tabId, bool addStdUrls) } public static TabInfo GetTab(int tabId, bool addStdUrls, PortalSettings portalSettings, FriendlyUrlSettings settings) - => GetTab(tabId, addStdUrls, (IPortalSettings)portalSettings, settings); + => GetTab(tabId, addStdUrls, (IPortalSettingsV2)portalSettings, settings); - public static TabInfo GetTab(int tabId, bool addStdUrls, IPortalSettings portalSettings, FriendlyUrlSettings settings) + public static TabInfo GetTab(int tabId, bool addStdUrls, IPortalSettingsV2 portalSettings, FriendlyUrlSettings settings) { TabInfo tab = TabController.Instance.GetTab(tabId, portalSettings.PortalId, false); if (addStdUrls) diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs index 64a9ea64ec7..73f12e8e037 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs @@ -41,7 +41,7 @@ internal FriendlyUrlProviderBase(NameValueCollection attributes) internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName); - internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings); + internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 portalSettings); internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias); } diff --git a/DNN Platform/Library/Entities/Urls/RewriteController.cs b/DNN Platform/Library/Entities/Urls/RewriteController.cs index 6801528e34d..6c25016fe34 100644 --- a/DNN Platform/Library/Entities/Urls/RewriteController.cs +++ b/DNN Platform/Library/Entities/Urls/RewriteController.cs @@ -960,7 +960,7 @@ internal static bool IdentifyByTabPathEx( PortalInfo portal = CacheController.GetPortal(result.PortalId, false); // DNN-3789 - culture is defined by GetPageLocale - IPortalSettings portalSettings = new PortalSettings(result.TabId, result.PortalAlias); + IPortalSettingsV2 portalSettings = new PortalSettings(result.TabId, result.PortalAlias); string currentLocale = Localization.GetPageLocale(portalSettings).Name; if (portal != null && !string.IsNullOrEmpty(currentLocale)) { @@ -1816,7 +1816,7 @@ private static bool CheckTabPath(IHostSettings hostSettings, IPortalController p var currentLocale = result.CultureCode; if (string.IsNullOrEmpty(currentLocale)) { - IPortalSettings portalSettings = new PortalSettings(result.PortalId); + IPortalSettingsV2 portalSettings = new PortalSettings(result.PortalId); currentLocale = Localization.GetPageLocale(portalSettings).Name; } diff --git a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs index 88d49e47193..9d939d0a1ae 100644 --- a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs +++ b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs @@ -59,7 +59,7 @@ public CacheLevel Cacheability [DnnDeprecated(9, 8, 0, "Use the overload that takes IPortalSettings instead")] public static partial bool CheckAccessLevel(PortalSettings portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) { - var portalSettingsAsInterface = (IPortalSettings)portalSettings; + var portalSettingsAsInterface = (IPortalSettingsV2)portalSettings; return CheckAccessLevel(portalSettingsAsInterface, property, accessingUser, targetUser); } @@ -69,7 +69,7 @@ public static partial bool CheckAccessLevel(PortalSettings portalSettings, Profi /// The accessing user. /// The target user. /// if property accessible, otherwise . - public static bool CheckAccessLevel(IPortalSettings portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) + public static bool CheckAccessLevel(IPortalSettingsV2 portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) { var isAdminUser = IsAdminUser(portalSettings, accessingUser, targetUser); @@ -258,7 +258,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format return string.Empty; } - private static bool IsAdminUser(IPortalSettings portalSettings, UserInfo accessingUser, UserInfo targetUser) + private static bool IsAdminUser(IPortalSettingsV2 portalSettings, UserInfo accessingUser, UserInfo targetUser) { bool isAdmin = false; diff --git a/DNN Platform/Library/Entities/Users/UserController.cs b/DNN Platform/Library/Entities/Users/UserController.cs index 9550f941d0d..ab65d687968 100644 --- a/DNN Platform/Library/Entities/Users/UserController.cs +++ b/DNN Platform/Library/Entities/Users/UserController.cs @@ -2089,7 +2089,7 @@ internal static void UpdateUser(IEventLogger eventLogger, int portalId, UserInfo if (loggedAction) { // if the HttpContext is null, then get portal settings by portal id. - IPortalSettings portalSettings = null; + IPortalSettingsV2 portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs index 8bbf8dde359..383cd7f90d9 100644 --- a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs +++ b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs @@ -135,7 +135,7 @@ public static partial void RequestRegistration(string jsname) /// The event logger. /// The portal settings. /// the library name. - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -165,7 +165,7 @@ public static partial void RequestRegistration(string jsname, Version version) /// The portal settings. /// the library name. /// the library's version. - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -200,7 +200,7 @@ public static partial void RequestRegistration(string jsname, Version version, S /// When is passed, match the major and minor versions. /// When is passed, match all parts of the version. /// - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version, SpecificVersion specific) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version, SpecificVersion specific) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -241,7 +241,7 @@ public static partial void Register(Page page) /// The event logger. /// The portal settings. /// reference to the current page. - public static void Register(IHostSettings hostSettings, IHostSettingsService hostSettingsService, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, Page page) + public static void Register(IHostSettings hostSettings, IHostSettingsService hostSettingsService, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, Page page) { hostSettings ??= Globals.GetCurrentServiceProvider().GetRequiredService(); hostSettingsService ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -397,7 +397,7 @@ private static void RequestHighestVersionLibraryRegistration(IApplicationStatusI } } - private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version, SpecificVersion specific) + private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version, SpecificVersion specific) { Func isValidLibrary = specific == SpecificVersion.LatestMajor ? l => l.Version.Major == version.Major && l.Version.Minor >= version.Minor @@ -423,7 +423,7 @@ private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInf return false; } - private static void RequestSpecificVersionLibraryRegistration(IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version) + private static void RequestSpecificVersionLibraryRegistration(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version) { var library = JavaScriptLibraryController.Instance.GetLibrary(l => l.LibraryName.Equals(jsname, StringComparison.OrdinalIgnoreCase) && l.Version == version); if (library != null) @@ -465,7 +465,7 @@ private static void AddPreInstallOrLegacyItemRequest(string jsl) HttpContextSource.Current.Items[LegacyPrefix + jsl] = true; } - private static List ResolveVersionConflicts(IEventLogger eventLogger, IPortalSettings portalSettings, IEnumerable scripts) + private static List ResolveVersionConflicts(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, IEnumerable scripts) { var finalScripts = new List(); foreach (var libraryId in scripts) @@ -615,7 +615,7 @@ private static IEnumerable GetAllDependencies(IApplicationSta } } - private static void LogCollision(IEventLogger eventLogger, IPortalSettings portalSettings, string collisionText) + private static void LogCollision(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string collisionText) { // need to log an event eventLogger.AddLog( diff --git a/DNN Platform/Library/Obsolete/EventLogController.cs b/DNN Platform/Library/Obsolete/EventLogController.cs index 93179605ce0..585fb3cc8ae 100644 --- a/DNN Platform/Library/Obsolete/EventLogController.cs +++ b/DNN Platform/Library/Obsolete/EventLogController.cs @@ -525,61 +525,61 @@ public partial void AddLog(string propertyName, string propertyValue, EventLogTy /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, EventLogType logType) => - this.AddLog(propertyName, propertyValue, (IPortalSettings)portalSettings, userID, logType); + this.AddLog(propertyName, propertyValue, (IPortalSettingsV2)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, EventLogType logType) => + public partial void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, EventLogType logType) => this.EventLogger.AddLog(propertyName, propertyValue, portalSettings, userID, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, string logType) => - this.AddLog(propertyName, propertyValue, (IPortalSettings)portalSettings, userID, logType); + this.AddLog(propertyName, propertyValue, (IPortalSettingsV2)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, string logType) => + public partial void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, string logType) => this.EventLogger.AddLog(propertyName, propertyValue, portalSettings, userID, logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(LogProperties properties, PortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) => - this.AddLog(properties, (IPortalSettings)portalSettings, userID, logTypeKey, bypassBuffering); + this.AddLog(properties, (IPortalSettingsV2)portalSettings, userID, logTypeKey, bypassBuffering); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(LogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) => + public partial void AddLog(LogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering) => this.EventLogger.AddLog(properties, portalSettings, userID, logTypeKey, bypassBuffering); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(PortalSettings portalSettings, int userID, EventLogType logType) => - this.AddLog((IPortalSettings)portalSettings, userID, logType); + this.AddLog((IPortalSettingsV2)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(IPortalSettings portalSettings, int userID, EventLogType logType) => + public partial void AddLog(IPortalSettingsV2 portalSettings, int userID, EventLogType logType) => this.EventLogger.AddLog(portalSettings, userID, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, EventLogType logType) => - this.AddLog(businessObject, (IPortalSettings)portalSettings, userID, userName, logType); + this.AddLog(businessObject, (IPortalSettingsV2)portalSettings, userID, userName, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogType logType) => + public partial void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogType logType) => this.EventLogger.AddLog(businessObject, portalSettings, userID, userName, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, string logType) => - this.AddLog(businessObject, (IPortalSettings)portalSettings, userID, userName, logType); + this.AddLog(businessObject, (IPortalSettingsV2)portalSettings, userID, userName, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType) => + public partial void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType) => this.EventLogger.AddLog(businessObject, portalSettings, userID, userName, logType); /// diff --git a/DNN Platform/Library/Prompt/ConsoleCommand.cs b/DNN Platform/Library/Prompt/ConsoleCommand.cs index 37a159d8efd..f147971ec42 100644 --- a/DNN Platform/Library/Prompt/ConsoleCommand.cs +++ b/DNN Platform/Library/Prompt/ConsoleCommand.cs @@ -28,7 +28,7 @@ public abstract class ConsoleCommand : IConsoleCommand public virtual string ResultHtml => this.LocalizeString($"Prompt_{this.GetType().Name}_ResultHtml"); /// Gets the portal settings. - protected IPortalSettings PortalSettings { get; private set; } + protected IPortalSettingsV2 PortalSettings { get; private set; } /// Gets the current user. protected IUserInfo User { get; private set; } @@ -49,7 +49,7 @@ public abstract class ConsoleCommand : IConsoleCommand Common.Globals.GetCurrentServiceProvider().GetRequiredService(); /// - public virtual void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) + public virtual void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) { this.Args = args; this.PortalSettings = portalSettings; diff --git a/DNN Platform/Library/Security/PortalSecurity.cs b/DNN Platform/Library/Security/PortalSecurity.cs index f987b98c51a..0919c8f1839 100644 --- a/DNN Platform/Library/Security/PortalSecurity.cs +++ b/DNN Platform/Library/Security/PortalSecurity.cs @@ -298,14 +298,14 @@ public static bool IsDenied(string roles) /// The semicolon separated list of roles. /// if the specified user is denied; otherwise, . public static bool IsDenied(UserInfo objUserInfo, PortalSettings settings, string roles) - => IsDenied(objUserInfo, (IPortalSettings)settings, roles); + => IsDenied(objUserInfo, (IPortalSettingsV2)settings, roles); /// Determines whether the specified user is denied for the given roles. /// The user information. /// The settings. /// The semicolon separated list of roles. /// if the specified user is denied; otherwise, . - public static bool IsDenied(UserInfo objUserInfo, IPortalSettings settings, string roles) + public static bool IsDenied(UserInfo objUserInfo, IPortalSettingsV2 settings, string roles) { // superuser always has full access if (objUserInfo.IsSuperUser) @@ -373,14 +373,14 @@ public static bool IsInRoles(string roles) /// if the provided user belongs to the specific roles; otherwise, . [DnnDeprecated(10, 0, 2, "Use overload taking IPortalSettings")] public static partial bool IsInRoles(UserInfo objUserInfo, PortalSettings settings, string roles) - => IsInRoles(objUserInfo, (IPortalSettings)settings, roles); + => IsInRoles(objUserInfo, (IPortalSettingsV2)settings, roles); /// Determines whether the provided user belongs to the specified roles. /// The user information. /// The settings. /// The semicolon separated list of roles. /// if the provided user belongs to the specific roles; otherwise, . - public static bool IsInRoles(UserInfo objUserInfo, IPortalSettings settings, string roles) + public static bool IsInRoles(UserInfo objUserInfo, IPortalSettingsV2 settings, string roles) { if (objUserInfo.IsSuperUser) { @@ -592,7 +592,7 @@ public string Replace(string inputString, ConfigType configType, string configSo const RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline; const string listName = "ProfanityFilter"; - IPortalSettings settings; + IPortalSettingsV2 settings; IEnumerable listEntryHostInfos; IEnumerable listEntryPortalInfos; @@ -649,7 +649,7 @@ public string Remove(string inputString, ConfigType configType, string configSou const RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline; const string listName = "ProfanityFilter"; - IPortalSettings settings; + IPortalSettingsV2 settings; IEnumerable listEntryHostInfos; IEnumerable listEntryPortalInfos; @@ -907,7 +907,7 @@ public void CheckAllPortalFileExtensionWhitelists(string newMasterList) } } - private static void ProcessRole(UserInfo user, IPortalSettings settings, string roleName, out bool? roleAllowed) + private static void ProcessRole(UserInfo user, IPortalSettingsV2 settings, string roleName, out bool? roleAllowed) { var roleType = GetRoleType(roleName); switch (roleType) @@ -971,7 +971,7 @@ private static int GetEntityFromRoleName(string roleName) return Null.NullInteger; } - private static void ProcessSecurityRole(UserInfo user, IPortalSettings settings, string roleName, out bool? roleAllowed) + private static void ProcessSecurityRole(UserInfo user, IPortalSettingsV2 settings, string roleName, out bool? roleAllowed) { roleAllowed = null; diff --git a/DNN Platform/Library/Security/Roles/RoleController.cs b/DNN Platform/Library/Security/Roles/RoleController.cs index 49c773d77e2..05487b97c49 100644 --- a/DNN Platform/Library/Security/Roles/RoleController.cs +++ b/DNN Platform/Library/Security/Roles/RoleController.cs @@ -101,7 +101,7 @@ public static int AddRoleGroup(RoleGroupInfo objRoleGroupInfo) /// The portal settings. /// The RoleGroup to Add. /// The ID of the new role. - public static int AddRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroupInfo) + public static int AddRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroupInfo) { var id = roleProvider.CreateRoleGroup(roleGroupInfo); eventLogger.AddLog( @@ -238,7 +238,7 @@ public static void DeleteRoleGroup(int portalID, int roleGroupId) /// The portal ID of the role group. /// The role group ID. [Obsolete("Deprecated in DotNetNuke 10.0.2. Please use overload with RoleProvider. Scheduled removal in v12.0.0.")] - public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, int portalId, int roleGroupId) + public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, int portalId, int roleGroupId) => DeleteRoleGroup(roleProvider, eventLogger, userController, portalSettings, GetRoleGroup(portalId, roleGroupId)); /// Deletes a Role Group. @@ -258,7 +258,7 @@ public static void DeleteRoleGroup(RoleGroupInfo objRoleGroupInfo) /// The user controller. /// The portal settings. /// The RoleGroup to Delete. - public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroupInfo) + public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroupInfo) { roleProvider.DeleteRoleGroup(roleGroupInfo); eventLogger.AddLog( @@ -418,7 +418,7 @@ public static void UpdateRoleGroup(RoleGroupInfo roleGroup) /// The user controller. /// The portal settings. /// The RoleGroup to Update. - public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroup) + public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroup) { UpdateRoleGroup(roleProvider, roleController, eventLogger, userController, portalSettings, roleGroup, false); } @@ -433,7 +433,7 @@ public static void UpdateRoleGroup(RoleGroupInfo roleGroup, bool includeRoles) roleGroup, includeRoles); - public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroup, bool includeRoles) + public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroup, bool includeRoles) { roleProvider.UpdateRoleGroup(roleGroup); eventLogger.AddLog(roleGroup, portalSettings, userController.GetCurrentUserInfo().UserID, string.Empty, EventLogType.USER_ROLE_UPDATED); diff --git a/DNN Platform/Library/Services/FileSystem/FileInfo.cs b/DNN Platform/Library/Services/FileSystem/FileInfo.cs index 7011581c0ed..a99e5be02ba 100644 --- a/DNN Platform/Library/Services/FileSystem/FileInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FileInfo.cs @@ -141,7 +141,7 @@ public string PhysicalPath get { string physicalPath = Null.NullString; - IPortalSettings portalSettings = null; + IPortalSettingsV2 portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs index fd843c4bb95..d4fdef3b35a 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs @@ -97,7 +97,7 @@ public string PhysicalPath get { string physicalPath; - IPortalSettings portalSettings = null; + IPortalSettingsV2 portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs index 8d4f6b5227f..44f79df5d9c 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs @@ -68,7 +68,7 @@ public static partial bool CanDeletePackage(PackageInfo package, PortalSettings /// The package. /// The portal settings. /// if the package can be deleted, otherwise . - public static bool CanDeletePackage(IHostSettings hostSettings, IApplicationStatusInfo appStatus, PackageInfo package, IPortalSettings portalSettings) + public static bool CanDeletePackage(IHostSettings hostSettings, IApplicationStatusInfo appStatus, PackageInfo package, IPortalSettingsV2 portalSettings) { bool bCanDelete = true; diff --git a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs index 3351f23c207..7f3b367fdcc 100644 --- a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs +++ b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs @@ -73,13 +73,13 @@ public string BestCultureCodeBasedOnBrowserLanguages(IEnumerable culture /// public CultureInfo GetPageLocale(PortalSettings portalSettings) { - return Localization.GetPageLocale((IPortalSettings)portalSettings); + return Localization.GetPageLocale((IPortalSettingsV2)portalSettings); } /// public void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings) { - Localization.SetThreadCultures(cultureInfo, (IPortalSettings)portalSettings); + Localization.SetThreadCultures(cultureInfo, (IPortalSettingsV2)portalSettings); } } } diff --git a/DNN Platform/Library/Services/Localization/Localization.cs b/DNN Platform/Library/Services/Localization/Localization.cs index e1baad4cc33..324ff0675df 100644 --- a/DNN Platform/Library/Services/Localization/Localization.cs +++ b/DNN Platform/Library/Services/Localization/Localization.cs @@ -573,7 +573,7 @@ public static string GetLocaleName(string code, CultureDropDownTypes displayType [DnnDeprecated(9, 8, 0, "Use overload taking IPortalSettings instead")] public static partial CultureInfo GetPageLocale(PortalSettings portalSettings) { - return GetPageLocale((IPortalSettings)portalSettings); + return GetPageLocale((IPortalSettingsV2)portalSettings); } /// @@ -591,7 +591,7 @@ public static partial CultureInfo GetPageLocale(PortalSettings portalSettings) /// /// Current PortalSettings. /// A valid CultureInfo. - public static CultureInfo GetPageLocale(IPortalSettings portalSettings) + public static CultureInfo GetPageLocale(IPortalSettingsV2 portalSettings) { CultureInfo pageCulture = null; @@ -1577,7 +1577,7 @@ public static void SetLanguage(string value) [DnnDeprecated(9, 8, 0, "Use overload taking IPortalSettings instead")] public static partial void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings) { - SetThreadCultures(cultureInfo, (IPortalSettings)portalSettings); + SetThreadCultures(cultureInfo, (IPortalSettingsV2)portalSettings); } /// Sets the culture codes on the current Thread. @@ -1587,7 +1587,7 @@ public static partial void SetThreadCultures(CultureInfo cultureInfo, PortalSett /// This method will configure the Thread culture codes. Any page which does not derive from should /// be sure to call this method in to ensure localization works correctly. /// - public static void SetThreadCultures(CultureInfo cultureInfo, IPortalSettings portalSettings) + public static void SetThreadCultures(CultureInfo cultureInfo, IPortalSettingsV2 portalSettings) { if (cultureInfo == null) { @@ -1888,7 +1888,7 @@ private static string GetValidLanguageUrl(int portalId, string httpAlias, string /// Tries to get a valid language from the querystring. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromQs(IPortalSettings portalSettings) + private static CultureInfo GetCultureFromQs(IPortalSettingsV2 portalSettings) { if (HttpContext.Current == null || HttpContext.Current.Request["language"] == null) { @@ -1903,7 +1903,7 @@ private static CultureInfo GetCultureFromQs(IPortalSettings portalSettings) /// Tries to get a valid language from the cookie. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromCookie(IPortalSettings portalSettings) + private static CultureInfo GetCultureFromCookie(IPortalSettingsV2 portalSettings) { CultureInfo culture; if (HttpContext.Current == null || HttpContext.Current.Request.Cookies["language"] == null) @@ -1919,7 +1919,7 @@ private static CultureInfo GetCultureFromCookie(IPortalSettings portalSettings) /// Tries to get a valid language from the user profile. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromProfile(IPortalSettings portalSettings) + private static CultureInfo GetCultureFromProfile(IPortalSettingsV2 portalSettings) { UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); @@ -1936,7 +1936,7 @@ private static CultureInfo GetCultureFromProfile(IPortalSettings portalSettings) /// Tries to get a valid language from the browser preferences if the portal has the setting to use browser languages enabled. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromBrowser(IPortalSettings portalSettings) + private static CultureInfo GetCultureFromBrowser(IPortalSettingsV2 portalSettings) { if (!portalSettings.EnableBrowserLanguage) { @@ -1951,7 +1951,7 @@ private static CultureInfo GetCultureFromBrowser(IPortalSettings portalSettings) /// Tries to get a valid language from the portal default preferences. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromPortal(IPortalSettings portalSettings) + private static CultureInfo GetCultureFromPortal(IPortalSettingsV2 portalSettings) { CultureInfo culture = null; if (!string.IsNullOrEmpty(portalSettings.DefaultLanguage)) @@ -1994,7 +1994,7 @@ private static List GetPortalLocalizations(int portalId) /// Current culture. /// Portal settings for the current request. /// A instance representing the user's UI culture. - private static CultureInfo GetUserUICulture(CultureInfo currentCulture, IPortalSettings portalSettings) + private static CultureInfo GetUserUICulture(CultureInfo currentCulture, IPortalSettingsV2 portalSettings) { CultureInfo uiCulture = currentCulture; try diff --git a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs index b803c669eb0..a9fce7c7adc 100644 --- a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs +++ b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs @@ -219,7 +219,7 @@ private static object GetCompiledResourceFileCallBack(CacheItemArgs cacheItemArg { var resourceFile = (string)cacheItemArgs.Params[0]; var locale = (string)cacheItemArgs.Params[1]; - var portalSettings = (IPortalSettings)cacheItemArgs.Params[2]; + var portalSettings = (IPortalSettingsV2)cacheItemArgs.Params[2]; var hostSettings = (IHostSettings)cacheItemArgs.Params[3]; string systemLanguage = Localization.SystemLocale; string defaultLanguage = portalSettings.DefaultLanguage; diff --git a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs index 57f4f48a14e..40fb6a4dfdf 100644 --- a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs @@ -33,13 +33,13 @@ void IEventLogger.AddLog(string name, string value, Abstractions.Logging.EventLo } /// - void IEventLogger.AddLog(string name, string value, IPortalSettings portalSettings, int userID, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, Abstractions.Logging.EventLogType logType) { this.EventLogger.AddLog(name, value, portalSettings, userID, logType.ToString()); } /// - void IEventLogger.AddLog(string name, string value, IPortalSettings portalSettings, int userID, string logType) + void IEventLogger.AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, string logType) { var properties = new LogProperties(); var logDetailInfo = new LogDetailInfo { PropertyName = name, PropertyValue = value }; @@ -48,7 +48,7 @@ void IEventLogger.AddLog(string name, string value, IPortalSettings portalSettin } /// - void IEventLogger.AddLog(ILogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) + void IEventLogger.AddLog(ILogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering) { // supports adding a custom string for LogType var log = new LogInfo @@ -69,19 +69,19 @@ void IEventLogger.AddLog(ILogProperties properties, IPortalSettings portalSettin } /// - void IEventLogger.AddLog(IPortalSettings portalSettings, int userID, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(IPortalSettingsV2 portalSettings, int userID, Abstractions.Logging.EventLogType logType) { this.EventLogger.AddLog(new LogProperties(), portalSettings, userID, logType.ToString(), false); } /// - void IEventLogger.AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, Abstractions.Logging.EventLogType logType) { this.AddLog(businessObject, portalSettings, userID, userName, logType.ToString()); } /// - void IEventLogger.AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType) + void IEventLogger.AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType) { var log = new LogInfo { LogUserID = userID, LogTypeKey = logType }; if (portalSettings != null) diff --git a/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs b/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs index 114d84d112a..a1fcfc6b944 100644 --- a/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs @@ -25,9 +25,9 @@ public partial interface IEventLogController : ILogController [Obsolete("Deprecated in DotNetNuke 9.7.0. It has been replaced by the overload taking IPortalSettings. Scheduled for removal in v11.0.0.")] void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, string logType); - void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, EventLogController.EventLogType logType); + void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, EventLogController.EventLogType logType); - void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, string logType); + void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, string logType); void AddLog(PortalSettings portalSettings, int userID, EventLogController.EventLogType logType); @@ -40,11 +40,11 @@ public partial interface IEventLogController : ILogController [Obsolete("Deprecated in DotNetNuke 9.7.0. It has been replaced by the overload taking IPortalSettings. Scheduled for removal in v11.0.0.")] void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, string logType); - void AddLog(LogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering); + void AddLog(LogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering); - void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogController.EventLogType logType); + void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogController.EventLogType logType); - void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType); + void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType); #pragma warning restore SA1600 // Elements should be documented } } diff --git a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs index c251e46dfd5..5826197ad7a 100644 --- a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs +++ b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs @@ -44,7 +44,7 @@ public class SendTokenizedBulkEmail : IDisposable private UserInfo replyToUser; private bool smtpEnableSSL; private TokenReplace tokenReplace; - private IPortalSettings portalSettings; + private IPortalSettingsV2 portalSettings; private UserInfo sendingUser; private string body = string.Empty; private string confirmBodyHTML; diff --git a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs index ed52266befb..4b2092aa8a1 100644 --- a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs +++ b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs @@ -31,7 +31,7 @@ public class UserResultController : BaseResultController /// public override string LocalizedSearchTypeName => Localization.GetString("Crawler_user", LocalizedResxFile); - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); /// public override bool HasViewPermission(SearchResult searchResult) diff --git a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs index ac31ba03d3d..ab065f3dea6 100644 --- a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs +++ b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs @@ -41,7 +41,7 @@ public override List GetUrls(int portalId, PortalSettings ps, string var currentLanguage = ps.CultureCode; if (string.IsNullOrEmpty(currentLanguage)) { - currentLanguage = Localization.GetPageLocale((IPortalSettings)ps).Name; + currentLanguage = Localization.GetPageLocale((IPortalSettingsV2)ps).Name; } var languagePublished = LocaleController.Instance.GetLocale(ps.PortalId, currentLanguage).IsPublished; diff --git a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs index 19dab45e5b2..4af3738e0c3 100644 --- a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs +++ b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs @@ -51,7 +51,7 @@ public string CacheFileName var currentCulture = this.portalSettings.CultureCode?.ToLowerInvariant(); if (string.IsNullOrEmpty(currentCulture)) { - currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); + currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); } this.cacheFileName = $"sitemap.{currentCulture}.xml"; @@ -67,7 +67,7 @@ public string CacheIndexFileNameFormat { if (string.IsNullOrEmpty(this.cacheIndexFileNameFormat)) { - var currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); + var currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); this.cacheIndexFileNameFormat = $"sitemap_{{0}}.{currentCulture}.xml"; } @@ -207,7 +207,7 @@ public void GetSitemapIndexFile(string index, TextWriter output) return; } - var currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); + var currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); this.WriteSitemapFileToOutput($"sitemap_{theIndex}.{currentCulture}.xml", output); } diff --git a/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs b/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs index cc217465921..fb0ee29c9b5 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs @@ -395,7 +395,7 @@ private static int GetMessageTab(IHostSettings hostSettings, PortalSettings send /// The tab ID for the Message Center OR the user profile page tab ID. private static object GetMessageTabCallback(CacheItemArgs cacheItemArgs) { - var portalSettings = (IPortalSettings)cacheItemArgs.Params[0]; + var portalSettings = (IPortalSettingsV2)cacheItemArgs.Params[0]; var profileTab = TabController.Instance.GetTab(portalSettings.UserTabId, portalSettings.PortalId, false); if (profileTab != null) diff --git a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs index 586f68580e2..b3d5b8ab629 100644 --- a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs +++ b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs @@ -41,7 +41,7 @@ public static FriendlyUrlProvider Instance() [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public virtual partial string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return this.FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); + return this.FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); } /// Generate a friendly URL. @@ -50,7 +50,7 @@ public virtual partial string FriendlyUrl(TabInfo tab, string path, string pageN /// The page name. /// The portal settings. /// The friendly URL. - public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings); + public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings); /// Generate a friendly URL. /// The page. diff --git a/DNN Platform/Library/UI/Containers/ActionManager.cs b/DNN Platform/Library/UI/Containers/ActionManager.cs index d17cc7740b1..f70d715715e 100644 --- a/DNN Platform/Library/UI/Containers/ActionManager.cs +++ b/DNN Platform/Library/UI/Containers/ActionManager.cs @@ -30,7 +30,7 @@ namespace DotNetNuke.UI.Containers /// ActionManager is a helper class that provides common Action Behaviors that can be used by any implementation. public class ActionManager { - private readonly IPortalSettings portalSettings = PortalController.Instance.GetCurrentSettings(); + private readonly IPortalSettingsV2 portalSettings = PortalController.Instance.GetCurrentSettings(); private readonly HttpRequest request = HttpContext.Current.Request; private readonly HttpResponse response = HttpContext.Current.Response; private readonly IEventLogger eventLogger; diff --git a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs index 3f99abf9f9f..530523a1089 100644 --- a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs +++ b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs @@ -178,7 +178,7 @@ public HttpResponseMessage GetLocalizationTable(string culture) { if (!string.IsNullOrEmpty(culture)) { - Localization.SetThreadCultures(new CultureInfo(culture), (IPortalSettings)this.PortalSettings); + Localization.SetThreadCultures(new CultureInfo(culture), (IPortalSettingsV2)this.PortalSettings); } var dictionary = new Dictionary(); diff --git a/DNN Platform/Modules/DDRMenu/MenuBase.cs b/DNN Platform/Modules/DDRMenu/MenuBase.cs index 56241588bc0..c4a82ed70b8 100644 --- a/DNN Platform/Modules/DDRMenu/MenuBase.cs +++ b/DNN Platform/Modules/DDRMenu/MenuBase.cs @@ -75,7 +75,7 @@ public MenuBase(ILocaliser localiser, IHostSettings hostSettings, ITabController public TemplateDefinition TemplateDef { get; set; } /// Gets the portal settings for the current portal. - // TODO: In v11 we should replace this by IPortalSettings and make it private or instantiate PortalSettings in the constructor. + // TODO: In v11 we should replace this by IPortalSettingsV2 and make it private or instantiate PortalSettings in the constructor. [Obsolete("Deprecated in DotNetNuke 9.8.1. This should not have been public. Scheduled removal in v11.0.0.")] internal PortalSettings HostPortalSettings => this.hostPortalSettings ??= PortalSettings.Current; @@ -158,7 +158,7 @@ internal virtual void PreRender() { #pragma warning disable CS0618 // Type or member is obsolete - // TODO: In Dnn v11, replace this to use IPortalSettings private field instantiate in constructor + // TODO: In Dnn v11, replace this to use IPortalSettingsV2 private field instantiate in constructor this.localiser.LocaliseNode(this.RootNode, this.HostPortalSettings.PortalId); #pragma warning restore CS0618 // Type or member is obsolete } @@ -440,7 +440,7 @@ private void ApplyNodeSelector() private void ApplyNodeManipulator() { - // TODO: In Dnn v11, replace this.HostPortalSettings to use IPortalSettings private field instantiate in constructor + // TODO: In Dnn v11, replace this.HostPortalSettings to use IPortalSettingsV2 private field instantiate in constructor #pragma warning disable CS0618 // Type or member is obsolete this.RootNode = new MenuNode( diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs index 84e6e9a92b1..72c882e7b71 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs @@ -94,7 +94,7 @@ public partial class Browser : PageBase private EditorProviderSettings allPortalsSettings = new EditorProviderSettings(); /// The portal settings. - private IPortalSettings portalSettings; + private IPortalSettingsV2 portalSettings; /// The extension white list. private IFileExtensionAllowList extensionWhiteList; @@ -1520,7 +1520,7 @@ private void FillQualityPercentages() /// The get portal settings. /// Current Portal Settings. - private IPortalSettings GetPortalSettings() + private IPortalSettingsV2 GetPortalSettings() { int iTabId = 0, iPortalId = 0; @@ -1545,7 +1545,7 @@ private IPortalSettings GetPortalSettings() } catch (Exception) { - return (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; + return (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; } } diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs index 3e16cffdeca..bbfc97b14e7 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs @@ -79,7 +79,7 @@ public partial class CKEditorOptions : PortalModuleBase private readonly HttpRequest request = HttpContext.Current.Request; /// The _portal settings. - private IPortalSettings portalSettings; + private IPortalSettingsV2 portalSettings; /// Override Default Config Folder from Web.config. private string configFolder = string.Empty; @@ -1234,7 +1234,7 @@ private void FillFolders() /// Gets the portal settings. /// Returns the Current Portal Settings. - private IPortalSettings GetPortalSettings() + private IPortalSettingsV2 GetPortalSettings() { try { @@ -1267,7 +1267,7 @@ private IPortalSettings GetPortalSettings() } catch (Exception) { - return (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; + return (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; } } diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs index d7661291134..11ddf43110a 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs @@ -37,7 +37,7 @@ public partial class Options : PageBase private readonly HttpRequest request = HttpContext.Current.Request; /// The portal settings. - private IPortalSettings curPortalSettings; + private IPortalSettingsV2 curPortalSettings; /// Initializes a new instance of the class. [Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload with IUserController. Scheduled removal in v12.0.0.")] @@ -183,11 +183,11 @@ private void ClosePage() /// Gets the portal settings. /// The Portal Settings. - private IPortalSettings GetPortalSettings() + private IPortalSettingsV2 GetPortalSettings() { int iTabId = 0, iPortalId = 0; - IPortalSettings portalSettings; + IPortalSettingsV2 portalSettings; try { @@ -210,7 +210,7 @@ private IPortalSettings GetPortalSettings() } catch (Exception) { - portalSettings = (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; + portalSettings = (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; } return portalSettings; diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs index 0276e9ca082..c4d2a67feed 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs @@ -94,7 +94,7 @@ internal static bool CheckExistsModuleInstanceSettings(string moduleKey, int mod /// Returns the Filled Settings. /// internal static EditorProviderSettings LoadEditorSettingsByKey( - IPortalSettings portalSettings, + IPortalSettingsV2 portalSettings, EditorProviderSettings currentSettings, List editorHostSettings, string key, @@ -1001,7 +1001,7 @@ internal static EditorProviderSettings LoadEditorSettingsByKey( /// /// Returns the filled Module Settings. /// - internal static EditorProviderSettings LoadModuleSettings(IPortalSettings portalSettings, EditorProviderSettings currentSettings, string key, int moduleId, IList portalRoles) + internal static EditorProviderSettings LoadModuleSettings(IPortalSettingsV2 portalSettings, EditorProviderSettings currentSettings, string key, int moduleId, IList portalRoles) { Hashtable hshModSet = null; var module = ModuleController.Instance.GetModule(moduleId, Null.NullInteger, false); @@ -1516,7 +1516,7 @@ PropertyInfo info in /// The alternate Sub Folder. /// The portal roles. /// Returns the Default Provider Settings. - internal static EditorProviderSettings GetDefaultSettings(IPortalSettings portalSettings, IHostSettings hostSettings, string homeDirPath, string alternateSubFolder, IList portalRoles) + internal static EditorProviderSettings GetDefaultSettings(IPortalSettingsV2 portalSettings, IHostSettings hostSettings, string homeDirPath, string alternateSubFolder, IList portalRoles) { var roles = new ArrayList(); @@ -1850,7 +1850,7 @@ internal static partial void ImportSettingBaseXml(string homeDirPath, bool isDef /// The portal settings. /// The HTTP request. /// Returns the MAX. upload file size for the current user. - internal static int GetCurrentUserUploadSize(EditorProviderSettings settings, IPortalSettings portalSettings, HttpRequest httpRequest) + internal static int GetCurrentUserUploadSize(EditorProviderSettings settings, IPortalSettingsV2 portalSettings, HttpRequest httpRequest) { var uploadFileLimitForPortal = Convert.ToInt32(Utility.GetMaxUploadSize()); diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs index 826d6cdcddd..3e953c93c54 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs @@ -245,7 +245,7 @@ public static string ConvertUnicodeChars(string input) /// /// Returns if the user has write access to the folder. /// - public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettings portalSettings) + public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettingsV2 portalSettings) { return CheckIfUserHasFolderAccess(folderId, portalSettings, "WRITE"); } @@ -256,7 +256,7 @@ public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettings /// /// Returns if the user has write access to the folder. /// - public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettings portalSettings) + public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettingsV2 portalSettings) { return CheckIfUserHasFolderAccess(folderId, portalSettings, "READ"); } @@ -267,7 +267,7 @@ public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettings /// /// Returns the Folder Info. /// - public static IFolderInfo ConvertFilePathToFolderInfo(string folderPath, IPortalSettings portalSettings) + public static IFolderInfo ConvertFilePathToFolderInfo(string folderPath, IPortalSettingsV2 portalSettings) { if (!string.IsNullOrEmpty(portalSettings.HomeDirectoryMapPath) && folderPath.Length >= portalSettings.HomeDirectoryMapPath.Length) { @@ -348,7 +348,7 @@ public static void SortDescending(List source, Func /// if [is in roles] [the specified roles]; otherwise, . /// - public static bool IsInRoles(string roles, IPortalSettings settings) + public static bool IsInRoles(string roles, IPortalSettingsV2 settings) { var objUserInfo = UserController.Instance.GetCurrentUserInfo(); @@ -510,7 +510,7 @@ public static IFolderInfo EnsureGetFolder(int portalId, string folderPath) return null; } - private static bool CheckIfUserHasFolderAccess(int folderId, IPortalSettings portalSettings, string permissionKey) + private static bool CheckIfUserHasFolderAccess(int folderId, IPortalSettingsV2 portalSettings, string permissionKey) { try { diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs index 3049a665829..233e1688f67 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs @@ -383,7 +383,7 @@ public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlK var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = this.navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); + var actual = this.navigationManager.NavigateURL(tabId, default(IPortalSettingsV2), controlKey, null); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); @@ -402,7 +402,7 @@ public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlK [TestCase(10, "My-Control-Key-10")] public void NavigateUrl_TabId_Settings_ControlKey(int tabId, string controlKey) { - var mockSettings = new Mock(); + var mockSettings = new Mock(); mockSettings .Setup(x => x.ContentLocalizationEnabled) .Returns(true); diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs index dad48d210e0..6364cecd16c 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs @@ -48,7 +48,7 @@ public AdminLogsController(IEventLogger eventLogger) protected Dictionary LogTypeDictionary => this.logTypeDictionary = LogController.Instance.GetLogTypeInfoDictionary(); - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); public LogTypeInfo GetMyLogType(string logTypeKey) { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs index 2d0a4e52203..725bde616c4 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs @@ -285,7 +285,7 @@ private static bool IsValidTabPath(TabInfo tab, string newTabPath, out string er return valid; } - private int CreateTabFromParent(IPortalSettings portalSettings, TabInfo objRoot, TabInfo oTab, int parentId, bool validateOnly, out string errorMessage) + private int CreateTabFromParent(IPortalSettingsV2 portalSettings, TabInfo objRoot, TabInfo oTab, int parentId, bool validateOnly, out string errorMessage) { var tab = new TabInfo { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs index 13e7afc12c5..1caf60c14d3 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs @@ -42,7 +42,7 @@ public class CheckUserProfilePage : BaseCheck private readonly ITabController tabController; private readonly IPagesController pagesController; - private readonly Lazy portalSettings; + private readonly Lazy portalSettings; /// Initializes a new instance of the class. [Obsolete("Deprecated in DotNetNuke 10.0.0. Please use overload with IPagesController. Scheduled removal in v12.0.0.")] @@ -75,7 +75,7 @@ internal CheckUserProfilePage( throw new ArgumentNullException(nameof(portalController)); } - this.portalSettings = new Lazy(portalController.GetCurrentSettings); + this.portalSettings = new Lazy(portalController.GetCurrentSettings); } private int PortalId => this.portalSettings.Value.PortalId; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs index dea1a4e06f0..98dccaed5c5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs @@ -29,7 +29,7 @@ namespace Dnn.PersonaBar.Security.Components public class SecurityController { - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Breaking change")] public IEnumerable GetAuthenticationProviders() diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs index 8c0ef863a56..de135db314c 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs @@ -50,7 +50,7 @@ public class SitesController [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Breaking change")] public string LocalResourcesFile => Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Sites/App_LocalResources/Sites.resx"); - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); private CultureDropDownTypes DisplayType { get; set; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs index 57a39cc572a..7e6b115d0f6 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs @@ -82,7 +82,7 @@ public UserBasicDto(UserInfo user) [DataMember(Name = "isAdmin")] public bool IsAdmin { get; set; } - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); public static UserBasicDto FromUserInfo(UserInfo user) { diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs index 86dadc7972a..d9987655500 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs @@ -43,7 +43,7 @@ public class TabsController private static string AllUsersIcon => Globals.ResolveUrl("~/DesktopModules/Admin/Tabs/images/Icon_Everyone.png"); - private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); public TabDto GetPortalTabs(UserInfo userInfo, int portalId, string cultureCode, bool isMultiLanguage, bool excludeAdminTabs = true, string roles = "", bool disabledNotSelectable = false, int sortOrder = 0, int selectedTabId = -1, string validateTab = "", bool includeHostPages = false, bool includeDisabled = false, bool includeDeleted = false, bool includeDeletedChildren = true) { diff --git a/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs b/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs index 2578f504b0c..644a8c19d56 100644 --- a/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs +++ b/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs @@ -298,9 +298,9 @@ private static PagePermissions BuildPermissionsData(bool allUsersCanView) return permissionsData; } - private static Mock SetupPortalSettingsMock(int portalId, int userTabId) + private static Mock SetupPortalSettingsMock(int portalId, int userTabId) { - var mock = new Mock(); + var mock = new Mock(); mock.SetupGet(x => x.PortalId).Returns(portalId); mock.SetupGet(x => x.UserTabId).Returns(userTabId); return mock; From ddea5b15a5f91575f14cf6e72d90443261da5382 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 4 Jun 2026 11:27:22 +0200 Subject: [PATCH 13/26] Move method from interface to extension method --- .../Entities/Portals/IPortalSettingsController.cs | 2 -- .../Library/Entities/Portals/PortalSettingsController.cs | 6 ------ .../Library/Entities/Portals/PortalSettingsExtensions.cs | 9 +++++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs index 433ecd2f65c..1bfba00e3c1 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs @@ -15,8 +15,6 @@ public interface IPortalSettingsController PortalSettings.PortalAliasMapping GetPortalAliasMappingMode(int portalId); - PagePipeline.PortalRenderingPipeline GetPortalPagePipeline(int portalId); - /// The GetActiveTab method gets the active Tab for the current request. /// The current tab's id. /// The current PortalSettings. diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs index d58c304c0c0..b7902ad4709 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs @@ -127,12 +127,6 @@ public virtual PortalSettings.PortalAliasMapping GetPortalAliasMappingMode(int p return aliasMapping; } - /// - public virtual PagePipeline.PortalRenderingPipeline GetPortalPagePipeline(int portalId) - { - return PortalController.Instance.GetPortalSettings(portalId).GetPortalPipeline(PagePipeline.SettingName); - } - /// public virtual IList GetTabModules(PortalSettings portalSettings) { diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs index f3e8678583c..cd5e3d11859 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs @@ -1,8 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information + namespace DotNetNuke.Entities.Portals { + using DotNetNuke.Abstractions.Framework; + using DotNetNuke.Framework; + public static class PortalSettingsExtensions { /// Detect whether current page is custom error page. @@ -13,5 +17,10 @@ public static bool InErrorPageRequest(this PortalSettings portalSettings) return portalSettings.ActiveTab.TabID == portalSettings.ErrorPage404 || portalSettings.ActiveTab.TabID == portalSettings.ErrorPage500; } + + public static PagePipeline.PortalRenderingPipeline GetPortalPagePipeline(this IPortalSettingsController portalSettingsController, int portalId) + { + return PortalController.Instance.GetPortalSettings(portalId).GetPortalPipeline(PagePipeline.SettingName); + } } } From 3b29b60f086154e271ae0ea53ef9d3346357b33b Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:09:28 +0200 Subject: [PATCH 14/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 622a2cdb82b..8d1fa3b5299 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -56,8 +56,7 @@ public static string DecodeParameter(string value) return Encoding.UTF8.GetString(arrBytes); } -#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved - /// Decrypts an encrypted value generated via . Decrypted using the current portal's . + /// Decrypts an encrypted value generated via . Decrypted using the current portal's . /// The encrypted value. /// The decrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] From cc87fbf288b4afe5554fb0808ba8cd7577ef1f2e Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:09:37 +0200 Subject: [PATCH 15/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 8d1fa3b5299..24573fe9cc8 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -60,7 +60,6 @@ public static string DecodeParameter(string value) /// The encrypted value. /// The decrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] -#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved public static partial string DecryptParameter(string value) => DecryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); From d40577cb22aa795f42450ac7d840d75d11c5737c Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:09:46 +0200 Subject: [PATCH 16/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 24573fe9cc8..76041a52d0e 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -63,8 +63,7 @@ public static string DecodeParameter(string value) public static partial string DecryptParameter(string value) => DecryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); -#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved - /// Decrypts an encrypted value generated via . Decrypted using the current portal's . + /// Decrypts an encrypted value generated via . Decrypted using the current portal's . /// The cryptography provider. /// The encrypted value. /// The decrypted value. From 6aa8bb5ba7e9fc6ecf42a35ed22fdba65017d233 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:09:54 +0200 Subject: [PATCH 17/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 76041a52d0e..aa6032202eb 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -68,7 +68,6 @@ public static partial string DecryptParameter(string value) /// The encrypted value. /// The decrypted value. public static string DecryptParameter(ICryptographyProvider cryptographyProvider, string value) -#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved => DecryptParameter(cryptographyProvider, value, PortalController.Instance.GetCurrentSettings().GUID.ToString()); /// Decrypts an encrypted value generated via . From ea55281623ec3aefdcd268615c676312145241e1 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:10:02 +0200 Subject: [PATCH 18/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index aa6032202eb..d12ab1f26a3 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -108,8 +108,7 @@ public static string EncodeParameter(string value) return toEncode.ToString(); } -#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved - /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . + /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . /// The value to encrypt. /// The encrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] From 513207cfd89f6d4a2db5bef115fbfc3785f8ee40 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:10:10 +0200 Subject: [PATCH 19/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index d12ab1f26a3..84ca325cc98 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -112,7 +112,6 @@ public static string EncodeParameter(string value) /// The value to encrypt. /// The encrypted value. [DnnDeprecated(10, 2, 2, "Use overload taking ICryptographyProvider")] -#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved public static partial string EncryptParameter(string value) => EncryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); From 91e6ec7f0c801fe627fa0ea11e0be703f2e17802 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:10:19 +0200 Subject: [PATCH 20/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 84ca325cc98..287428e449b 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -121,7 +121,6 @@ public static partial string EncryptParameter(string value) /// The value to encrypt. /// The encrypted value. public static string EncryptParameter(ICryptographyProvider cryptographyProvider, string value) -#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved => EncryptParameter(cryptographyProvider, value, PortalController.Instance.GetCurrentSettings().GUID.ToString()); /// Encrypt a parameter for placing in a URL. From 3dd954bcddfe11070db5bd7117e3e762645e78c8 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Tue, 9 Jun 2026 09:10:28 +0200 Subject: [PATCH 21/26] Update DNN Platform/Library/Common/Utilities/UrlUtils.cs Co-authored-by: Brian Dukes --- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 287428e449b..dbbf26a8821 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -115,8 +115,7 @@ public static string EncodeParameter(string value) public static partial string EncryptParameter(string value) => EncryptParameter(Globals.GetCurrentServiceProvider().GetRequiredService(), value); -#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved - /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . + /// Encrypt a parameter for placing in a URL. Encrypted using the current portal's . /// The cryptography provider. /// The value to encrypt. /// The encrypted value. From f3749412f79b4fb5e64978a71c551b8270244d9c Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 25 Jun 2026 20:59:32 +0200 Subject: [PATCH 22/26] Revert "Increase version of IPortalSettings interface" This reverts commit 9004c9ca1d865e2d7ae81265404589387f900761. --- .../Common/Controllers/JwtController.cs | 4 +- .../INavigationManager.cs | 8 ++-- .../Logging/IEventLogger.cs | 12 +++--- .../Portals/IPortalSettings.cs | 3 ++ .../Portals/IPortalSettingsV2.cs | 19 ---------- .../Prompt/IConsoleCommand.cs | 2 +- .../Api/Auth/ApiTokens/ApiTokenController.cs | 2 +- .../InternalServices/FileUploadController.cs | 4 +- .../DotNetNuke.Web/Prompt/ListServices.cs | 2 +- .../UI/WebControls/DnnFileUpload.cs | 2 +- .../MobileRedirect/MobileRedirectModule.cs | 2 +- .../OutputCaching/OutputCacheModule.cs | 2 +- .../UrlRewrite/DNNFriendlyUrlProvider.cs | 2 +- DNN Platform/Library/Common/Globals.cs | 14 +++---- .../Library/Common/Internal/GlobalsImpl.cs | 4 +- .../Library/Common/NavigationManager.cs | 8 ++-- .../Library/Common/Utilities/UrlUtils.cs | 2 +- .../Content/Workflow/WorkflowSecurity.cs | 4 +- .../Entities/Modules/Prompt/AddModule.cs | 2 +- .../Entities/Modules/Prompt/ListModules.cs | 2 +- .../Extensions/IPortalSettingsExtensions.cs | 4 +- .../Entities/Portals/IPortalController.cs | 2 +- .../Entities/Portals/PortalController.cs | 2 +- .../Entities/Portals/PortalSettings.cs | 38 +++++++++---------- .../Urls/AdvancedFriendlyUrlProvider.cs | 2 +- .../Entities/Urls/BasicFriendlyUrlProvider.cs | 4 +- .../Entities/Urls/FriendlyUrlController.cs | 4 +- .../Entities/Urls/FriendlyUrlProviderBase.cs | 2 +- .../Entities/Urls/RewriteController.cs | 4 +- .../Users/Profile/ProfilePropertyAccess.cs | 6 +-- .../Library/Entities/Users/UserController.cs | 2 +- .../JavaScriptLibraries/JavaScript.cs | 16 ++++---- .../Library/Obsolete/EventLogController.cs | 24 ++++++------ DNN Platform/Library/Prompt/ConsoleCommand.cs | 4 +- .../Library/Security/PortalSecurity.cs | 16 ++++---- .../Library/Security/Roles/RoleController.cs | 10 ++--- .../Library/Services/FileSystem/FileInfo.cs | 2 +- .../Library/Services/FileSystem/FolderInfo.cs | 2 +- .../Installer/Packages/PackageController.cs | 2 +- .../Localization/Internal/LocalizationImpl.cs | 4 +- .../Services/Localization/Localization.cs | 20 +++++----- .../Localization/LocalizationProvider.cs | 2 +- .../Log/EventLog/EventLogController.cs | 12 +++--- .../Log/EventLog/IEventLogController.cs | 10 ++--- .../Services/Mail/SendTokenizedBulkEmail.cs | 2 +- .../Controllers/UserResultController.cs | 2 +- .../Services/Sitemap/CoreSitemapProvider.cs | 2 +- .../Services/Sitemap/SitemapBuilder.cs | 6 +-- .../Scheduler/CoreMessagingScheduler.cs | 2 +- .../Url/FriendlyUrl/FriendlyUrlProvider.cs | 4 +- .../Library/UI/Containers/ActionManager.cs | 2 +- .../Services/SubscriptionsController.cs | 2 +- DNN Platform/Modules/DDRMenu/MenuBase.cs | 6 +-- .../DNNConnect.CKE/Browser/Browser.aspx.cs | 6 +-- .../DNNConnect.CKE/CKEditorOptions.ascx.cs | 6 +-- .../DNNConnect.CKE/Options.aspx.cs | 8 ++-- .../DNNConnect.CKE/Utilities/SettingsUtil.cs | 8 ++-- .../DNNConnect.CKE/Utilities/Utility.cs | 10 ++--- .../Common/NavigationManagerTests.cs | 4 +- .../AdminLogs/AdminLogsController.cs | 2 +- .../Components/Pages/BulkPagesController.cs | 2 +- .../Security/Checks/CheckUserProfilePage.cs | 4 +- .../Components/Security/SecurityController.cs | 2 +- .../Components/Sites/SitesController.cs | 2 +- .../Components/Users/Dto/UserBasicDto.cs | 2 +- .../Controllers/TabsController.cs | 2 +- .../Checks/CheckUserProfilePageTests.cs | 4 +- 67 files changed, 184 insertions(+), 200 deletions(-) delete mode 100644 DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs index 34064e306d5..ea18e9ec363 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs @@ -164,7 +164,7 @@ public LoginResultData LoginUser(HttpRequestMessage request, LoginData loginData } var obsoletePortalSettings = PortalSettings.Current; - IPortalSettingsV2 portalSettings = obsoletePortalSettings; + IPortalSettings portalSettings = obsoletePortalSettings; if (portalSettings == null) { Logger.Trace("portalSettings = null"); @@ -533,7 +533,7 @@ private LoginResultData UpdateToken(string renewalToken, PersistedToken persiste persistedToken.TokenExpiry = expiry; var obsoletePortalSettings = PortalSettings.Current; - IPortalSettingsV2 portalSettings = obsoletePortalSettings; + IPortalSettings portalSettings = obsoletePortalSettings; IPortalAliasInfo portalAlias = obsoletePortalSettings.PortalAlias; var secret = ObtainSecret(persistedToken.TokenId, portalSettings.GUID, userInfo.Membership.LastPasswordChangeDate); var accessToken = CreateJwtToken(secret, portalAlias.HttpAlias, persistedToken, userInfo.Roles); diff --git a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs index 06240060a2f..8bf5981a165 100644 --- a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs +++ b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs @@ -53,7 +53,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters); + string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -62,7 +62,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -72,7 +72,7 @@ public interface INavigationManager /// The language code. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters); /// Gets the URL to show the given page. /// The tab ID. @@ -83,6 +83,6 @@ public interface INavigationManager /// The page name to pass. /// Any additional parameters. /// Formatted url. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, string pageName, params string[] additionalParameters); + string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters); } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs b/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs index 2a2b2339035..d3892445f68 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Logging/IEventLogger.cs @@ -23,7 +23,7 @@ public interface IEventLogger /// The portal settings. /// The user id. /// The log type. - void AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, EventLogType logType); + void AddLog(string name, string value, IPortalSettings portalSettings, int userID, EventLogType logType); /// Adds an Event Log. /// The log property name. @@ -31,7 +31,7 @@ public interface IEventLogger /// The portal settings. /// The user id. /// The log type. - void AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, string logType); + void AddLog(string name, string value, IPortalSettings portalSettings, int userID, string logType); /// Adds an Event Log. /// The properties of the log. @@ -39,13 +39,13 @@ public interface IEventLogger /// The user id. /// The log type key. /// The bypass buffering. - void AddLog(ILogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering); + void AddLog(ILogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering); /// Adds an Event Log. /// The portal settings. /// The user id. /// The log type. - void AddLog(IPortalSettingsV2 portalSettings, int userID, EventLogType logType); + void AddLog(IPortalSettings portalSettings, int userID, EventLogType logType); /// Adds an Event Log. /// The business object. @@ -53,7 +53,7 @@ public interface IEventLogger /// The user id. /// The user name. /// The log type. - void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogType logType); + void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogType logType); /// Adds an Event Log. /// The business object. @@ -61,7 +61,7 @@ public interface IEventLogger /// The user id. /// The user name. /// The log type. - void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType); + void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType); /// Adds an Event Log. /// The log info. diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 2da449d9001..48984d065b3 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -361,5 +361,8 @@ public interface IPortalSettings /// Gets a value indicating whether to display the dropdowns to quickly add a moduel to the page in the edit bar. bool ShowQuickModuleAddMenu { get; } + + /// Gets the pipeline type for the portal. + PagePipeline.PortalRenderingPipeline PagePipeline { get; } } } diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs deleted file mode 100644 index ceead420b83..00000000000 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettingsV2.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information - -namespace DotNetNuke.Abstractions.Portals -{ - using DotNetNuke.Abstractions.Framework; - - /// - /// The PortalSettings class encapsulates all of the settings for the Portal, - /// as well as the configuration settings required to execute the current tab - /// view within the portal. - /// - public interface IPortalSettingsV2 : IPortalSettings - { - /// Gets the pipeline type for the portal. - PagePipeline.PortalRenderingPipeline PagePipeline { get; } - } -} diff --git a/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs b/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs index a06de09090a..8cce25bc5f6 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Prompt/IConsoleCommand.cs @@ -25,7 +25,7 @@ public interface IConsoleCommand /// PortalSettings for the portal we're operating under or if PortalId is specified, that portal. /// Current user. /// Current page/tab. - void Initialize(string[] args, Portals.IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId); + void Initialize(string[] args, Portals.IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId); /// The main method of the command which executes it. /// A class used by the client to display results. diff --git a/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs b/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs index c2fcee37b41..ecc0752254c 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Auth/ApiTokens/ApiTokenController.cs @@ -63,7 +63,7 @@ public ApiTokenController(IApiTokenRepository apiTokenRepository, IEventLogger e /// public string SchemeType => "ApiToken"; - private static Abstractions.Portals.IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static Abstractions.Portals.IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); /// public (ApiToken Token, UserInfo User) ValidateToken(HttpRequestMessage request) diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs index 07e08e23455..06cece5d667 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs @@ -170,7 +170,7 @@ public Task PostFile() var provider = new MultipartMemoryStreamProvider(); // local references for use in closure - IPortalSettingsV2 portalSettings = this.PortalSettings; + IPortalSettings portalSettings = this.PortalSettings; var currentSynchronizationContext = SynchronizationContext.Current; var userInfo = this.UserInfo; var task = request.Content.ReadAsMultipartAsync(provider) @@ -435,7 +435,7 @@ private static SavedFileDTO SaveFile( IApplicationStatusInfo appStatus, IPortalGroupController portalGroupController, IHostSettings hostSettings, - IPortalSettingsV2 portalSettings, + IPortalSettings portalSettings, UserInfo userInfo, string folder, string filter, diff --git a/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs b/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs index 1ae1d38274d..059ec1fa912 100644 --- a/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs +++ b/DNN Platform/DotNetNuke.Web/Prompt/ListServices.cs @@ -21,7 +21,7 @@ public class ListServices : ConsoleCommand public override string LocalResourceFile => Constants.DefaultPromptResourceFile; /// - public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); if (!userInfo.IsSuperUser) diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs index 8968908ff22..ee6ced9498a 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs @@ -130,7 +130,7 @@ protected override void OnPreRender(EventArgs e) this.RegisterStartupScript(); } - private static void RegisterClientScript(IClientResourceController clientResourceController, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string skin) + private static void RegisterClientScript(IClientResourceController clientResourceController, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string skin) { DnnDropDownList.RegisterClientScript(clientResourceController, skin); diff --git a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs index 969c1d64771..6b1ca759504 100644 --- a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs +++ b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs @@ -114,7 +114,7 @@ public void OnBeginRequest(object s, EventArgs e) app.Response.Redirect(redirectUrl); } - private bool IsRedirectAllowed(string url, HttpApplication app, IPortalSettingsV2 portalSettings) + private bool IsRedirectAllowed(string url, HttpApplication app, IPortalSettings portalSettings) { var urlAction = new UrlAction(app.Request); urlAction.SetRedirectAllowed(url, new FriendlyUrlSettings(this.portalController, this.hostSettings, this.hostSettingsService, portalSettings.PortalId)); diff --git a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs index 6d28c298e69..ab7e663a4aa 100644 --- a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs +++ b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs @@ -88,7 +88,7 @@ private void OnResolveRequestCache(object sender, EventArgs e) } int portalId = portalSettings.PortalId; - string locale = Localization.GetPageLocale((IPortalSettingsV2)portalSettings).Name; + string locale = Localization.GetPageLocale((IPortalSettings)portalSettings).Name; IncludeExcludeType includeExclude = IncludeExcludeType.ExcludeByDefault; if (tabSettings["CacheIncludeExclude"] != null && !string.IsNullOrEmpty(tabSettings["CacheIncludeExclude"].ToString())) diff --git a/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs b/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs index 65ff58a4c8e..9859fd8cc15 100644 --- a/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs +++ b/DNN Platform/HttpModules/UrlRewrite/DNNFriendlyUrlProvider.cs @@ -73,7 +73,7 @@ public DNNFriendlyUrlProvider() public override string FriendlyUrl(TabInfo tab, string path, string pageName) => this.providerInstance.FriendlyUrl(tab, path, pageName); /// - public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) => this.providerInstance.FriendlyUrl(tab, path, pageName, settings); + public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) => this.providerInstance.FriendlyUrl(tab, path, pageName, settings); /// public override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) => this.providerInstance.FriendlyUrl(tab, path, pageName, portalAlias); diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index 60f15ef630b..a58dc8af5f7 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -2344,7 +2344,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName) [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public static partial string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) { - return FriendlyUrl(tab, path, (IPortalSettingsV2)settings); + return FriendlyUrl(tab, path, (IPortalSettings)settings); } /// Generates the correctly formatted friendly URL. @@ -2355,7 +2355,7 @@ public static partial string FriendlyUrl(TabInfo tab, string path, PortalSetting /// The path to format. /// The portal settings. /// The formatted (friendly) URL. - public static string FriendlyUrl(TabInfo tab, string path, IPortalSettingsV2 settings) + public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings settings) { return FriendlyUrl(tab, path, glbDefaultPage, settings); } @@ -2373,7 +2373,7 @@ public static string FriendlyUrl(TabInfo tab, string path, IPortalSettingsV2 set [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public static partial string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); + return FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); } /// Generates the correctly formatted friendly URL. @@ -2386,7 +2386,7 @@ public static partial string FriendlyUrl(TabInfo tab, string path, string pageNa /// The page to include in the URL. /// The portal settings. /// The formatted (friendly) url. - public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) + public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { return FriendlyUrlProvider.Instance().FriendlyUrl(tab, path, pageName, settings); } @@ -2553,7 +2553,7 @@ public static string LoginURL(string returnUrl, bool overrideSetting) [DnnDeprecated(9, 8, 1, "Use the overload that takes IPortalSettings instead")] public static partial string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings) { - return LoginURL(returnUrl, overrideSetting, (IPortalSettingsV2)portalSettings); + return LoginURL(returnUrl, overrideSetting, (IPortalSettings)portalSettings); } /// Gets the login URL. @@ -2561,7 +2561,7 @@ public static partial string LoginURL(string returnUrl, bool overrideSetting, Po /// if set to , show the login control on the current page, even if there is a login page defined for the site. /// The Portal Settings. /// Formatted URL. - public static string LoginURL(string returnUrl, bool overrideSetting, IPortalSettingsV2 portalSettings) + public static string LoginURL(string returnUrl, bool overrideSetting, IPortalSettings portalSettings) { string loginUrl; var currentTabId = TabController.CurrentPage.TabID; @@ -3573,7 +3573,7 @@ public static partial string PreventSQLInjection(string strSQL) /// if set to [is super tab]. /// The settings. /// return the tab's culture code, if ths tab doesn't exist, it will return current culture name. - internal static string GetCultureCode(int tabId, bool isSuperTab, IPortalSettingsV2 settings) + internal static string GetCultureCode(int tabId, bool isSuperTab, IPortalSettings settings) { string cultureCode = Null.NullString; if (settings != null) diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 5d48f84b246..5804b8fa314 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -282,13 +282,13 @@ public string FriendlyUrl(TabInfo tab, string path, string pageName) /// public string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) { - return Globals.FriendlyUrl(tab, path, (IPortalSettingsV2)settings); + return Globals.FriendlyUrl(tab, path, (IPortalSettings)settings); } /// public string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return Globals.FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); + return Globals.FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); } /// diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs index c1b665d825a..5f795d435f1 100644 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -111,7 +111,7 @@ public string NavigateURL(int tabID, string controlKey, params string[] addition /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters) { var isSuperTab = Globals.IsHostTab(tabID); return this.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); @@ -124,7 +124,7 @@ public string NavigateURL(int tabID, IPortalSettingsV2 settings, string controlK /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) { var cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); return this.NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); @@ -138,7 +138,7 @@ public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings /// The language code. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters) { return this.NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); } @@ -152,7 +152,7 @@ public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings /// The page name to pass to . /// Any additional parameters. /// Formatted url. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettingsV2 settings, string controlKey, string language, string pageName, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { var url = tabID == Null.NullInteger ? Globals.ApplicationURL() : Globals.ApplicationURL(tabID); if (!string.IsNullOrEmpty(controlKey)) diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index dbbf26a8821..6f2f07340b5 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -556,7 +556,7 @@ public static void Handle404Exception(HttpResponse response, PortalSettings port /// Redirect current response to 404 error page or output 404 content if error page not defined. /// The response. /// The portal settings. - public static void Handle404Exception(HttpResponseBase response, IPortalSettingsV2 portalSetting) + public static void Handle404Exception(HttpResponseBase response, IPortalSettings portalSetting) { if (portalSetting?.ErrorPage404 > Null.NullInteger) { diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs index 2af5f436b42..05f86d258fe 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs @@ -41,10 +41,10 @@ public WorkflowSecurity() /// [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", Justification = "Breaking change")] public bool HasStateReviewerPermission(PortalSettings settings, UserInfo user, int stateId) - => this.HasStateReviewerPermission((IPortalSettingsV2)settings, user, stateId); + => this.HasStateReviewerPermission((IPortalSettings)settings, user, stateId); /// - public bool HasStateReviewerPermission(IPortalSettingsV2 settings, UserInfo user, int stateId) + public bool HasStateReviewerPermission(IPortalSettings settings, UserInfo user, int stateId) { var permissions = this.statePermissionsRepository.GetWorkflowStatePermissionByState(stateId); diff --git a/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs b/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs index 51e15d9b371..847f921a954 100644 --- a/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs +++ b/DNN Platform/Library/Entities/Modules/Prompt/AddModule.cs @@ -42,7 +42,7 @@ public class AddModule : ConsoleCommand public string ModuleTitle { get; set; } // title for the new module. defaults to friendly name /// - public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); this.ParseParameters(this); diff --git a/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs b/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs index 1ca6288e8c2..55bfbc372b8 100644 --- a/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs +++ b/DNN Platform/Library/Entities/Modules/Prompt/ListModules.cs @@ -40,7 +40,7 @@ public class ListModules : ConsoleCommand public bool? Deleted { get; set; } /// - public override void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) + public override void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) { base.Initialize(args, portalSettings, userInfo, activeTabId); this.ParseParameters(this); diff --git a/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs b/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs index 4e5e2fc18e1..9518c2fd467 100644 --- a/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs +++ b/DNN Platform/Library/Entities/Portals/Extensions/IPortalSettingsExtensions.cs @@ -7,7 +7,7 @@ namespace DotNetNuke.Entities.Portals.Extensions using DotNetNuke.Abstractions.Portals; /// - /// Extends the interface. + /// Extends the interface. /// public static class IPortalSettingsExtensions { @@ -16,7 +16,7 @@ public static class IPortalSettingsExtensions /// /// The portal settings to the the styles from. /// . - public static IPortalStyles GetStyles(this IPortalSettingsV2 portalSettings) + public static IPortalStyles GetStyles(this IPortalSettings portalSettings) { var repo = new PortalStylesRepository(); return repo.GetSettings(portalSettings.PortalId); diff --git a/DNN Platform/Library/Entities/Portals/IPortalController.cs b/DNN Platform/Library/Entities/Portals/IPortalController.cs index d20b6046e90..aa50d25cd91 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalController.cs @@ -102,7 +102,7 @@ public interface IPortalController /// Gets the current portal settings. /// portal settings. - IPortalSettingsV2 GetCurrentSettings(); + IPortalSettings GetCurrentSettings(); /// Gets information of a portal. /// ID of the portal. diff --git a/DNN Platform/Library/Entities/Portals/PortalController.cs b/DNN Platform/Library/Entities/Portals/PortalController.cs index bf651d62250..bbab9980100 100644 --- a/DNN Platform/Library/Entities/Portals/PortalController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalController.cs @@ -53,7 +53,7 @@ namespace DotNetNuke.Entities.Portals using Microsoft.Extensions.DependencyInjection; - using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettingsV2; + using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettings; using ICryptographyProvider = DotNetNuke.Abstractions.Security.ICryptographyProvider; /// PortalController provides business layer of portal. diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index 021d1048cb0..a84c0b8d279 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -25,7 +25,7 @@ namespace DotNetNuke.Entities.Portals /// view within the portal. /// [Serializable] - public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettingsV2 + public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettings { /// Initializes a new instance of the class. public PortalSettings() @@ -558,44 +558,44 @@ public string AddCompatibleHttpHeader /// public PagePipeline.PortalRenderingPipeline PagePipeline { get; internal set; } - /// Create an instance. - /// A new instance. - public static IPortalSettingsV2 Create() + /// Create an instance. + /// A new instance. + public static IPortalSettings Create() => new PortalSettings(); - /// Create an instance. + /// Create an instance. /// A portal controller. /// The portal ID. - /// A new instance. - public static IPortalSettingsV2 Create(IPortalController portalController, int portalId) + /// A new instance. + public static IPortalSettings Create(IPortalController portalController, int portalId) => new PortalSettings(Null.NullInteger, portalController.GetPortal(portalId)); - /// Create an instance. + /// Create an instance. /// A portal controller. /// The active tab ID. /// The portal ID. - /// A new instance. - public static IPortalSettingsV2 Create(IPortalController portalController, int tabId, int portalId) + /// A new instance. + public static IPortalSettings Create(IPortalController portalController, int tabId, int portalId) => new PortalSettings(tabId, portalController.GetPortal(portalId)); - /// Create an instance. + /// Create an instance. /// The active tab ID. /// The portal alias. - /// A new instance. - public static IPortalSettingsV2 Create(int tabId, IPortalAliasInfo portalAlias) + /// A new instance. + public static IPortalSettings Create(int tabId, IPortalAliasInfo portalAlias) => portalAlias is PortalAliasInfo alias ? new PortalSettings(tabId, alias) : new PortalSettings(tabId, portalAlias.PortalId); - /// Create an instance. + /// Create an instance. /// The portal info. - /// A new instance. - public static IPortalSettingsV2 Create(IPortalInfo portal) + /// A new instance. + public static IPortalSettings Create(IPortalInfo portal) => portal is PortalInfo portalInfo ? new PortalSettings(portalInfo) : new PortalSettings(Null.NullInteger, portal.PortalId); - /// Create an instance. + /// Create an instance. /// The tab ID. /// The portal info. - /// A new instance. - public static IPortalSettingsV2 Create(int tabId, IPortalInfo portal) + /// A new instance. + public static IPortalSettings Create(int tabId, IPortalInfo portal) => portal is PortalInfo portalInfo ? new PortalSettings(tabId, portalInfo) : new PortalSettings(tabId, portal.PortalId); /// diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index c5ee1a25248..720d7e184e0 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -212,7 +212,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) } /// - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 portalSettings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings) { if (portalSettings == null) { diff --git a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs index c0ce9a6962f..b23c9706199 100644 --- a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs @@ -65,7 +65,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) } /// - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { IPortalAliasInfo portalAliasInfo = ((PortalSettings)settings)?.PortalAlias; return this.FriendlyUrl(tab, path, pageName, portalAliasInfo?.HttpAlias, settings); @@ -306,7 +306,7 @@ private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) return AddPage(friendlyPath, pageName); } - private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettingsV2 portalSettings) + private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettings portalSettings) { string friendlyPath = path; bool isPagePath = tab != null; diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs index 39146ac60b7..3b896db2cad 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs @@ -135,9 +135,9 @@ public static TabInfo GetTab(int tabId, bool addStdUrls) } public static TabInfo GetTab(int tabId, bool addStdUrls, PortalSettings portalSettings, FriendlyUrlSettings settings) - => GetTab(tabId, addStdUrls, (IPortalSettingsV2)portalSettings, settings); + => GetTab(tabId, addStdUrls, (IPortalSettings)portalSettings, settings); - public static TabInfo GetTab(int tabId, bool addStdUrls, IPortalSettingsV2 portalSettings, FriendlyUrlSettings settings) + public static TabInfo GetTab(int tabId, bool addStdUrls, IPortalSettings portalSettings, FriendlyUrlSettings settings) { TabInfo tab = TabController.Instance.GetTab(tabId, portalSettings.PortalId, false); if (addStdUrls) diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs index 73f12e8e037..64a9ea64ec7 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs @@ -41,7 +41,7 @@ internal FriendlyUrlProviderBase(NameValueCollection attributes) internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName); - internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 portalSettings); + internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings); internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias); } diff --git a/DNN Platform/Library/Entities/Urls/RewriteController.cs b/DNN Platform/Library/Entities/Urls/RewriteController.cs index 6c25016fe34..6801528e34d 100644 --- a/DNN Platform/Library/Entities/Urls/RewriteController.cs +++ b/DNN Platform/Library/Entities/Urls/RewriteController.cs @@ -960,7 +960,7 @@ internal static bool IdentifyByTabPathEx( PortalInfo portal = CacheController.GetPortal(result.PortalId, false); // DNN-3789 - culture is defined by GetPageLocale - IPortalSettingsV2 portalSettings = new PortalSettings(result.TabId, result.PortalAlias); + IPortalSettings portalSettings = new PortalSettings(result.TabId, result.PortalAlias); string currentLocale = Localization.GetPageLocale(portalSettings).Name; if (portal != null && !string.IsNullOrEmpty(currentLocale)) { @@ -1816,7 +1816,7 @@ private static bool CheckTabPath(IHostSettings hostSettings, IPortalController p var currentLocale = result.CultureCode; if (string.IsNullOrEmpty(currentLocale)) { - IPortalSettingsV2 portalSettings = new PortalSettings(result.PortalId); + IPortalSettings portalSettings = new PortalSettings(result.PortalId); currentLocale = Localization.GetPageLocale(portalSettings).Name; } diff --git a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs index 9d939d0a1ae..88d49e47193 100644 --- a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs +++ b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs @@ -59,7 +59,7 @@ public CacheLevel Cacheability [DnnDeprecated(9, 8, 0, "Use the overload that takes IPortalSettings instead")] public static partial bool CheckAccessLevel(PortalSettings portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) { - var portalSettingsAsInterface = (IPortalSettingsV2)portalSettings; + var portalSettingsAsInterface = (IPortalSettings)portalSettings; return CheckAccessLevel(portalSettingsAsInterface, property, accessingUser, targetUser); } @@ -69,7 +69,7 @@ public static partial bool CheckAccessLevel(PortalSettings portalSettings, Profi /// The accessing user. /// The target user. /// if property accessible, otherwise . - public static bool CheckAccessLevel(IPortalSettingsV2 portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) + public static bool CheckAccessLevel(IPortalSettings portalSettings, ProfilePropertyDefinition property, UserInfo accessingUser, UserInfo targetUser) { var isAdminUser = IsAdminUser(portalSettings, accessingUser, targetUser); @@ -258,7 +258,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format return string.Empty; } - private static bool IsAdminUser(IPortalSettingsV2 portalSettings, UserInfo accessingUser, UserInfo targetUser) + private static bool IsAdminUser(IPortalSettings portalSettings, UserInfo accessingUser, UserInfo targetUser) { bool isAdmin = false; diff --git a/DNN Platform/Library/Entities/Users/UserController.cs b/DNN Platform/Library/Entities/Users/UserController.cs index ab65d687968..9550f941d0d 100644 --- a/DNN Platform/Library/Entities/Users/UserController.cs +++ b/DNN Platform/Library/Entities/Users/UserController.cs @@ -2089,7 +2089,7 @@ internal static void UpdateUser(IEventLogger eventLogger, int portalId, UserInfo if (loggedAction) { // if the HttpContext is null, then get portal settings by portal id. - IPortalSettingsV2 portalSettings = null; + IPortalSettings portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs index 383cd7f90d9..8bbf8dde359 100644 --- a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs +++ b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScript.cs @@ -135,7 +135,7 @@ public static partial void RequestRegistration(string jsname) /// The event logger. /// The portal settings. /// the library name. - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -165,7 +165,7 @@ public static partial void RequestRegistration(string jsname, Version version) /// The portal settings. /// the library name. /// the library's version. - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -200,7 +200,7 @@ public static partial void RequestRegistration(string jsname, Version version, S /// When is passed, match the major and minor versions. /// When is passed, match all parts of the version. /// - public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version, SpecificVersion specific) + public static void RequestRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version, SpecificVersion specific) { appStatus ??= Globals.GetCurrentServiceProvider().GetRequiredService(); eventLogger ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -241,7 +241,7 @@ public static partial void Register(Page page) /// The event logger. /// The portal settings. /// reference to the current page. - public static void Register(IHostSettings hostSettings, IHostSettingsService hostSettingsService, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, Page page) + public static void Register(IHostSettings hostSettings, IHostSettingsService hostSettingsService, IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, Page page) { hostSettings ??= Globals.GetCurrentServiceProvider().GetRequiredService(); hostSettingsService ??= Globals.GetCurrentServiceProvider().GetRequiredService(); @@ -397,7 +397,7 @@ private static void RequestHighestVersionLibraryRegistration(IApplicationStatusI } } - private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version, SpecificVersion specific) + private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInfo appStatus, IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version, SpecificVersion specific) { Func isValidLibrary = specific == SpecificVersion.LatestMajor ? l => l.Version.Major == version.Major && l.Version.Minor >= version.Minor @@ -423,7 +423,7 @@ private static bool RequestLooseVersionLibraryRegistration(IApplicationStatusInf return false; } - private static void RequestSpecificVersionLibraryRegistration(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string jsname, Version version) + private static void RequestSpecificVersionLibraryRegistration(IEventLogger eventLogger, IPortalSettings portalSettings, string jsname, Version version) { var library = JavaScriptLibraryController.Instance.GetLibrary(l => l.LibraryName.Equals(jsname, StringComparison.OrdinalIgnoreCase) && l.Version == version); if (library != null) @@ -465,7 +465,7 @@ private static void AddPreInstallOrLegacyItemRequest(string jsl) HttpContextSource.Current.Items[LegacyPrefix + jsl] = true; } - private static List ResolveVersionConflicts(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, IEnumerable scripts) + private static List ResolveVersionConflicts(IEventLogger eventLogger, IPortalSettings portalSettings, IEnumerable scripts) { var finalScripts = new List(); foreach (var libraryId in scripts) @@ -615,7 +615,7 @@ private static IEnumerable GetAllDependencies(IApplicationSta } } - private static void LogCollision(IEventLogger eventLogger, IPortalSettingsV2 portalSettings, string collisionText) + private static void LogCollision(IEventLogger eventLogger, IPortalSettings portalSettings, string collisionText) { // need to log an event eventLogger.AddLog( diff --git a/DNN Platform/Library/Obsolete/EventLogController.cs b/DNN Platform/Library/Obsolete/EventLogController.cs index 585fb3cc8ae..93179605ce0 100644 --- a/DNN Platform/Library/Obsolete/EventLogController.cs +++ b/DNN Platform/Library/Obsolete/EventLogController.cs @@ -525,61 +525,61 @@ public partial void AddLog(string propertyName, string propertyValue, EventLogTy /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, EventLogType logType) => - this.AddLog(propertyName, propertyValue, (IPortalSettingsV2)portalSettings, userID, logType); + this.AddLog(propertyName, propertyValue, (IPortalSettings)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, EventLogType logType) => + public partial void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, EventLogType logType) => this.EventLogger.AddLog(propertyName, propertyValue, portalSettings, userID, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, string logType) => - this.AddLog(propertyName, propertyValue, (IPortalSettingsV2)portalSettings, userID, logType); + this.AddLog(propertyName, propertyValue, (IPortalSettings)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, string logType) => + public partial void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, string logType) => this.EventLogger.AddLog(propertyName, propertyValue, portalSettings, userID, logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(LogProperties properties, PortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) => - this.AddLog(properties, (IPortalSettingsV2)portalSettings, userID, logTypeKey, bypassBuffering); + this.AddLog(properties, (IPortalSettings)portalSettings, userID, logTypeKey, bypassBuffering); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(LogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering) => + public partial void AddLog(LogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) => this.EventLogger.AddLog(properties, portalSettings, userID, logTypeKey, bypassBuffering); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(PortalSettings portalSettings, int userID, EventLogType logType) => - this.AddLog((IPortalSettingsV2)portalSettings, userID, logType); + this.AddLog((IPortalSettings)portalSettings, userID, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(IPortalSettingsV2 portalSettings, int userID, EventLogType logType) => + public partial void AddLog(IPortalSettings portalSettings, int userID, EventLogType logType) => this.EventLogger.AddLog(portalSettings, userID, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, EventLogType logType) => - this.AddLog(businessObject, (IPortalSettingsV2)portalSettings, userID, userName, logType); + this.AddLog(businessObject, (IPortalSettings)portalSettings, userID, userName, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogType logType) => + public partial void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogType logType) => this.EventLogger.AddLog(businessObject, portalSettings, userID, userName, (Abstractions.Logging.EventLogType)logType); /// [DnnDeprecated(9, 7, 0, "It has been replaced by the overload taking IPortalSettings")] public partial void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, string logType) => - this.AddLog(businessObject, (IPortalSettingsV2)portalSettings, userID, userName, logType); + this.AddLog(businessObject, (IPortalSettings)portalSettings, userID, userName, logType); /// [DnnDeprecated(9, 8, 0, "Use Dependency Injection to resolve 'DotNetNuke.Abstractions.Logging.IEventLogger' instead")] - public partial void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType) => + public partial void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType) => this.EventLogger.AddLog(businessObject, portalSettings, userID, userName, logType); /// diff --git a/DNN Platform/Library/Prompt/ConsoleCommand.cs b/DNN Platform/Library/Prompt/ConsoleCommand.cs index f147971ec42..37a159d8efd 100644 --- a/DNN Platform/Library/Prompt/ConsoleCommand.cs +++ b/DNN Platform/Library/Prompt/ConsoleCommand.cs @@ -28,7 +28,7 @@ public abstract class ConsoleCommand : IConsoleCommand public virtual string ResultHtml => this.LocalizeString($"Prompt_{this.GetType().Name}_ResultHtml"); /// Gets the portal settings. - protected IPortalSettingsV2 PortalSettings { get; private set; } + protected IPortalSettings PortalSettings { get; private set; } /// Gets the current user. protected IUserInfo User { get; private set; } @@ -49,7 +49,7 @@ public abstract class ConsoleCommand : IConsoleCommand Common.Globals.GetCurrentServiceProvider().GetRequiredService(); /// - public virtual void Initialize(string[] args, IPortalSettingsV2 portalSettings, IUserInfo userInfo, int activeTabId) + public virtual void Initialize(string[] args, IPortalSettings portalSettings, IUserInfo userInfo, int activeTabId) { this.Args = args; this.PortalSettings = portalSettings; diff --git a/DNN Platform/Library/Security/PortalSecurity.cs b/DNN Platform/Library/Security/PortalSecurity.cs index 0919c8f1839..f987b98c51a 100644 --- a/DNN Platform/Library/Security/PortalSecurity.cs +++ b/DNN Platform/Library/Security/PortalSecurity.cs @@ -298,14 +298,14 @@ public static bool IsDenied(string roles) /// The semicolon separated list of roles. /// if the specified user is denied; otherwise, . public static bool IsDenied(UserInfo objUserInfo, PortalSettings settings, string roles) - => IsDenied(objUserInfo, (IPortalSettingsV2)settings, roles); + => IsDenied(objUserInfo, (IPortalSettings)settings, roles); /// Determines whether the specified user is denied for the given roles. /// The user information. /// The settings. /// The semicolon separated list of roles. /// if the specified user is denied; otherwise, . - public static bool IsDenied(UserInfo objUserInfo, IPortalSettingsV2 settings, string roles) + public static bool IsDenied(UserInfo objUserInfo, IPortalSettings settings, string roles) { // superuser always has full access if (objUserInfo.IsSuperUser) @@ -373,14 +373,14 @@ public static bool IsInRoles(string roles) /// if the provided user belongs to the specific roles; otherwise, . [DnnDeprecated(10, 0, 2, "Use overload taking IPortalSettings")] public static partial bool IsInRoles(UserInfo objUserInfo, PortalSettings settings, string roles) - => IsInRoles(objUserInfo, (IPortalSettingsV2)settings, roles); + => IsInRoles(objUserInfo, (IPortalSettings)settings, roles); /// Determines whether the provided user belongs to the specified roles. /// The user information. /// The settings. /// The semicolon separated list of roles. /// if the provided user belongs to the specific roles; otherwise, . - public static bool IsInRoles(UserInfo objUserInfo, IPortalSettingsV2 settings, string roles) + public static bool IsInRoles(UserInfo objUserInfo, IPortalSettings settings, string roles) { if (objUserInfo.IsSuperUser) { @@ -592,7 +592,7 @@ public string Replace(string inputString, ConfigType configType, string configSo const RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline; const string listName = "ProfanityFilter"; - IPortalSettingsV2 settings; + IPortalSettings settings; IEnumerable listEntryHostInfos; IEnumerable listEntryPortalInfos; @@ -649,7 +649,7 @@ public string Remove(string inputString, ConfigType configType, string configSou const RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline; const string listName = "ProfanityFilter"; - IPortalSettingsV2 settings; + IPortalSettings settings; IEnumerable listEntryHostInfos; IEnumerable listEntryPortalInfos; @@ -907,7 +907,7 @@ public void CheckAllPortalFileExtensionWhitelists(string newMasterList) } } - private static void ProcessRole(UserInfo user, IPortalSettingsV2 settings, string roleName, out bool? roleAllowed) + private static void ProcessRole(UserInfo user, IPortalSettings settings, string roleName, out bool? roleAllowed) { var roleType = GetRoleType(roleName); switch (roleType) @@ -971,7 +971,7 @@ private static int GetEntityFromRoleName(string roleName) return Null.NullInteger; } - private static void ProcessSecurityRole(UserInfo user, IPortalSettingsV2 settings, string roleName, out bool? roleAllowed) + private static void ProcessSecurityRole(UserInfo user, IPortalSettings settings, string roleName, out bool? roleAllowed) { roleAllowed = null; diff --git a/DNN Platform/Library/Security/Roles/RoleController.cs b/DNN Platform/Library/Security/Roles/RoleController.cs index 05487b97c49..49c773d77e2 100644 --- a/DNN Platform/Library/Security/Roles/RoleController.cs +++ b/DNN Platform/Library/Security/Roles/RoleController.cs @@ -101,7 +101,7 @@ public static int AddRoleGroup(RoleGroupInfo objRoleGroupInfo) /// The portal settings. /// The RoleGroup to Add. /// The ID of the new role. - public static int AddRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroupInfo) + public static int AddRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroupInfo) { var id = roleProvider.CreateRoleGroup(roleGroupInfo); eventLogger.AddLog( @@ -238,7 +238,7 @@ public static void DeleteRoleGroup(int portalID, int roleGroupId) /// The portal ID of the role group. /// The role group ID. [Obsolete("Deprecated in DotNetNuke 10.0.2. Please use overload with RoleProvider. Scheduled removal in v12.0.0.")] - public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, int portalId, int roleGroupId) + public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, int portalId, int roleGroupId) => DeleteRoleGroup(roleProvider, eventLogger, userController, portalSettings, GetRoleGroup(portalId, roleGroupId)); /// Deletes a Role Group. @@ -258,7 +258,7 @@ public static void DeleteRoleGroup(RoleGroupInfo objRoleGroupInfo) /// The user controller. /// The portal settings. /// The RoleGroup to Delete. - public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroupInfo) + public static void DeleteRoleGroup(RoleProvider roleProvider, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroupInfo) { roleProvider.DeleteRoleGroup(roleGroupInfo); eventLogger.AddLog( @@ -418,7 +418,7 @@ public static void UpdateRoleGroup(RoleGroupInfo roleGroup) /// The user controller. /// The portal settings. /// The RoleGroup to Update. - public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroup) + public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroup) { UpdateRoleGroup(roleProvider, roleController, eventLogger, userController, portalSettings, roleGroup, false); } @@ -433,7 +433,7 @@ public static void UpdateRoleGroup(RoleGroupInfo roleGroup, bool includeRoles) roleGroup, includeRoles); - public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettingsV2 portalSettings, RoleGroupInfo roleGroup, bool includeRoles) + public static void UpdateRoleGroup(RoleProvider roleProvider, IRoleController roleController, IEventLogger eventLogger, IUserController userController, IPortalSettings portalSettings, RoleGroupInfo roleGroup, bool includeRoles) { roleProvider.UpdateRoleGroup(roleGroup); eventLogger.AddLog(roleGroup, portalSettings, userController.GetCurrentUserInfo().UserID, string.Empty, EventLogType.USER_ROLE_UPDATED); diff --git a/DNN Platform/Library/Services/FileSystem/FileInfo.cs b/DNN Platform/Library/Services/FileSystem/FileInfo.cs index a99e5be02ba..7011581c0ed 100644 --- a/DNN Platform/Library/Services/FileSystem/FileInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FileInfo.cs @@ -141,7 +141,7 @@ public string PhysicalPath get { string physicalPath = Null.NullString; - IPortalSettingsV2 portalSettings = null; + IPortalSettings portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs index d4fdef3b35a..fd843c4bb95 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs @@ -97,7 +97,7 @@ public string PhysicalPath get { string physicalPath; - IPortalSettingsV2 portalSettings = null; + IPortalSettings portalSettings = null; if (HttpContext.Current != null) { portalSettings = PortalController.Instance.GetCurrentSettings(); diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs index 44f79df5d9c..8d4f6b5227f 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs @@ -68,7 +68,7 @@ public static partial bool CanDeletePackage(PackageInfo package, PortalSettings /// The package. /// The portal settings. /// if the package can be deleted, otherwise . - public static bool CanDeletePackage(IHostSettings hostSettings, IApplicationStatusInfo appStatus, PackageInfo package, IPortalSettingsV2 portalSettings) + public static bool CanDeletePackage(IHostSettings hostSettings, IApplicationStatusInfo appStatus, PackageInfo package, IPortalSettings portalSettings) { bool bCanDelete = true; diff --git a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs index 7f3b367fdcc..3351f23c207 100644 --- a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs +++ b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs @@ -73,13 +73,13 @@ public string BestCultureCodeBasedOnBrowserLanguages(IEnumerable culture /// public CultureInfo GetPageLocale(PortalSettings portalSettings) { - return Localization.GetPageLocale((IPortalSettingsV2)portalSettings); + return Localization.GetPageLocale((IPortalSettings)portalSettings); } /// public void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings) { - Localization.SetThreadCultures(cultureInfo, (IPortalSettingsV2)portalSettings); + Localization.SetThreadCultures(cultureInfo, (IPortalSettings)portalSettings); } } } diff --git a/DNN Platform/Library/Services/Localization/Localization.cs b/DNN Platform/Library/Services/Localization/Localization.cs index 324ff0675df..e1baad4cc33 100644 --- a/DNN Platform/Library/Services/Localization/Localization.cs +++ b/DNN Platform/Library/Services/Localization/Localization.cs @@ -573,7 +573,7 @@ public static string GetLocaleName(string code, CultureDropDownTypes displayType [DnnDeprecated(9, 8, 0, "Use overload taking IPortalSettings instead")] public static partial CultureInfo GetPageLocale(PortalSettings portalSettings) { - return GetPageLocale((IPortalSettingsV2)portalSettings); + return GetPageLocale((IPortalSettings)portalSettings); } /// @@ -591,7 +591,7 @@ public static partial CultureInfo GetPageLocale(PortalSettings portalSettings) /// /// Current PortalSettings. /// A valid CultureInfo. - public static CultureInfo GetPageLocale(IPortalSettingsV2 portalSettings) + public static CultureInfo GetPageLocale(IPortalSettings portalSettings) { CultureInfo pageCulture = null; @@ -1577,7 +1577,7 @@ public static void SetLanguage(string value) [DnnDeprecated(9, 8, 0, "Use overload taking IPortalSettings instead")] public static partial void SetThreadCultures(CultureInfo cultureInfo, PortalSettings portalSettings) { - SetThreadCultures(cultureInfo, (IPortalSettingsV2)portalSettings); + SetThreadCultures(cultureInfo, (IPortalSettings)portalSettings); } /// Sets the culture codes on the current Thread. @@ -1587,7 +1587,7 @@ public static partial void SetThreadCultures(CultureInfo cultureInfo, PortalSett /// This method will configure the Thread culture codes. Any page which does not derive from should /// be sure to call this method in to ensure localization works correctly. /// - public static void SetThreadCultures(CultureInfo cultureInfo, IPortalSettingsV2 portalSettings) + public static void SetThreadCultures(CultureInfo cultureInfo, IPortalSettings portalSettings) { if (cultureInfo == null) { @@ -1888,7 +1888,7 @@ private static string GetValidLanguageUrl(int portalId, string httpAlias, string /// Tries to get a valid language from the querystring. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromQs(IPortalSettingsV2 portalSettings) + private static CultureInfo GetCultureFromQs(IPortalSettings portalSettings) { if (HttpContext.Current == null || HttpContext.Current.Request["language"] == null) { @@ -1903,7 +1903,7 @@ private static CultureInfo GetCultureFromQs(IPortalSettingsV2 portalSettings) /// Tries to get a valid language from the cookie. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromCookie(IPortalSettingsV2 portalSettings) + private static CultureInfo GetCultureFromCookie(IPortalSettings portalSettings) { CultureInfo culture; if (HttpContext.Current == null || HttpContext.Current.Request.Cookies["language"] == null) @@ -1919,7 +1919,7 @@ private static CultureInfo GetCultureFromCookie(IPortalSettingsV2 portalSettings /// Tries to get a valid language from the user profile. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromProfile(IPortalSettingsV2 portalSettings) + private static CultureInfo GetCultureFromProfile(IPortalSettings portalSettings) { UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); @@ -1936,7 +1936,7 @@ private static CultureInfo GetCultureFromProfile(IPortalSettingsV2 portalSetting /// Tries to get a valid language from the browser preferences if the portal has the setting to use browser languages enabled. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromBrowser(IPortalSettingsV2 portalSettings) + private static CultureInfo GetCultureFromBrowser(IPortalSettings portalSettings) { if (!portalSettings.EnableBrowserLanguage) { @@ -1951,7 +1951,7 @@ private static CultureInfo GetCultureFromBrowser(IPortalSettingsV2 portalSetting /// Tries to get a valid language from the portal default preferences. /// Current PortalSettings. /// A valid CultureInfo if any is found. - private static CultureInfo GetCultureFromPortal(IPortalSettingsV2 portalSettings) + private static CultureInfo GetCultureFromPortal(IPortalSettings portalSettings) { CultureInfo culture = null; if (!string.IsNullOrEmpty(portalSettings.DefaultLanguage)) @@ -1994,7 +1994,7 @@ private static List GetPortalLocalizations(int portalId) /// Current culture. /// Portal settings for the current request. /// A instance representing the user's UI culture. - private static CultureInfo GetUserUICulture(CultureInfo currentCulture, IPortalSettingsV2 portalSettings) + private static CultureInfo GetUserUICulture(CultureInfo currentCulture, IPortalSettings portalSettings) { CultureInfo uiCulture = currentCulture; try diff --git a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs index a9fce7c7adc..b803c669eb0 100644 --- a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs +++ b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs @@ -219,7 +219,7 @@ private static object GetCompiledResourceFileCallBack(CacheItemArgs cacheItemArg { var resourceFile = (string)cacheItemArgs.Params[0]; var locale = (string)cacheItemArgs.Params[1]; - var portalSettings = (IPortalSettingsV2)cacheItemArgs.Params[2]; + var portalSettings = (IPortalSettings)cacheItemArgs.Params[2]; var hostSettings = (IHostSettings)cacheItemArgs.Params[3]; string systemLanguage = Localization.SystemLocale; string defaultLanguage = portalSettings.DefaultLanguage; diff --git a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs index 40fb6a4dfdf..57f4f48a14e 100644 --- a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs @@ -33,13 +33,13 @@ void IEventLogger.AddLog(string name, string value, Abstractions.Logging.EventLo } /// - void IEventLogger.AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(string name, string value, IPortalSettings portalSettings, int userID, Abstractions.Logging.EventLogType logType) { this.EventLogger.AddLog(name, value, portalSettings, userID, logType.ToString()); } /// - void IEventLogger.AddLog(string name, string value, IPortalSettingsV2 portalSettings, int userID, string logType) + void IEventLogger.AddLog(string name, string value, IPortalSettings portalSettings, int userID, string logType) { var properties = new LogProperties(); var logDetailInfo = new LogDetailInfo { PropertyName = name, PropertyValue = value }; @@ -48,7 +48,7 @@ void IEventLogger.AddLog(string name, string value, IPortalSettingsV2 portalSett } /// - void IEventLogger.AddLog(ILogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering) + void IEventLogger.AddLog(ILogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) { // supports adding a custom string for LogType var log = new LogInfo @@ -69,19 +69,19 @@ void IEventLogger.AddLog(ILogProperties properties, IPortalSettingsV2 portalSett } /// - void IEventLogger.AddLog(IPortalSettingsV2 portalSettings, int userID, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(IPortalSettings portalSettings, int userID, Abstractions.Logging.EventLogType logType) { this.EventLogger.AddLog(new LogProperties(), portalSettings, userID, logType.ToString(), false); } /// - void IEventLogger.AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, Abstractions.Logging.EventLogType logType) + void IEventLogger.AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, Abstractions.Logging.EventLogType logType) { this.AddLog(businessObject, portalSettings, userID, userName, logType.ToString()); } /// - void IEventLogger.AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType) + void IEventLogger.AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType) { var log = new LogInfo { LogUserID = userID, LogTypeKey = logType }; if (portalSettings != null) diff --git a/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs b/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs index a1fcfc6b944..114d84d112a 100644 --- a/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/IEventLogController.cs @@ -25,9 +25,9 @@ public partial interface IEventLogController : ILogController [Obsolete("Deprecated in DotNetNuke 9.7.0. It has been replaced by the overload taking IPortalSettings. Scheduled for removal in v11.0.0.")] void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, string logType); - void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, EventLogController.EventLogType logType); + void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, EventLogController.EventLogType logType); - void AddLog(string propertyName, string propertyValue, IPortalSettingsV2 portalSettings, int userID, string logType); + void AddLog(string propertyName, string propertyValue, IPortalSettings portalSettings, int userID, string logType); void AddLog(PortalSettings portalSettings, int userID, EventLogController.EventLogType logType); @@ -40,11 +40,11 @@ public partial interface IEventLogController : ILogController [Obsolete("Deprecated in DotNetNuke 9.7.0. It has been replaced by the overload taking IPortalSettings. Scheduled for removal in v11.0.0.")] void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, string logType); - void AddLog(LogProperties properties, IPortalSettingsV2 portalSettings, int userID, string logTypeKey, bool bypassBuffering); + void AddLog(LogProperties properties, IPortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering); - void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, EventLogController.EventLogType logType); + void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, EventLogController.EventLogType logType); - void AddLog(object businessObject, IPortalSettingsV2 portalSettings, int userID, string userName, string logType); + void AddLog(object businessObject, IPortalSettings portalSettings, int userID, string userName, string logType); #pragma warning restore SA1600 // Elements should be documented } } diff --git a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs index 5826197ad7a..c251e46dfd5 100644 --- a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs +++ b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs @@ -44,7 +44,7 @@ public class SendTokenizedBulkEmail : IDisposable private UserInfo replyToUser; private bool smtpEnableSSL; private TokenReplace tokenReplace; - private IPortalSettingsV2 portalSettings; + private IPortalSettings portalSettings; private UserInfo sendingUser; private string body = string.Empty; private string confirmBodyHTML; diff --git a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs index 4b2092aa8a1..ed52266befb 100644 --- a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs +++ b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs @@ -31,7 +31,7 @@ public class UserResultController : BaseResultController /// public override string LocalizedSearchTypeName => Localization.GetString("Crawler_user", LocalizedResxFile); - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); /// public override bool HasViewPermission(SearchResult searchResult) diff --git a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs index ab065f3dea6..ac31ba03d3d 100644 --- a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs +++ b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs @@ -41,7 +41,7 @@ public override List GetUrls(int portalId, PortalSettings ps, string var currentLanguage = ps.CultureCode; if (string.IsNullOrEmpty(currentLanguage)) { - currentLanguage = Localization.GetPageLocale((IPortalSettingsV2)ps).Name; + currentLanguage = Localization.GetPageLocale((IPortalSettings)ps).Name; } var languagePublished = LocaleController.Instance.GetLocale(ps.PortalId, currentLanguage).IsPublished; diff --git a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs index 4af3738e0c3..19dab45e5b2 100644 --- a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs +++ b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs @@ -51,7 +51,7 @@ public string CacheFileName var currentCulture = this.portalSettings.CultureCode?.ToLowerInvariant(); if (string.IsNullOrEmpty(currentCulture)) { - currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); + currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); } this.cacheFileName = $"sitemap.{currentCulture}.xml"; @@ -67,7 +67,7 @@ public string CacheIndexFileNameFormat { if (string.IsNullOrEmpty(this.cacheIndexFileNameFormat)) { - var currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); + var currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); this.cacheIndexFileNameFormat = $"sitemap_{{0}}.{currentCulture}.xml"; } @@ -207,7 +207,7 @@ public void GetSitemapIndexFile(string index, TextWriter output) return; } - var currentCulture = Localization.GetPageLocale((IPortalSettingsV2)this.portalSettings).Name.ToLowerInvariant(); + var currentCulture = Localization.GetPageLocale((IPortalSettings)this.portalSettings).Name.ToLowerInvariant(); this.WriteSitemapFileToOutput($"sitemap_{theIndex}.{currentCulture}.xml", output); } diff --git a/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs b/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs index fb0ee29c9b5..cc217465921 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Scheduler/CoreMessagingScheduler.cs @@ -395,7 +395,7 @@ private static int GetMessageTab(IHostSettings hostSettings, PortalSettings send /// The tab ID for the Message Center OR the user profile page tab ID. private static object GetMessageTabCallback(CacheItemArgs cacheItemArgs) { - var portalSettings = (IPortalSettingsV2)cacheItemArgs.Params[0]; + var portalSettings = (IPortalSettings)cacheItemArgs.Params[0]; var profileTab = TabController.Instance.GetTab(portalSettings.UserTabId, portalSettings.PortalId, false); if (profileTab != null) diff --git a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs index b3d5b8ab629..586f68580e2 100644 --- a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs +++ b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs @@ -41,7 +41,7 @@ public static FriendlyUrlProvider Instance() [DnnDeprecated(9, 4, 3, "Use the IPortalSettings overload")] public virtual partial string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return this.FriendlyUrl(tab, path, pageName, (IPortalSettingsV2)settings); + return this.FriendlyUrl(tab, path, pageName, (IPortalSettings)settings); } /// Generate a friendly URL. @@ -50,7 +50,7 @@ public virtual partial string FriendlyUrl(TabInfo tab, string path, string pageN /// The page name. /// The portal settings. /// The friendly URL. - public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettingsV2 settings); + public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings); /// Generate a friendly URL. /// The page. diff --git a/DNN Platform/Library/UI/Containers/ActionManager.cs b/DNN Platform/Library/UI/Containers/ActionManager.cs index f70d715715e..d17cc7740b1 100644 --- a/DNN Platform/Library/UI/Containers/ActionManager.cs +++ b/DNN Platform/Library/UI/Containers/ActionManager.cs @@ -30,7 +30,7 @@ namespace DotNetNuke.UI.Containers /// ActionManager is a helper class that provides common Action Behaviors that can be used by any implementation. public class ActionManager { - private readonly IPortalSettingsV2 portalSettings = PortalController.Instance.GetCurrentSettings(); + private readonly IPortalSettings portalSettings = PortalController.Instance.GetCurrentSettings(); private readonly HttpRequest request = HttpContext.Current.Request; private readonly HttpResponse response = HttpContext.Current.Response; private readonly IEventLogger eventLogger; diff --git a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs index 530523a1089..3f99abf9f9f 100644 --- a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs +++ b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs @@ -178,7 +178,7 @@ public HttpResponseMessage GetLocalizationTable(string culture) { if (!string.IsNullOrEmpty(culture)) { - Localization.SetThreadCultures(new CultureInfo(culture), (IPortalSettingsV2)this.PortalSettings); + Localization.SetThreadCultures(new CultureInfo(culture), (IPortalSettings)this.PortalSettings); } var dictionary = new Dictionary(); diff --git a/DNN Platform/Modules/DDRMenu/MenuBase.cs b/DNN Platform/Modules/DDRMenu/MenuBase.cs index c4a82ed70b8..56241588bc0 100644 --- a/DNN Platform/Modules/DDRMenu/MenuBase.cs +++ b/DNN Platform/Modules/DDRMenu/MenuBase.cs @@ -75,7 +75,7 @@ public MenuBase(ILocaliser localiser, IHostSettings hostSettings, ITabController public TemplateDefinition TemplateDef { get; set; } /// Gets the portal settings for the current portal. - // TODO: In v11 we should replace this by IPortalSettingsV2 and make it private or instantiate PortalSettings in the constructor. + // TODO: In v11 we should replace this by IPortalSettings and make it private or instantiate PortalSettings in the constructor. [Obsolete("Deprecated in DotNetNuke 9.8.1. This should not have been public. Scheduled removal in v11.0.0.")] internal PortalSettings HostPortalSettings => this.hostPortalSettings ??= PortalSettings.Current; @@ -158,7 +158,7 @@ internal virtual void PreRender() { #pragma warning disable CS0618 // Type or member is obsolete - // TODO: In Dnn v11, replace this to use IPortalSettingsV2 private field instantiate in constructor + // TODO: In Dnn v11, replace this to use IPortalSettings private field instantiate in constructor this.localiser.LocaliseNode(this.RootNode, this.HostPortalSettings.PortalId); #pragma warning restore CS0618 // Type or member is obsolete } @@ -440,7 +440,7 @@ private void ApplyNodeSelector() private void ApplyNodeManipulator() { - // TODO: In Dnn v11, replace this.HostPortalSettings to use IPortalSettingsV2 private field instantiate in constructor + // TODO: In Dnn v11, replace this.HostPortalSettings to use IPortalSettings private field instantiate in constructor #pragma warning disable CS0618 // Type or member is obsolete this.RootNode = new MenuNode( diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs index 72c882e7b71..84e6e9a92b1 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Browser/Browser.aspx.cs @@ -94,7 +94,7 @@ public partial class Browser : PageBase private EditorProviderSettings allPortalsSettings = new EditorProviderSettings(); /// The portal settings. - private IPortalSettingsV2 portalSettings; + private IPortalSettings portalSettings; /// The extension white list. private IFileExtensionAllowList extensionWhiteList; @@ -1520,7 +1520,7 @@ private void FillQualityPercentages() /// The get portal settings. /// Current Portal Settings. - private IPortalSettingsV2 GetPortalSettings() + private IPortalSettings GetPortalSettings() { int iTabId = 0, iPortalId = 0; @@ -1545,7 +1545,7 @@ private IPortalSettingsV2 GetPortalSettings() } catch (Exception) { - return (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; + return (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; } } diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs index bbfc97b14e7..3e16cffdeca 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/CKEditorOptions.ascx.cs @@ -79,7 +79,7 @@ public partial class CKEditorOptions : PortalModuleBase private readonly HttpRequest request = HttpContext.Current.Request; /// The _portal settings. - private IPortalSettingsV2 portalSettings; + private IPortalSettings portalSettings; /// Override Default Config Folder from Web.config. private string configFolder = string.Empty; @@ -1234,7 +1234,7 @@ private void FillFolders() /// Gets the portal settings. /// Returns the Current Portal Settings. - private IPortalSettingsV2 GetPortalSettings() + private IPortalSettings GetPortalSettings() { try { @@ -1267,7 +1267,7 @@ private IPortalSettingsV2 GetPortalSettings() } catch (Exception) { - return (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; + return (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; } } diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs index 11ddf43110a..d7661291134 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Options.aspx.cs @@ -37,7 +37,7 @@ public partial class Options : PageBase private readonly HttpRequest request = HttpContext.Current.Request; /// The portal settings. - private IPortalSettingsV2 curPortalSettings; + private IPortalSettings curPortalSettings; /// Initializes a new instance of the class. [Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload with IUserController. Scheduled removal in v12.0.0.")] @@ -183,11 +183,11 @@ private void ClosePage() /// Gets the portal settings. /// The Portal Settings. - private IPortalSettingsV2 GetPortalSettings() + private IPortalSettings GetPortalSettings() { int iTabId = 0, iPortalId = 0; - IPortalSettingsV2 portalSettings; + IPortalSettings portalSettings; try { @@ -210,7 +210,7 @@ private IPortalSettingsV2 GetPortalSettings() } catch (Exception) { - portalSettings = (IPortalSettingsV2)HttpContext.Current.Items["PortalSettings"]; + portalSettings = (IPortalSettings)HttpContext.Current.Items["PortalSettings"]; } return portalSettings; diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs index c4d2a67feed..0276e9ca082 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/SettingsUtil.cs @@ -94,7 +94,7 @@ internal static bool CheckExistsModuleInstanceSettings(string moduleKey, int mod /// Returns the Filled Settings. /// internal static EditorProviderSettings LoadEditorSettingsByKey( - IPortalSettingsV2 portalSettings, + IPortalSettings portalSettings, EditorProviderSettings currentSettings, List editorHostSettings, string key, @@ -1001,7 +1001,7 @@ internal static EditorProviderSettings LoadEditorSettingsByKey( /// /// Returns the filled Module Settings. /// - internal static EditorProviderSettings LoadModuleSettings(IPortalSettingsV2 portalSettings, EditorProviderSettings currentSettings, string key, int moduleId, IList portalRoles) + internal static EditorProviderSettings LoadModuleSettings(IPortalSettings portalSettings, EditorProviderSettings currentSettings, string key, int moduleId, IList portalRoles) { Hashtable hshModSet = null; var module = ModuleController.Instance.GetModule(moduleId, Null.NullInteger, false); @@ -1516,7 +1516,7 @@ PropertyInfo info in /// The alternate Sub Folder. /// The portal roles. /// Returns the Default Provider Settings. - internal static EditorProviderSettings GetDefaultSettings(IPortalSettingsV2 portalSettings, IHostSettings hostSettings, string homeDirPath, string alternateSubFolder, IList portalRoles) + internal static EditorProviderSettings GetDefaultSettings(IPortalSettings portalSettings, IHostSettings hostSettings, string homeDirPath, string alternateSubFolder, IList portalRoles) { var roles = new ArrayList(); @@ -1850,7 +1850,7 @@ internal static partial void ImportSettingBaseXml(string homeDirPath, bool isDef /// The portal settings. /// The HTTP request. /// Returns the MAX. upload file size for the current user. - internal static int GetCurrentUserUploadSize(EditorProviderSettings settings, IPortalSettingsV2 portalSettings, HttpRequest httpRequest) + internal static int GetCurrentUserUploadSize(EditorProviderSettings settings, IPortalSettings portalSettings, HttpRequest httpRequest) { var uploadFileLimitForPortal = Convert.ToInt32(Utility.GetMaxUploadSize()); diff --git a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs index 3e953c93c54..826d6cdcddd 100644 --- a/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs +++ b/DNN Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Utilities/Utility.cs @@ -245,7 +245,7 @@ public static string ConvertUnicodeChars(string input) /// /// Returns if the user has write access to the folder. /// - public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettingsV2 portalSettings) + public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettings portalSettings) { return CheckIfUserHasFolderAccess(folderId, portalSettings, "WRITE"); } @@ -256,7 +256,7 @@ public static bool CheckIfUserHasFolderWriteAccess(int folderId, IPortalSettings /// /// Returns if the user has write access to the folder. /// - public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettingsV2 portalSettings) + public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettings portalSettings) { return CheckIfUserHasFolderAccess(folderId, portalSettings, "READ"); } @@ -267,7 +267,7 @@ public static bool CheckIfUserHasFolderReadAccess(int folderId, IPortalSettingsV /// /// Returns the Folder Info. /// - public static IFolderInfo ConvertFilePathToFolderInfo(string folderPath, IPortalSettingsV2 portalSettings) + public static IFolderInfo ConvertFilePathToFolderInfo(string folderPath, IPortalSettings portalSettings) { if (!string.IsNullOrEmpty(portalSettings.HomeDirectoryMapPath) && folderPath.Length >= portalSettings.HomeDirectoryMapPath.Length) { @@ -348,7 +348,7 @@ public static void SortDescending(List source, Func /// if [is in roles] [the specified roles]; otherwise, . /// - public static bool IsInRoles(string roles, IPortalSettingsV2 settings) + public static bool IsInRoles(string roles, IPortalSettings settings) { var objUserInfo = UserController.Instance.GetCurrentUserInfo(); @@ -510,7 +510,7 @@ public static IFolderInfo EnsureGetFolder(int portalId, string folderPath) return null; } - private static bool CheckIfUserHasFolderAccess(int folderId, IPortalSettingsV2 portalSettings, string permissionKey) + private static bool CheckIfUserHasFolderAccess(int folderId, IPortalSettings portalSettings, string permissionKey) { try { diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs index 233e1688f67..3049a665829 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs @@ -383,7 +383,7 @@ public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlK var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = this.navigationManager.NavigateURL(tabId, default(IPortalSettingsV2), controlKey, null); + var actual = this.navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); @@ -402,7 +402,7 @@ public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlK [TestCase(10, "My-Control-Key-10")] public void NavigateUrl_TabId_Settings_ControlKey(int tabId, string controlKey) { - var mockSettings = new Mock(); + var mockSettings = new Mock(); mockSettings .Setup(x => x.ContentLocalizationEnabled) .Returns(true); diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs index 6364cecd16c..dad48d210e0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs @@ -48,7 +48,7 @@ public AdminLogsController(IEventLogger eventLogger) protected Dictionary LogTypeDictionary => this.logTypeDictionary = LogController.Instance.GetLogTypeInfoDictionary(); - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); public LogTypeInfo GetMyLogType(string logTypeKey) { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs index 725bde616c4..2d0a4e52203 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs @@ -285,7 +285,7 @@ private static bool IsValidTabPath(TabInfo tab, string newTabPath, out string er return valid; } - private int CreateTabFromParent(IPortalSettingsV2 portalSettings, TabInfo objRoot, TabInfo oTab, int parentId, bool validateOnly, out string errorMessage) + private int CreateTabFromParent(IPortalSettings portalSettings, TabInfo objRoot, TabInfo oTab, int parentId, bool validateOnly, out string errorMessage) { var tab = new TabInfo { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs index 1caf60c14d3..13e7afc12c5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/Checks/CheckUserProfilePage.cs @@ -42,7 +42,7 @@ public class CheckUserProfilePage : BaseCheck private readonly ITabController tabController; private readonly IPagesController pagesController; - private readonly Lazy portalSettings; + private readonly Lazy portalSettings; /// Initializes a new instance of the class. [Obsolete("Deprecated in DotNetNuke 10.0.0. Please use overload with IPagesController. Scheduled removal in v12.0.0.")] @@ -75,7 +75,7 @@ internal CheckUserProfilePage( throw new ArgumentNullException(nameof(portalController)); } - this.portalSettings = new Lazy(portalController.GetCurrentSettings); + this.portalSettings = new Lazy(portalController.GetCurrentSettings); } private int PortalId => this.portalSettings.Value.PortalId; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs index 98dccaed5c5..dea1a4e06f0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Security/SecurityController.cs @@ -29,7 +29,7 @@ namespace Dnn.PersonaBar.Security.Components public class SecurityController { - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Breaking change")] public IEnumerable GetAuthenticationProviders() diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs index de135db314c..8c0ef863a56 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Sites/SitesController.cs @@ -50,7 +50,7 @@ public class SitesController [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Breaking change")] public string LocalResourcesFile => Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Sites/App_LocalResources/Sites.resx"); - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); private CultureDropDownTypes DisplayType { get; set; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs index 7e6b115d0f6..57a39cc572a 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs @@ -82,7 +82,7 @@ public UserBasicDto(UserInfo user) [DataMember(Name = "isAdmin")] public bool IsAdmin { get; set; } - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); public static UserBasicDto FromUserInfo(UserInfo user) { diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs index d9987655500..86dadc7972a 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Controllers/TabsController.cs @@ -43,7 +43,7 @@ public class TabsController private static string AllUsersIcon => Globals.ResolveUrl("~/DesktopModules/Admin/Tabs/images/Icon_Everyone.png"); - private static IPortalSettingsV2 PortalSettings => PortalController.Instance.GetCurrentSettings(); + private static IPortalSettings PortalSettings => PortalController.Instance.GetCurrentSettings(); public TabDto GetPortalTabs(UserInfo userInfo, int portalId, string cultureCode, bool isMultiLanguage, bool excludeAdminTabs = true, string roles = "", bool disabledNotSelectable = false, int sortOrder = 0, int selectedTabId = -1, string validateTab = "", bool includeHostPages = false, bool includeDisabled = false, bool includeDeleted = false, bool includeDeletedChildren = true) { diff --git a/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs b/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs index 644a8c19d56..2578f504b0c 100644 --- a/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs +++ b/Dnn.AdminExperience/Tests/Dnn.PersonaBar.Security.Tests/Checks/CheckUserProfilePageTests.cs @@ -298,9 +298,9 @@ private static PagePermissions BuildPermissionsData(bool allUsersCanView) return permissionsData; } - private static Mock SetupPortalSettingsMock(int portalId, int userTabId) + private static Mock SetupPortalSettingsMock(int portalId, int userTabId) { - var mock = new Mock(); + var mock = new Mock(); mock.SetupGet(x => x.PortalId).Returns(portalId); mock.SetupGet(x => x.UserTabId).Returns(userTabId); return mock; From f95404951e636702c4d51b31e04d34061fa75886 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 25 Jun 2026 22:34:05 +0200 Subject: [PATCH 23/26] New approach to the page pipeline setting --- .../Framework/PagePipeline.cs | 2 +- .../Portals/IPortalSettings.cs | 3 -- .../Entities/Portals/PortalSettings.cs | 3 -- .../Portals/PortalSettingsController.cs | 1 - .../MvcPipeline/MvcPipelineSettings.cs | 15 +++++++++ .../MvcPipelineSettingsRepository.cs | 33 +++++++++++++++++++ DNN Platform/Library/Startup.cs | 5 +++ .../Services/SiteSettingsController.cs | 4 ++- 8 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettings.cs create mode 100644 DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettingsRepository.cs diff --git a/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs b/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs index 3c08407a885..1467d38cd3c 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Framework/PagePipeline.cs @@ -19,7 +19,7 @@ public static class PagePipeline public const string QueryStringMvc = "mvc"; /// Setting name for the page pipeline configuration. - public const string SettingName = "PagePipeline"; + public const string SettingName = "DefaultPagePipeline"; /// /// Defines the pipeline types for rendering pages in a portal. diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 48984d065b3..2da449d9001 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -361,8 +361,5 @@ public interface IPortalSettings /// Gets a value indicating whether to display the dropdowns to quickly add a moduel to the page in the edit bar. bool ShowQuickModuleAddMenu { get; } - - /// Gets the pipeline type for the portal. - PagePipeline.PortalRenderingPipeline PagePipeline { get; } } } diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index a84c0b8d279..aa264c8820a 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -555,9 +555,6 @@ public string AddCompatibleHttpHeader /// public bool ShowQuickModuleAddMenu => PortalController.GetPortalSettingAsBoolean("ShowQuickModuleAddMenu", this.PortalId, false); - /// - public PagePipeline.PortalRenderingPipeline PagePipeline { get; internal set; } - /// Create an instance. /// A new instance. public static IPortalSettings Create() diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs index b7902ad4709..cabfa43fe4e 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs @@ -282,7 +282,6 @@ public virtual void LoadPortalSettings(PortalSettings portalSettings) portalSettings.DataConsentDelayMeasurement = setting; setting = settings.GetValueOrDefault("AllowedExtensionsWhitelist", this.hostSettingsService.GetString("DefaultEndUserExtensionWhitelist")); portalSettings.AllowedExtensionsWhitelist = new FileExtensionWhitelist(setting); - portalSettings.PagePipeline = settings.GetPortalPipeline(PagePipeline.SettingName); setting = settings.GetValueOrDefault("CspHeaderMode", "OFF"); switch (setting.ToUpperInvariant()) { diff --git a/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettings.cs b/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettings.cs new file mode 100644 index 00000000000..6fcb1e51695 --- /dev/null +++ b/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettings.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +namespace DotNetNuke.Framework.MvcPipeline +{ + using DotNetNuke.Abstractions.Framework; + using DotNetNuke.Entities.Modules.Settings; + + internal class MvcPipelineSettings + { + [PortalSetting] + public PagePipeline.PortalRenderingPipeline DefaultPagePipeline { get; set; } + } +} diff --git a/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettingsRepository.cs b/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettingsRepository.cs new file mode 100644 index 00000000000..75638849fdb --- /dev/null +++ b/DNN Platform/Library/Framework/MvcPipeline/MvcPipelineSettingsRepository.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +namespace DotNetNuke.Framework.MvcPipeline +{ + using DotNetNuke.Abstractions.Application; + using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Entities.Modules; + using DotNetNuke.Entities.Modules.Settings; + using DotNetNuke.Entities.Portals; + + internal class MvcPipelineSettingsRepository : SettingsRepository + { + private readonly IPortalSettings portalSettings; + + public MvcPipelineSettingsRepository( + IModuleController moduleController, + IHostSettings hostSettings, + IHostSettingsService hostSettingsService, + IPortalController portalController, + IPortalSettings portalSettings) + : base(moduleController, hostSettings, hostSettingsService, portalController) + { + this.portalSettings = portalSettings; + } + + public MvcPipelineSettings GetSettings() + { + return this.GetSettings(this.portalSettings.PortalId); + } + } +} diff --git a/DNN Platform/Library/Startup.cs b/DNN Platform/Library/Startup.cs index 0b45945a739..f90b212c291 100644 --- a/DNN Platform/Library/Startup.cs +++ b/DNN Platform/Library/Startup.cs @@ -41,6 +41,7 @@ namespace DotNetNuke using DotNetNuke.Entities.Users; using DotNetNuke.Framework; using DotNetNuke.Framework.JavaScriptLibraries; + using DotNetNuke.Framework.MvcPipeline; using DotNetNuke.Framework.Reflections; using DotNetNuke.Instrumentation; using DotNetNuke.Prompt; @@ -200,6 +201,10 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); RegisterModuleInjectionFilters(services); + + services.AddScoped(serviceProvider => PortalController.Instance.GetCurrentSettings()); + services.AddScoped(); + services.AddScoped(serviceProvider => serviceProvider.GetRequiredService().GetSettings()); } private static void RegisterModuleInjectionFilters(IServiceCollection services) diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs index 07b7f7d80ab..9422afe86d7 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs @@ -40,6 +40,7 @@ namespace Dnn.PersonaBar.SiteSettings.Services using DotNetNuke.Entities.Tabs.TabVersions; using DotNetNuke.Entities.Urls; using DotNetNuke.Entities.Users; + using DotNetNuke.Framework.MvcPipeline; using DotNetNuke.Instrumentation; using DotNetNuke.Security.Roles; using DotNetNuke.Services.Exceptions; @@ -108,6 +109,7 @@ public class SiteSettingsController(INavigationManager navigationManager, IAppli private readonly IPortalAliasService portalAliasService = portalAliasService ?? Globals.GetCurrentServiceProvider().GetRequiredService(); private readonly RoleProvider roleProvider = roleProvider ?? Globals.GetCurrentServiceProvider().GetRequiredService(); private readonly ITabController tabController = tabController ?? Globals.GetCurrentServiceProvider().GetRequiredService(); + private readonly MvcPipelineSettings mvcPipelineSettings = Globals.GetCurrentServiceProvider().GetRequiredService(); /// Initializes a new instance of the class. /// A manager to provide navigation services. @@ -3161,7 +3163,7 @@ public HttpResponseMessage GetOtherSettings(int? portalId) MaxNumberOfVersions = TabVersionSettings.Instance.GetMaxNumberOfVersions(pid), WorkflowEnabled = TabWorkflowSettings.Instance.IsWorkflowEnabled(pid), DefaultTabWorkflowId = TabWorkflowSettings.Instance.GetDefaultTabWorkflowId(pid), - PagePipeline = ((int)portalSettings.PagePipeline).ToString(System.Globalization.CultureInfo.InvariantCulture), + PagePipeline = ((int)this.mvcPipelineSettings.DefaultPagePipeline).ToString(System.Globalization.CultureInfo.InvariantCulture), }, Workflows = WorkflowManager.Instance.GetWorkflows(pid).Select(w => new { label = w.WorkflowName, value = w.WorkflowID }).ToList(), }); From c3702a1638a547c7285af13014b668a88fa52215 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 25 Jun 2026 22:37:06 +0200 Subject: [PATCH 24/26] Cleaning up --- DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 2da449d9001..7b18617461b 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -6,8 +6,6 @@ namespace DotNetNuke.Abstractions.Portals using System; using System.Diagnostics.CodeAnalysis; - using DotNetNuke.Abstractions.Framework; - /// /// The PortalSettings class encapsulates all of the settings for the Portal, /// as well as the configuration settings required to execute the current tab From de8daea764f9a7630658b96602044c94c2cbedea Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 25 Jun 2026 22:38:25 +0200 Subject: [PATCH 25/26] Cleaning up 2 --- .../Library/Entities/Portals/IPortalSettingsController.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs index 1bfba00e3c1..177f3bda2dd 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalSettingsController.cs @@ -5,7 +5,6 @@ namespace DotNetNuke.Entities.Portals { using System.Collections.Generic; - using DotNetNuke.Abstractions.Framework; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; From 6920a6f3ff206820611a8fd921158a6b8e5fc008 Mon Sep 17 00:00:00 2001 From: Peter Donker Date: Thu, 25 Jun 2026 22:44:03 +0200 Subject: [PATCH 26/26] Cleaning up 3 --- .../Portals/PortalSettingsExtensions.cs | 9 ---- .../Framework/PagePipelineExtensions.cs | 52 ------------------- 2 files changed, 61 deletions(-) delete mode 100644 DNN Platform/Library/Framework/PagePipelineExtensions.cs diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs index cd5e3d11859..f3e8678583c 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsExtensions.cs @@ -1,12 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information - namespace DotNetNuke.Entities.Portals { - using DotNetNuke.Abstractions.Framework; - using DotNetNuke.Framework; - public static class PortalSettingsExtensions { /// Detect whether current page is custom error page. @@ -17,10 +13,5 @@ public static bool InErrorPageRequest(this PortalSettings portalSettings) return portalSettings.ActiveTab.TabID == portalSettings.ErrorPage404 || portalSettings.ActiveTab.TabID == portalSettings.ErrorPage500; } - - public static PagePipeline.PortalRenderingPipeline GetPortalPagePipeline(this IPortalSettingsController portalSettingsController, int portalId) - { - return PortalController.Instance.GetPortalSettings(portalId).GetPortalPipeline(PagePipeline.SettingName); - } } } diff --git a/DNN Platform/Library/Framework/PagePipelineExtensions.cs b/DNN Platform/Library/Framework/PagePipelineExtensions.cs deleted file mode 100644 index 549c7a914ba..00000000000 --- a/DNN Platform/Library/Framework/PagePipelineExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information - -namespace DotNetNuke.Framework -{ - using System; - using System.Collections; - using System.Collections.Generic; - - using DotNetNuke.Abstractions.Framework; - - public static class PagePipelineExtensions - { - /// - /// Gets the portal rendering pipeline configuration from the specified dictionary. - /// - /// The dictionary containing the portal settings. - /// The name of the setting to retrieve. - /// The portal rendering pipeline configuration, or WebForms if not found or invalid. - public static PagePipeline.PortalRenderingPipeline GetPortalPipeline(this Dictionary input, string settingName) - { - if (input != null && input.TryGetValue(settingName, out var pipeline)) - { - return string.IsNullOrEmpty(pipeline) ? - PagePipeline.PortalRenderingPipeline.WebForms : - Enum.TryParse(pipeline, true, out var result) ? result : PagePipeline.PortalRenderingPipeline.WebForms; - } - - return PagePipeline.PortalRenderingPipeline.WebForms; - } - - /// - /// Gets the page rendering pipeline configuration from the specified hashtable. - /// - /// The hashtable containing the page settings. - /// The name of the setting to retrieve. - /// The page rendering pipeline configuration, or Inherited if not found or invalid. - public static PagePipeline.PageRenderingPipeline GetPagePipeline(this Hashtable input, string settingName) - { - if (input != null && input.ContainsKey(settingName)) - { - var pipeline = Convert.ToString(input[settingName], System.Globalization.CultureInfo.InvariantCulture); - return string.IsNullOrEmpty(pipeline) ? - PagePipeline.PageRenderingPipeline.Inherited : - Enum.TryParse(pipeline, true, out var result) ? result : PagePipeline.PageRenderingPipeline.Inherited; - } - - return PagePipeline.PageRenderingPipeline.Inherited; - } - } -}