From 535b0b55dc1b8e54e688235a0ae4683d592ab57d Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:07:23 -0400 Subject: [PATCH 01/44] Added INavigationManager and updated Globals to reference new INavigationManager --- DNN Platform/Library/Common/Globals.cs | 31 ++- .../Common/Interfaces/INavigationManager.cs | 116 +++++++++ .../Library/Common/NavigationManager.cs | 240 ++++++++++++++++++ .../Library/DotNetNuke.Library.csproj | 4 +- DNN Platform/Library/Startup.cs | 5 +- 5 files changed, 382 insertions(+), 14 deletions(-) create mode 100644 DNN Platform/Library/Common/Interfaces/INavigationManager.cs create mode 100644 DNN Platform/Library/Common/NavigationManager.cs diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index 61ee689db81..a7c7f544fa6 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -43,6 +43,7 @@ using DotNetNuke.Application; using DotNetNuke.Collections.Internal; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; @@ -2514,6 +2515,7 @@ public static string AccessDeniedURL() /// URL to access denied view public static string AccessDeniedURL(string Message) { + var navigationManager = DependencyProvider.GetService(); string strURL = ""; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (HttpContext.Current.Request.IsAuthenticated) @@ -2521,14 +2523,14 @@ public static string AccessDeniedURL(string Message) if (String.IsNullOrEmpty(Message)) { //redirect to access denied page - strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied"); + strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied"); } else { //redirect to access denied page with custom message var messageGuid = DataProvider.Instance().AddRedirectMessage( _portalSettings.UserId, _portalSettings.ActiveTab.TabID, Message).ToString("N"); - strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied", "message=" + messageGuid); + strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied", "message=" + messageGuid); } } else @@ -2840,6 +2842,7 @@ public static string LoginURL(string returnUrl, bool overrideSetting) /// Formatted URL. public static string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings) { + var navigationManager = DependencyProvider.GetService(); string loginUrl; if (!string.IsNullOrEmpty(returnUrl)) { @@ -2856,24 +2859,24 @@ public static string LoginURL(string returnUrl, bool overrideSetting, PortalSett if (ValidateLoginTabID(portalSettings.LoginTabId)) { loginUrl = string.IsNullOrEmpty(returnUrl) - ? NavigateURL(portalSettings.LoginTabId, "", popUpParameter) - : NavigateURL(portalSettings.LoginTabId, "", returnUrl, popUpParameter); + ? navigationManager.NavigateURL(portalSettings.LoginTabId, "", popUpParameter) + : navigationManager.NavigateURL(portalSettings.LoginTabId, "", returnUrl, popUpParameter); } else { string strMessage = string.Format("error={0}", Localization.GetString("NoLoginControl", Localization.GlobalResourceFile)); //No account module so use portal tab loginUrl = string.IsNullOrEmpty(returnUrl) - ? NavigateURL(portalSettings.ActiveTab.TabID, "Login", strMessage, popUpParameter) - : NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, strMessage, popUpParameter); + ? navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", strMessage, popUpParameter) + : navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, strMessage, popUpParameter); } } else { //portal tab loginUrl = string.IsNullOrEmpty(returnUrl) - ? NavigateURL(portalSettings.ActiveTab.TabID, "Login", popUpParameter) - : NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, popUpParameter); + ? navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", popUpParameter) + : navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, popUpParameter); } return loginUrl; } @@ -2888,11 +2891,14 @@ public static string UserProfileURL(int userId) string strURL = ""; PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - strURL = NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); + strURL = DependencyProvider.GetService().NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); return strURL; } + + + /// /// Gets the URL to the current page. /// @@ -3161,6 +3167,7 @@ public static string QueryStringDecode(string QueryString) /// Formatted url. public static string RegisterURL(string returnURL, string originalURL) { + var navigationManager = DependencyProvider.GetService(); string strURL; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); string extraParams = String.Empty; @@ -3175,11 +3182,11 @@ public static string RegisterURL(string returnURL, string originalURL) if (_portalSettings.RegisterTabId != -1) { //user defined tab - strURL = NavigateURL(_portalSettings.RegisterTabId, "", extraParams); + strURL = navigationManager.NavigateURL(_portalSettings.RegisterTabId, "", extraParams); } else { - strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Register", extraParams); + strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Register", extraParams); } return strURL; } @@ -3427,7 +3434,7 @@ public static string LinkClick(string Link, int TabID, int ModuleID, bool TrackC switch (UrlType) { case TabType.Tab: - strLink = NavigateURL(int.Parse(Link)); + strLink = DependencyProvider.GetService().NavigateURL(int.Parse(Link)); break; default: strLink = Link; diff --git a/DNN Platform/Library/Common/Interfaces/INavigationManager.cs b/DNN Platform/Library/Common/Interfaces/INavigationManager.cs new file mode 100644 index 00000000000..bab075a65de --- /dev/null +++ b/DNN Platform/Library/Common/Interfaces/INavigationManager.cs @@ -0,0 +1,116 @@ +using DotNetNuke.Entities.Portals; +using System.ComponentModel; + +namespace DotNetNuke.Common.Interfaces +{ + public interface INavigationManager + { + /// + /// Gets the URL to the current page. + /// + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(); + + /// + /// Gets the URL to the given page. + /// + /// The tab ID. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID); + + /// + /// Gets the URL to the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID, bool isSuperTab); + + /// + /// Gets the URL to show the control associated with the given control key. + /// + /// The control key, or or null. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(string controlKey); + + /// + /// Gets the URL to show the control associated with the given control key. + /// + /// The control key, or or null. + /// Any additional parameters, in "key=value" format. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(string controlKey, params string[] additionalParameters); + + /// + /// Gets the URL to show the control associated with the given control key on the given page. + /// + /// The tab ID. + /// The control key, or or null. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID, string controlKey); + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID, string controlKey, params string[] additionalParameters); + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// The portal settings. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters); + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters); + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// The language code. + /// Any additional parameters. + /// Formatted URL. + string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters); + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// The language code. + /// The page name to pass to . + /// Any additional parameters. + /// Formatted url. + string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters); + } +} diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs new file mode 100644 index 00000000000..f41996d4757 --- /dev/null +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -0,0 +1,240 @@ +using DotNetNuke.Common.Interfaces; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Host; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Tabs; +using DotNetNuke.Services.Localization; +using System; +using System.ComponentModel; +using System.Linq; +using System.Threading; + +namespace DotNetNuke.Common +{ + internal class NavigationManager : INavigationManager + { + /// + /// Gets the URL to the current page. + /// + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL() + { + PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); + } + + /// + /// Gets the URL to the given page. + /// + /// The tab ID. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID) + { + return NavigateURL(tabID, Null.NullString); + } + + /// + /// Gets the URL to the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID, bool isSuperTab) + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, _portalSettings); + return NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); + } + + /// + /// Gets the URL to show the control associated with the given control key. + /// + /// The control key, or or null. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(string controlKey) + { + if (controlKey == "Access Denied") + { + return Globals.AccessDeniedURL(); + } + else + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); + } + } + + /// + /// Gets the URL to show the control associated with the given control key. + /// + /// The control key, or or null. + /// Any additional parameters, in "key=value" format. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(string controlKey, params string[] additionalParameters) + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); + } + + /// + /// Gets the URL to show the control associated with the given control key on the given page. + /// + /// The tab ID. + /// The control key, or or null. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID, string controlKey) + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(tabID, _portalSettings, controlKey, null); + } + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); + } + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// The portal settings. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) + { + bool isSuperTab = Globals.IsHostTab(tabID); + + return NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + } + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// Any additional parameters. + /// Formatted URL. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) + { + string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); + return NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); + } + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// The language code. + /// Any additional parameters. + /// Formatted URL. + public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) + { + return NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); + } + + /// + /// Gets the URL to show the given page. + /// + /// The tab ID. + /// if set to true the page is a "super-tab," i.e. a host-level page. + /// The portal settings. + /// The control key, or or null. + /// The language code. + /// The page name to pass to . + /// Any additional parameters. + /// Formatted url. + public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) + { + string url = tabID == Null.NullInteger ? Globals.ApplicationURL() : Globals.ApplicationURL(tabID); + if (!String.IsNullOrEmpty(controlKey)) + { + url += "&ctl=" + controlKey; + } + if (additionalParameters != null) + { + url = additionalParameters.Where(parameter => !string.IsNullOrEmpty(parameter)).Aggregate(url, (current, parameter) => current + ("&" + parameter)); + } + if (isSuperTab) + { + url += "&portalid=" + settings.PortalId; + } + + TabInfo tab = null; + + if (settings != null) + { + tab = TabController.Instance.GetTab(tabID, isSuperTab ? Null.NullInteger : settings.PortalId, false); + } + + //only add language to url if more than one locale is enabled + if (settings != null && language != null && LocaleController.Instance.GetLocales(settings.PortalId).Count > 1) + { + if (settings.ContentLocalizationEnabled) + { + if (language == "") + { + if (tab != null && !string.IsNullOrEmpty(tab.CultureCode)) + { + url += "&language=" + tab.CultureCode; + } + } + else + { + url += "&language=" + language; + } + } + else if (settings.EnableUrlLanguage) + { + //legacy pre 5.5 behavior + if (language == "") + { + url += "&language=" + Thread.CurrentThread.CurrentCulture.Name; + } + else + { + url += "&language=" + language; + } + } + } + + if (Host.UseFriendlyUrls || Config.GetFriendlyUrlProvider() == "advanced") + { + if (String.IsNullOrEmpty(pageName)) + { + pageName = Globals.glbDefaultPage; + } + + url = (settings == null) ? Globals.FriendlyUrl(tab, url, pageName) : Globals.FriendlyUrl(tab, url, pageName, settings); + } + else + { + url = Globals.ResolveUrl(url); + } + + return url; + } + } +} diff --git a/DNN Platform/Library/DotNetNuke.Library.csproj b/DNN Platform/Library/DotNetNuke.Library.csproj index 910f557e5d7..5087733af46 100644 --- a/DNN Platform/Library/DotNetNuke.Library.csproj +++ b/DNN Platform/Library/DotNetNuke.Library.csproj @@ -82,7 +82,7 @@ False - ..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + ..\DotNetNuke.Instrumentation\obj\Debug\DotNetNuke.Instrumentation.dll False @@ -189,6 +189,8 @@ + + diff --git a/DNN Platform/Library/Startup.cs b/DNN Platform/Library/Startup.cs index 004d633f122..2a62adffde8 100644 --- a/DNN Platform/Library/Startup.cs +++ b/DNN Platform/Library/Startup.cs @@ -1,4 +1,6 @@ -using DotNetNuke.DependencyInjection; +using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; +using DotNetNuke.DependencyInjection; using DotNetNuke.UI.Modules; using DotNetNuke.UI.Modules.Html5; using Microsoft.Extensions.DependencyInjection; @@ -12,6 +14,7 @@ public void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddTransient(); } } } From acf48d035bb1cc1034658162250221a27a1a2176 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:07:41 -0400 Subject: [PATCH 02/44] Updated CreateModule to use new INavigationManager --- .../CreateModule.ascx.cs | 10 ++++++++-- .../Dnn.Modules.ModuleCreator.csproj | 15 +++++++++++++++ .../Dnn.Modules.ModuleCreator/packages.config | 5 +++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs index 625790b1c95..23a31138960 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs @@ -40,7 +40,8 @@ using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Services.Log.EventLog; - +using DotNetNuke.Common.Interfaces; +using Microsoft.Extensions.DependencyInjection; #endregion namespace Dnn.Module.ModuleCreator @@ -48,6 +49,11 @@ namespace Dnn.Module.ModuleCreator public partial class CreateModule : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public CreateModule() + { + NavigationManager = DependencyProvider.GetService(); + } #region Private Methods @@ -438,7 +444,7 @@ protected void cmdCreate_Click(object sender, EventArgs e) HostController.Instance.Update("Owner", txtOwner.Text, false); if (CreateModuleDefinition()) { - Response.Redirect(Globals.NavigateURL(), true); + Response.Redirect(NavigationManager.NavigateURL(), true); } } else diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj index c3a3c7a38ab..7d9d5bc423d 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj @@ -19,6 +19,8 @@ + + true @@ -49,6 +51,12 @@ ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -166,6 +174,10 @@ + + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} + DotNetNuke.DependencyInjection + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation @@ -213,6 +225,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From be20b2c59d39f75fe34c6959c75f9728c1172cec Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:09:30 -0400 Subject: [PATCH 03/44] Deprecated NavigateURL for v11.0 --- DNN Platform/Library/Common/Globals.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index a7c7f544fa6..5e0b675d0e3 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -2904,6 +2904,7 @@ public static string UserProfileURL(int userId) /// /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL() { PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -2916,6 +2917,7 @@ public static string NavigateURL() /// The tab ID. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID) { return NavigateURL(tabID, Null.NullString); @@ -2928,6 +2930,7 @@ public static string NavigateURL(int tabID) /// if set to true the page is a "super-tab," i.e. a host-level page. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -2941,6 +2944,7 @@ public static string NavigateURL(int tabID, bool isSuperTab) /// The control key, or or null. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey) { if (controlKey == "Access Denied") @@ -2961,6 +2965,7 @@ public static string NavigateURL(string controlKey) /// Any additional parameters, in "key=value" format. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey, params string[] additionalParameters) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -2974,6 +2979,7 @@ public static string NavigateURL(string controlKey, params string[] additionalPa /// The control key, or or null. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -2988,6 +2994,7 @@ public static string NavigateURL(int tabID, string controlKey) /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -3003,6 +3010,7 @@ public static string NavigateURL(int tabID, string controlKey, params string[] a /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { bool isSuperTab = IsHostTab(tabID); @@ -3020,6 +3028,7 @@ public static string NavigateURL(int tabID, PortalSettings settings, string cont /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { string cultureCode = GetCultureCode(tabID, isSuperTab, settings); @@ -3036,6 +3045,7 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett /// The language code. /// Any additional parameters. /// Formatted URL. + /// [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { return NavigateURL(tabID, isSuperTab, settings, controlKey, language, glbDefaultPage, additionalParameters); @@ -3052,6 +3062,7 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett /// The page name to pass to . /// Any additional parameters. /// Formatted url. + /// [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { string url = tabID == Null.NullInteger ? ApplicationURL() : ApplicationURL(tabID); From 786680cff3dbabde924df26ea7f090b5c0ac8c02 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:11:23 -0400 Subject: [PATCH 04/44] Updated viewsource to use INavigationManager --- .../Dnn.Modules.ModuleCreator/viewsource.ascx.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index c1abe1c3f2a..723cd094e48 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -28,6 +28,7 @@ using System.Collections; using System.Collections.Generic; using System.Web.UI.WebControls; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -43,6 +44,7 @@ using DotNetNuke.Services.Installer.Packages; using DotNetNuke.Services.Installer.Writers; using DotNetNuke.Services.Log.EventLog; +using DotNetNuke.Common.Interfaces; #endregion @@ -50,6 +52,12 @@ namespace Dnn.Module.ModuleCreator { public partial class ViewSource : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public ViewSource() + { + NavigationManager = DependencyProvider.GetService(); + } + #region Private Members @@ -70,7 +78,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? Globals.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); } } From 920d2d30290c31b5aa75a9bdc40c2ea37b269d81 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:28:23 -0400 Subject: [PATCH 05/44] Migrated Globals.NavigateUrl to use INavigationManager --- .../ActionResults/DnnRedirecttoRouteResult.cs | 6 +++- DNN Platform/Library/Common/Globals.cs | 3 -- .../Library/Common/Internal/GlobalsImpl.cs | 30 ++++++++++++------- .../Library/Properties/AssemblyInfo.cs | 3 +- DNN Platform/Modules/DDRMenu/DNNAbstract.cs | 6 ++-- .../DDRMenu/DotNetNuke.Modules.DDRMenu.csproj | 8 +++++ DNN Platform/Modules/DDRMenu/packages.config | 5 ++++ .../DotNetNuke.Modules.DigitalAssets.csproj | 11 ++++++- .../DigitalAssets/FolderMappings.ascx.cs | 10 ++++++- .../Modules/DigitalAssets/View.ascx.cs | 6 +++- .../Modules/DigitalAssets/packages.config | 2 ++ .../HTML/DotNetNuke.Modules.Html.csproj | 8 +++++ DNN Platform/Modules/HTML/EditHtml.ascx.cs | 11 +++++-- DNN Platform/Modules/HTML/HtmlModule.ascx.cs | 10 ++++++- DNN Platform/Modules/HTML/MyWork.ascx.cs | 11 +++++-- DNN Platform/Modules/HTML/packages.config | 5 ++++ .../Modules/RazorHost/CreateModule.ascx.cs | 1 + .../DotNetNuke.Modules.RazorHost.csproj | 8 +++++ .../Modules/RazorHost/packages.config | 5 ++++ 19 files changed, 123 insertions(+), 26 deletions(-) create mode 100644 DNN Platform/Modules/DDRMenu/packages.config create mode 100644 DNN Platform/Modules/HTML/packages.config create mode 100644 DNN Platform/Modules/RazorHost/packages.config diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs index 16c237f5937..7d7451c15fa 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs @@ -21,7 +21,9 @@ using System.Web.Mvc; using System.Web.Routing; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Web.Mvc.Framework.Controllers; using DotNetNuke.Web.Mvc.Helpers; @@ -29,9 +31,11 @@ namespace DotNetNuke.Web.Mvc.Framework.ActionResults { internal class DnnRedirecttoRouteResult : RedirectToRouteResult { + protected INavigationManager NavigationManager { get; } public DnnRedirecttoRouteResult(string actionName, string controllerName, string routeName, RouteValueDictionary routeValues, bool permanent) : base(routeName, routeValues, permanent) { + NavigationManager = Globals.DependencyProvider.GetService(); ActionName = actionName; ControllerName = controllerName; } @@ -62,7 +66,7 @@ public override void ExecuteResult(ControllerContext context) else { //TODO - match other actions - url = Globals.NavigateURL(); + url = NavigationManager.NavigateURL(); } if (Permanent) diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index 5e0b675d0e3..e7c14b550c5 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -2896,9 +2896,6 @@ public static string UserProfileURL(int userId) return strURL; } - - - /// /// Gets the URL to the current page. /// diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 2482fab29d7..faaedad1cf8 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -21,15 +21,23 @@ using System; using System.Text; using System.Web; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.UI.UserControls; +using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Common.Internal { public class GlobalsImpl : IGlobals { + protected INavigationManager NavigationManager { get; } + public GlobalsImpl() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + public string ApplicationPath { get { return Globals.ApplicationPath; } @@ -180,57 +188,57 @@ public string LoginURL(string returnURL, bool @override) public string NavigateURL() { - return Globals.NavigateURL(); + return NavigationManager.NavigateURL(); } public string NavigateURL(int tabID) { - return Globals.NavigateURL(tabID); + return NavigationManager.NavigateURL(tabID); } public string NavigateURL(int tabID, bool isSuperTab) { - return Globals.NavigateURL(tabID, isSuperTab); + return NavigationManager.NavigateURL(tabID, isSuperTab); } public string NavigateURL(string controlKey) { - return Globals.NavigateURL(controlKey); + return NavigationManager.NavigateURL(controlKey); } public string NavigateURL(string controlKey, params string[] additionalParameters) { - return Globals.NavigateURL(controlKey, additionalParameters); + return NavigationManager.NavigateURL(controlKey, additionalParameters); } public string NavigateURL(int tabID, string controlKey) { - return Globals.NavigateURL(tabID, controlKey); + return NavigationManager.NavigateURL(tabID, controlKey); } public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - return Globals.NavigateURL(tabID, controlKey, additionalParameters); + return NavigationManager.NavigateURL(tabID, controlKey, additionalParameters); } public string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return Globals.NavigateURL(tabID, settings, controlKey, additionalParameters); + return NavigationManager.NavigateURL(tabID, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); + return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { - return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); + return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); } public string FriendlyUrl(TabInfo tab, string path) diff --git a/DNN Platform/Library/Properties/AssemblyInfo.cs b/DNN Platform/Library/Properties/AssemblyInfo.cs index e45941bb5cd..4920cd8b697 100644 --- a/DNN Platform/Library/Properties/AssemblyInfo.cs +++ b/DNN Platform/Library/Properties/AssemblyInfo.cs @@ -56,4 +56,5 @@ [assembly: InternalsVisibleTo("DotNetNuke.Tests.Web.Mvc")] [assembly: InternalsVisibleTo("DotNetNuke.Tests.Urls")] [assembly: InternalsVisibleTo("DotNetNuke.Tests.Professional")] -[assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] \ No newline at end of file +[assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] +[assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refeactored to Dependency Injection we should be able to remove this \ No newline at end of file diff --git a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs index 5ea3923373d..60c188e71a8 100644 --- a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs +++ b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Web; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Framework; using DotNetNuke.UI; using DotNetNuke.UI.WebControls; @@ -15,6 +16,7 @@ namespace DotNetNuke.Web.DDRMenu { + using DotNetNuke.Common.Interfaces; using DotNetNuke.Framework.JavaScriptLibraries; internal static class DNNAbstract @@ -25,7 +27,7 @@ public static string GetLoginUrl() if (request.IsAuthenticated) { - return Globals.NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); + return Globals.DependencyProvider.GetService().NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); } var returnUrl = HttpContext.Current.Request.RawUrl; @@ -46,7 +48,7 @@ public static string GetUserUrl() { if (portalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { - return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.NavigateURL()), Null.NullString); + return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.DependencyProvider.GetService().NavigateURL()), Null.NullString); } } else diff --git a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj index 717614909c6..beb1015a57f 100644 --- a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj +++ b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj @@ -13,6 +13,7 @@ + Debug @@ -82,6 +83,12 @@ _dependencies\Ealo\05.05.00\effority.ealo.dll False + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -188,6 +195,7 @@ Designer + diff --git a/DNN Platform/Modules/DDRMenu/packages.config b/DNN Platform/Modules/DDRMenu/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/Modules/DDRMenu/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj index 513ee51d14a..f5f0e046c6c 100644 --- a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj +++ b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj @@ -23,6 +23,7 @@ ..\..\..\ true + true @@ -81,6 +82,12 @@ False ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll True @@ -336,7 +343,9 @@ - + + Designer + diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index 34598bbf176..f7d41154867 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -21,8 +21,10 @@ using System; using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Framework.JavaScriptLibraries; @@ -38,6 +40,12 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class FolderMappings : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public FolderMappings() + { + NavigationManager = DependencyProvider.GetService(); + } + #region Private Variables private readonly IFolderMappingController _folderMappingController = FolderMappingController.Instance; @@ -102,7 +110,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); - CancelButton.NavigateUrl = Globals.NavigateURL(); + CancelButton.NavigateUrl = NavigationManager.NavigateURL(); NewMappingButton.Click += OnNewMappingClick; if (!IsPostBack) diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index 48f7831540b..442277fbc8a 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -27,8 +27,10 @@ using System.Text; using System.Text.RegularExpressions; using System.Web; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Icons; using DotNetNuke.Entities.Modules; @@ -64,9 +66,11 @@ public partial class View : PortalModuleBase, IActionable private readonly ExtensionPointManager epm = new ExtensionPointManager(); private NameValueCollection damState; + protected INavigationManager NavigationManager { get; } public View() { controller = new Factory().DigitalAssetsController; + NavigationManager = DependencyProvider.GetService(); } private IExtensionPointFilter Filter @@ -139,7 +143,7 @@ protected string NavigateUrl { get { - var url = Globals.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(Globals.NavigateURL())); + var url = NavigationManager.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(NavigationManager.NavigateURL())); //append popUp parameter var delimiter = url.Contains("?") ? "&" : "?"; diff --git a/DNN Platform/Modules/DigitalAssets/packages.config b/DNN Platform/Modules/DigitalAssets/packages.config index 4a4092b618b..4073d3c4617 100644 --- a/DNN Platform/Modules/DigitalAssets/packages.config +++ b/DNN Platform/Modules/DigitalAssets/packages.config @@ -4,5 +4,7 @@ + + \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj index c3ec4dba567..cc607bd4289 100644 --- a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj +++ b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj @@ -28,6 +28,7 @@ + true @@ -90,6 +91,12 @@ False ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -183,6 +190,7 @@ + diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index 2caca693804..8f151d003df 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -26,6 +26,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Users; @@ -38,6 +39,7 @@ using DotNetNuke.Common.Utilities; using Telerik.Web.UI; using DotNetNuke.Modules.Html.Components; +using DotNetNuke.Common.Interfaces; #endregion @@ -51,6 +53,11 @@ namespace DotNetNuke.Modules.Html /// public partial class EditHtml : HtmlModuleBase { + protected INavigationManager NavigationManager { get; } + public EditHtml() + { + NavigationManager = DependencyProvider.GetService(); + } #region Private Members @@ -435,7 +442,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - hlCancel.NavigateUrl = Globals.NavigateURL(); + hlCancel.NavigateUrl = NavigationManager.NavigateURL(); cmdEdit.Click += OnEditClick; cmdPreview.Click += OnPreviewClick; @@ -583,7 +590,7 @@ protected void OnSaveClick(object sender, EventArgs e) // redirect back to portal if (redirect) { - Response.Redirect(Globals.NavigateURL(), true); + Response.Redirect(NavigationManager.NavigateURL(), true); } } protected void OnEditClick(object sender, EventArgs e) diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index ab5d62d855a..1708409cab6 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -22,6 +22,7 @@ using System; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Entities.Modules; @@ -34,6 +35,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.UI.WebControls; using DotNetNuke.Modules.Html.Components; +using DotNetNuke.Common.Interfaces; #endregion @@ -52,6 +54,12 @@ public partial class HtmlModule : HtmlModuleBase, IActionable private bool EditorEnabled; private int WorkflowID; + protected INavigationManager NavigationManager { get; } + public HtmlModule() + { + NavigationManager = DependencyProvider.GetService(); + } + #region "Private Methods" #endregion @@ -262,7 +270,7 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); // refresh page - Response.Redirect(Globals.NavigateURL(), true); + Response.Redirect(NavigationManager.NavigateURL(), true); } } } diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index e9e298d03ca..8d2955fe6f4 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -21,7 +21,9 @@ #region Usings using System; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; @@ -37,13 +39,18 @@ namespace DotNetNuke.Modules.Html /// public partial class MyWork : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public MyWork() + { + NavigationManager = DependencyProvider.GetService(); + } #region Protected Methods public string FormatURL(object dataItem) { var objHtmlTextUser = (HtmlTextUserInfo) dataItem; - return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; + return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; } #endregion @@ -58,7 +65,7 @@ public string FormatURL(object dataItem) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - hlCancel.NavigateUrl = Globals.NavigateURL(); + hlCancel.NavigateUrl = NavigationManager.NavigateURL(); try { diff --git a/DNN Platform/Modules/HTML/packages.config b/DNN Platform/Modules/HTML/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/Modules/HTML/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index da20d3a0a00..b0d53f398ee 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -26,6 +26,7 @@ using System.Web.UI.WebControls; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; diff --git a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj index 052bf564d94..6ca553c2bd8 100644 --- a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj +++ b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj @@ -27,6 +27,7 @@ + true @@ -61,6 +62,12 @@ False ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -155,6 +162,7 @@ Designer + Designer diff --git a/DNN Platform/Modules/RazorHost/packages.config b/DNN Platform/Modules/RazorHost/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/Modules/RazorHost/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From 06dfe4566654a912a0c5b6067dfb9389d8b5a48a Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Tue, 15 Oct 2019 23:33:39 -0400 Subject: [PATCH 06/44] Updated persona bar controllers to use NavigateUrl --- DNN Platform/Library/Properties/AssemblyInfo.cs | 3 ++- .../Dnn.PersonaBar.Extensions.csproj | 13 +++++++++++++ .../MenuControllers/ThemeMenuController.cs | 4 +++- .../Services/ServerController.cs | 13 ++++++++++--- .../Services/SiteSettingsController.cs | 11 +++++++++-- .../Dnn.PersonaBar.Extensions/packages.config | 2 ++ 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/DNN Platform/Library/Properties/AssemblyInfo.cs b/DNN Platform/Library/Properties/AssemblyInfo.cs index 4920cd8b697..ad27dc95691 100644 --- a/DNN Platform/Library/Properties/AssemblyInfo.cs +++ b/DNN Platform/Library/Properties/AssemblyInfo.cs @@ -57,4 +57,5 @@ [assembly: InternalsVisibleTo("DotNetNuke.Tests.Urls")] [assembly: InternalsVisibleTo("DotNetNuke.Tests.Professional")] [assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] -[assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refeactored to Dependency Injection we should be able to remove this \ No newline at end of file +[assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("Dnn.PersonaBar.Extensions")] \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj index 1b845503ffb..80558966d2c 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj @@ -681,6 +681,12 @@ ..\..\..\..\Packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + + ..\..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + False @@ -713,6 +719,13 @@ + + + web.config + + + web.config + diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs index 2cec7920ebf..4b16bc3e7ab 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Web; +using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; @@ -25,7 +27,7 @@ public IDictionary GetSettings(MenuItem menuItem) { return new Dictionary { - {"previewUrl", Globals.NavigateURL()}, + {"previewUrl", Globals.DependencyProvider.GetService().NavigateURL()}, }; } } diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs index f7c1d87ca53..fbf6a44ce9c 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs @@ -28,6 +28,7 @@ using Dnn.PersonaBar.Library; using Dnn.PersonaBar.Library.Attributes; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Instrumentation; using DotNetNuke.Services.Localization; @@ -41,9 +42,15 @@ namespace Dnn.PersonaBar.Servers.Services public class ServerController : PersonaBarApiController { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(ServerController)); - + protected INavigationManager NavigationManager { get; } internal static string LocalResourceFile => Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Servers/App_LocalResources/Servers.resx"); + public ServerController(INavigationManager navigationManager) + { + NavigationManager = navigationManager; + } + + [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage RestartApplication() @@ -54,7 +61,7 @@ public HttpResponseMessage RestartApplication() log.AddProperty("Message", Localization.GetString("UserRestart", LocalResourceFile)); LogController.Instance.AddLog(log); Config.Touch(); - return Request.CreateResponse(HttpStatusCode.OK, new {url = Globals.NavigateURL()}); + return Request.CreateResponse(HttpStatusCode.OK, new {url = NavigationManager.NavigateURL()}); } catch (Exception exc) { @@ -71,7 +78,7 @@ public HttpResponseMessage ClearCache() { DataCache.ClearCache(); ClientResourceManager.ClearCache(); - return Request.CreateResponse(HttpStatusCode.OK, new {url = Globals.NavigateURL() }); + return Request.CreateResponse(HttpStatusCode.OK, new {url = NavigationManager.NavigateURL() }); } catch (Exception exc) { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs index 437ac918e20..9b6c89ef231 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs @@ -23,6 +23,7 @@ using Dnn.PersonaBar.Library.Attributes; using Dnn.PersonaBar.SiteSettings.Services.Dto; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; @@ -86,6 +87,12 @@ public class SiteSettingsController : PersonaBarApiController private const double DefaultMessagingThrottlingInterval = 0.5; // set default MessagingThrottlingInterval value to 30 seconds. + protected INavigationManager NavigationManager { get; } + public SiteSettingsController(INavigationManager navigationManager) + { + NavigationManager = navigationManager; + } + #region Site Info API /// GET: api/SiteSettings/GetPortalSettings @@ -2727,7 +2734,7 @@ public HttpResponseMessage UpdateLanguage(UpdateLanguageRequest request) if (LocaleController.Instance.GetLocales(pid).Count == 2) { - redirectUrl = Globals.NavigateURL(); + redirectUrl = NavigationManager.NavigateURL(); } } else @@ -2741,7 +2748,7 @@ public HttpResponseMessage UpdateLanguage(UpdateLanguageRequest request) StringComparison.OrdinalIgnoreCase) || LocaleController.Instance.GetLocales(pid).Count == 1) { - redirectUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, + redirectUrl = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.IsSuperTab, PortalSettings, "", defaultLocale.Code); } diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config index 229c9a1b661..94f1e523e42 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file From 84a62ca0b8643d7f0db60cbe2ed3b3017c16603a Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Wed, 16 Oct 2019 10:09:58 -0400 Subject: [PATCH 07/44] Refactored NavigateURL to use new INavigationManager --- .../DotNetNuke.Web.Razor/Helpers/UrlHelper.cs | 8 +++-- .../LanguageServiceController.cs | 11 +++++-- .../DotNetNuke.Website.Deprecated.csproj | 7 +++++ .../admin/ControlPanel/AddPage.ascx.cs | 10 ++++++- .../admin/ControlPanel/ControlBar.ascx.cs | 30 ++++++++++++------- .../admin/ControlPanel/UpdatePage.ascx.cs | 10 ++++++- .../admin/ControlPanel/WebUpload.ascx.cs | 11 +++++-- .../packages.config | 5 ++++ .../Library/Properties/AssemblyInfo.cs | 4 ++- .../Groups/DotNetNuke.Modules.Groups.csproj | 6 ++++ DNN Platform/Modules/Groups/View.ascx.cs | 10 ++++++- DNN Platform/Modules/Groups/packages.config | 2 ++ DNN Platform/Modules/Groups/web.config | 10 +++++-- .../HTML/Components/HtmlTextController.cs | 9 +++++- .../Modules/RazorHost/CreateModule.ascx.cs | 2 +- .../Extensions/CreateModuleController.cs | 10 ++++++- .../Services/LanguagesController.cs | 8 ++++- 17 files changed, 125 insertions(+), 28 deletions(-) create mode 100644 DNN Platform/DotNetNuke.Website.Deprecated/packages.config diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs index be1f3b37c43..e989aa2090b 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs @@ -21,8 +21,10 @@ #region Usings using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.UI.Modules; using System; +using Microsoft.Extensions.DependencyInjection; #endregion @@ -32,23 +34,25 @@ namespace DotNetNuke.Web.Razor.Helpers public class UrlHelper { private readonly ModuleInstanceContext _context; + protected INavigationManager NavigationManager { get; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public UrlHelper(ModuleInstanceContext context) { _context = context; + NavigationManager = Globals.DependencyProvider.GetService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl() { - return Globals.NavigateURL(_context.TabId); + return NavigationManager.NavigateURL(_context.TabId); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl(string controlKey) { - return Globals.NavigateURL(_context.TabId, controlKey, "mid=" + _context.ModuleId); + return NavigationManager.NavigateURL(_context.TabId, controlKey, "mid=" + _context.ModuleId); } } } \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs index 0d3a946c273..721ad739ff0 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs @@ -37,12 +37,19 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Web.Api; using DotNetNuke.Entities.Tabs; +using DotNetNuke.Common.Interfaces; namespace DotNetNuke.Web.InternalServices { [DnnAuthorize] public class LanguageServiceController : DnnApiController { + protected INavigationManager NavigationManager { get; } + public LanguageServiceController(INavigationManager navigationManager) + { + NavigationManager = navigationManager; + } + public class PageDto { public string Name { get; set; } @@ -70,8 +77,8 @@ public HttpResponseMessage GetNonTranslatedPages(string languageCode) pages.Add(new PageDto() { Name = page.TabName, - ViewUrl = DotNetNuke.Common.Globals.NavigateURL(page.TabID), - EditUrl = DotNetNuke.Common.Globals.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + PortalSettings.ActiveTab.TabID) + ViewUrl = NavigationManager.NavigateURL(page.TabID), + EditUrl = NavigationManager.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + PortalSettings.ActiveTab.TabID) }); } } diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj index 14d2098f69d..ae6fd79db08 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj +++ b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj @@ -75,6 +75,12 @@ + + ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -187,6 +193,7 @@ Designer + diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs index 90f323ae21c..cdb0b3cb05c 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs @@ -24,6 +24,7 @@ using System.Collections; using System.IO; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -41,10 +42,17 @@ namespace DotNetNuke.UI.ControlPanel { + using DotNetNuke.Common.Interfaces; using System.Web.UI.WebControls; public partial class AddPage : UserControl, IDnnRibbonBarTool { + protected INavigationManager NavigationManager { get; } + public AddPage() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + #region "Event Handlers" protected override void OnLoad(EventArgs e) @@ -116,7 +124,7 @@ protected void CmdAddPageClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(Globals.NavigateURL(newTab.TabID)); + Response.Redirect(NavigationManager.NavigateURL(newTab.TabID)); } else { diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs index e7efcbedc32..e8b97c757e0 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs @@ -27,6 +27,7 @@ using System.Linq; using System.Text; using System.Web; +using Microsoft.Extensions.DependencyInjection; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using DotNetNuke.Application; @@ -52,6 +53,7 @@ using DotNetNuke.Web.Components.Controllers; using DotNetNuke.Web.Components.Controllers.Models; using Globals = DotNetNuke.Common.Globals; +using DotNetNuke.Common.Interfaces; #endregion @@ -61,6 +63,12 @@ namespace DotNetNuke.UI.ControlPanels { public partial class ControlBar : ControlPanelBase { + protected INavigationManager NavigationManager { get; } + public ControlBar() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + private readonly IList _adminCommonTabs = new List { "Site Settings", "Security Roles", "User Accounts", @@ -309,61 +317,61 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri case "PageSettings": if (TabPermissionController.CanManagePage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); } break; case "CopyPage": if (TabPermissionController.CanCopyPage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); } break; case "DeletePage": if (TabPermissionController.CanDeletePage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); } break; case "PageTemplate": if (TabPermissionController.CanManagePage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); } break; case "PageLocalization": if (TabPermissionController.CanManagePage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); } break; case "PagePermission": if (TabPermissionController.CanAdminPage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); } break; case "ImportPage": if (TabPermissionController.CanImportPage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); } break; case "ExportPage": if (TabPermissionController.CanExportPage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); } break; case "NewPage": if (TabPermissionController.CanAddPage()) { - returnValue = Globals.NavigateURL("Tab", "activeTab=settingTab"); + returnValue = NavigationManager.NavigateURL("Tab", "activeTab=settingTab"); } break; case "PublishPage": if (TabPermissionController.CanAdminPage()) { - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID); } break; default: @@ -405,7 +413,7 @@ protected string GetTabURL(List additionalParams, string toolName, bool } string currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; - strURL = Globals.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); + strURL = NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); } return strURL; diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs index 9128a397bb5..5d85ddf241d 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs @@ -24,6 +24,7 @@ using System.IO; using System.Linq; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -43,10 +44,17 @@ namespace DotNetNuke.UI.ControlPanel { + using DotNetNuke.Common.Interfaces; using System.Web.UI.WebControls; public partial class UpdatePage : UserControl, IDnnRibbonBarTool { + protected INavigationManager NavigationManager { get; } + public UpdatePage() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + #region "Event Handlers" protected override void OnLoad(EventArgs e) @@ -127,7 +135,7 @@ protected void CmdUpdateClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(Globals.NavigateURL(tab.TabID)); + Response.Redirect(NavigationManager.NavigateURL(tab.TabID)); } else { diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs index 5d55c895f19..962a16e64d1 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs @@ -26,8 +26,10 @@ using System.Linq; using System.Web; using System.Web.UI.WebControls; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Modules; @@ -60,6 +62,11 @@ namespace DotNetNuke.Modules.Admin.FileManager public partial class WebUpload : PortalModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (WebUpload)); + protected INavigationManager NavigationManager { get; } + public WebUpload() + { + NavigationManager = DependencyProvider.GetService(); + } #region "Members" private string _DestinationFolder; @@ -185,7 +192,7 @@ private void CheckSecurity() { if (!ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "CONTENT,EDIT") && !UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators")) { - Response.Redirect(Globals.NavigateURL("Access Denied"), true); + Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); } } @@ -236,7 +243,7 @@ public string ReturnURL() { TabID = int.Parse(Request.Params["rtab"]); } - return Globals.NavigateURL(TabID); + return NavigationManager.NavigateURL(TabID); } protected override void OnInit(EventArgs e) diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/packages.config b/DNN Platform/DotNetNuke.Website.Deprecated/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/DotNetNuke.Website.Deprecated/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DNN Platform/Library/Properties/AssemblyInfo.cs b/DNN Platform/Library/Properties/AssemblyInfo.cs index ad27dc95691..f21dd282c68 100644 --- a/DNN Platform/Library/Properties/AssemblyInfo.cs +++ b/DNN Platform/Library/Properties/AssemblyInfo.cs @@ -58,4 +58,6 @@ [assembly: InternalsVisibleTo("DotNetNuke.Tests.Professional")] [assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] [assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refeactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("Dnn.PersonaBar.Extensions")] \ No newline at end of file +[assembly: InternalsVisibleTo("Dnn.PersonaBar.Extensions")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("DotNetNuke.Modules.Html")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("DotNetNuke.Website.Deprecated")] // Once Globals is refeactored to Dependency Injection we should be able to remove this \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj index 5e1ed5d57c0..529bfbc7c05 100644 --- a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj +++ b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj @@ -51,6 +51,12 @@ False ..\..\DotNetNuke.Web.Client\bin\DotNetNuke.Web.Client.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + False ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index 7e7cd9f5704..2b10e521411 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -24,6 +24,7 @@ #region Usings using System; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; @@ -34,6 +35,7 @@ using DotNetNuke.Modules.Groups.Components; using DotNetNuke.Common; using DotNetNuke.Framework; +using DotNetNuke.Common.Interfaces; #endregion @@ -46,6 +48,12 @@ namespace DotNetNuke.Modules.Groups /// ----------------------------------------------------------------------------- public partial class View : GroupsModuleBase { + protected INavigationManager NavigationManager { get; } + public View() + { + NavigationManager = DependencyProvider.GetService(); + } + #region Event Handlers protected override void OnInit(EventArgs e) @@ -72,7 +80,7 @@ private void Page_Load(object sender, EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); if (GroupId < 0) { if (TabId != GroupListTabId && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) { - Response.Redirect(Globals.NavigateURL(GroupListTabId)); + Response.Redirect(NavigationManager.NavigateURL(GroupListTabId)); } } GroupsModuleBase ctl = (GroupsModuleBase)LoadControl(ControlPath); diff --git a/DNN Platform/Modules/Groups/packages.config b/DNN Platform/Modules/Groups/packages.config index 4a4092b618b..4073d3c4617 100644 --- a/DNN Platform/Modules/Groups/packages.config +++ b/DNN Platform/Modules/Groups/packages.config @@ -4,5 +4,7 @@ + + \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/web.config b/DNN Platform/Modules/Groups/web.config index 1b3cf4537a7..50d388eadbd 100644 --- a/DNN Platform/Modules/Groups/web.config +++ b/DNN Platform/Modules/Groups/web.config @@ -1,10 +1,14 @@ - + - - + + + + + + diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs index cd4265f3add..cec3d9183e5 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs @@ -26,6 +26,7 @@ using System.Web; using System.Web.UI; using System.Xml; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -44,6 +45,7 @@ using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Services.Tokens; using DotNetNuke.Services.Exceptions; +using DotNetNuke.Common.Interfaces; namespace DotNetNuke.Modules.Html { @@ -61,6 +63,11 @@ public class HtmlTextController : ModuleSearchBase, IPortable, IUpgradeable { public const int MAX_DESCRIPTION_LENGTH = 100; private const string PortalRootToken = "{{PortalRoot}}"; + protected INavigationManager NavigationManager { get; } + public HtmlTextController() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } #region Private Methods @@ -161,7 +168,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) Localization.LocalSharedResourceFile); string strSubject = Localization.GetString("NotificationSubject", strResourceFile); string strBody = Localization.GetString("NotificationBody", strResourceFile); - strBody = strBody.Replace("[URL]", Globals.NavigateURL(objModule.TabID)); + strBody = strBody.Replace("[URL]", NavigationManager.NavigateURL(objModule.TabID)); strBody = strBody.Replace("[STATE]", objHtmlText.StateName); // process user notification collection diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index b0d53f398ee..83e31adca66 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -50,7 +50,7 @@ public partial class CreateModule : ModuleUserControlBase private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; private string razorScriptFolder = "~/DesktopModules/RazorModules/RazorHost/Scripts/"; - + [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] protected string ModuleControl { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs index 04403016fb0..0bca0f272fa 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs @@ -2,8 +2,10 @@ using System.IO; using System.Text; using System.Text.RegularExpressions; +using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; @@ -19,6 +21,12 @@ namespace Dnn.PersonaBar.Extensions.Components { public class CreateModuleController : ServiceLocator, ICreateModuleController { + protected INavigationManager NavigationManager { get; } + public CreateModuleController() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + protected override Func GetFactory() { return () => new CreateModuleController(); @@ -314,7 +322,7 @@ private string CreateNewPage(ModuleDefinitionInfo moduleDefinition) objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - return Globals.NavigateURL(newTab.TabID); + return NavigationManager.NavigateURL(newTab.TabID); } return string.Empty; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs index 007645a0084..cae8196b8e7 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs @@ -24,6 +24,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Web.Api; +using DotNetNuke.Common.Interfaces; namespace Dnn.PersonaBar.SiteSettings.Services { @@ -33,6 +34,11 @@ public class LanguagesController : PersonaBarApiController private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(LanguagesController)); private const string LocalResourcesFile = "~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.SiteSettings/App_LocalResources/SiteSettings.resx"; private const string AuthFailureMessage = "Authorization has been denied for this request."; + protected INavigationManager NavigationManager { get; } + public LanguagesController(INavigationManager navigationManager) + { + NavigationManager = navigationManager; + } // Sample matches: // MyResources.ascx.en-US.resx @@ -971,7 +977,7 @@ private IList GetTabsForTranslationInternal(int portalId, string { PageId = page.TabID, PageName = page.TabName, - ViewUrl = Globals.NavigateURL(page.TabID), + ViewUrl = NavigationManager.NavigateURL(page.TabID), })); } return pages; From 6c5dacf5e7e3b360c1002cf5c860d020224ba238 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Wed, 16 Oct 2019 11:59:14 -0400 Subject: [PATCH 08/44] Refactored Globals.NavigateURL -> INavigationManager --- .../Dnn.Modules.Console/Dnn.Modules.Console.csproj | 10 ++++++++++ .../Dnn.Modules.Console/ViewConsole.ascx.cs | 12 ++++++++++-- .../Dnn.Modules.Console/packages.config | 5 +++++ .../Admin Modules/Dnn.Modules.Console/web.config | 4 ++++ .../Dnn.Modules.ModuleCreator/viewsource.ascx.cs | 4 ++-- .../Routing/StandardModuleRoutingProvider.cs | 10 +++++++++- .../DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs | 10 +++++++++- .../UI/WebControls/DnnRibbonBarTool.cs | 12 ++++++++++-- .../admin/ControlPanel/AddModule.ascx.cs | 12 ++++++++++-- DNN Platform/Library/Common/Utilities/UrlUtils.cs | 11 +++++++++-- DNN Platform/Library/Properties/AssemblyInfo.cs | 5 ++++- .../UI/Modules/ProfileModuleUserControlBase.cs | 10 +++++++++- DNN Platform/Library/UI/Skins/Skin.cs | 5 ++++- .../Modules/DigitalAssets/EditFolderMapping.ascx.cs | 12 ++++++++++-- .../Modules/DigitalAssets/FolderMappings.ascx.cs | 4 ++-- .../Modules/Groups/Components/GroupViewParser.cs | 7 +++++-- DNN Platform/Modules/Groups/GroupsModuleBase.cs | 10 +++++++++- .../EditBar/Dnn.EditBar.UI/app.config | 2 +- .../Containers/PersonaBarContainer.cs | 12 ++++++++++-- .../Dnn.PersonaBar.Library.csproj | 9 +++++++++ .../Library/Dnn.PersonaBar.Library/packages.config | 5 +++++ .../Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj | 7 +++++++ .../MenuControllers/LinkMenuController.cs | 10 +++++++++- .../Library/Dnn.PersonaBar.UI/packages.config | 5 +++++ 24 files changed, 167 insertions(+), 26 deletions(-) create mode 100644 DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config create mode 100644 Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/packages.config create mode 100644 Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/packages.config diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj index c22d39ca857..c6110ecc174 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj @@ -20,6 +20,7 @@ + true @@ -50,6 +51,12 @@ ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + @@ -134,6 +141,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs index c4ce44ac774..82b01c74f0a 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs @@ -31,8 +31,10 @@ using System.Text; using System.Web.UI; using System.Web.UI.WebControls; +using Microsoft.Extensions.DependencyInjection; using Dnn.Modules.Console.Components; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; @@ -53,6 +55,7 @@ namespace Dnn.Modules.Console { public partial class ViewConsole : PortalModuleBase { + protected INavigationManager NavigationManager { get; } private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (ViewConsole)); private ConsoleController _consoleCtrl; private string _defaultSize = string.Empty; @@ -60,6 +63,11 @@ public partial class ViewConsole : PortalModuleBase private int _groupTabID = -1; private IList _tabs; + public ViewConsole() + { + NavigationManager = DependencyProvider.GetService(); + } + #region Public Properties public bool AllowSizeChange @@ -503,12 +511,12 @@ protected string GetHtml(TabInfo tab) var tabUrl = tab.FullUrl; if (ProfileUserId > -1) { - tabUrl = Globals.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); + tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); } if (GroupId > -1) { - tabUrl = Globals.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); + tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); } returnValue += string.Format(sb.ToString(), diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config new file mode 100644 index 00000000000..015e7e36813 --- /dev/null +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/web.config b/DNN Platform/Admin Modules/Dnn.Modules.Console/web.config index 931974a0ba4..bd5d3ac8fde 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/web.config +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/web.config @@ -6,6 +6,10 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index 723cd094e48..e3ce1345255 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -530,7 +530,7 @@ private void OnPackageClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(Globals.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); + Response.Redirect(NavigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); } private void OnConfigureClick(object sender, EventArgs e) @@ -539,7 +539,7 @@ private void OnConfigureClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(Globals.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); + Response.Redirect(NavigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); } private void OnCreateClick(object sender, EventArgs e) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs index ae8de091e43..5a8d360e340 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs @@ -24,8 +24,10 @@ using System.Linq; using System.Web; using System.Web.Routing; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Collections; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Entities.Modules; using DotNetNuke.UI.Modules; @@ -33,8 +35,14 @@ namespace DotNetNuke.Web.Mvc.Routing { public class StandardModuleRoutingProvider : ModuleRoutingProvider { + protected INavigationManager NavigationManager { get; } private const string ExcludedQueryStringParams = "tabid,mid,ctl,language,popup,action,controller"; private const string ExcludedRouteValues = "mid,ctl,popup"; + public StandardModuleRoutingProvider() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + public override string GenerateUrl(RouteValueDictionary routeValues, ModuleInstanceContext moduleContext) { @@ -50,7 +58,7 @@ public override string GenerateUrl(RouteValueDictionary routeValues, ModuleInsta if (String.IsNullOrEmpty(controlKey)) { additionalParams.Insert(0, "moduleId=" + moduleContext.Configuration.ModuleID); - url = Globals.NavigateURL("", additionalParams.ToArray()); + url = NavigationManager.NavigateURL("", additionalParams.ToArray()); } else { diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs index b9fee81edab..f70331e439a 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs @@ -21,8 +21,10 @@ using System; using System.Globalization; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -34,6 +36,12 @@ namespace DotNetNuke.Web.Mvp [Obsolete("Deprecated in DNN 9.2.0. Replace WebFormsMvp and DotNetNuke.Web.Mvp with MVC or SPA patterns instead. Scheduled removal in v11.0.0.")] public abstract class ProfileModuleViewBase : ModuleView, IProfileModule where TModel : class, new() { + protected INavigationManager NavigationManager { get; } + public ProfileModuleViewBase() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + #region IProfileModule Members public abstract bool DisplayModule { get; } @@ -102,7 +110,7 @@ protected override void OnInit(EventArgs e) { //Clicked on breadcrumb - don't know which user Response.Redirect(Request.IsAuthenticated - ? Globals.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) : GetRedirectUrl(), true); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs index 9e726912683..ae64a1b9196 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs @@ -24,9 +24,11 @@ using System.Collections.Generic; using System.Threading; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; @@ -46,6 +48,12 @@ namespace DotNetNuke.Web.UI.WebControls [ParseChildren(true)] public class DnnRibbonBarTool : Control, IDnnRibbonBarTool { + protected INavigationManager NavigationManager { get; } + public DnnRibbonBarTool() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + #region Properties private IDictionary _allTools; @@ -483,7 +491,7 @@ protected virtual string BuildToolUrl() break; case "ExportPage": - returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); break; case "NewPage": @@ -570,7 +578,7 @@ protected virtual string GetTabURL(List additionalParams) } string currentCulture = Thread.CurrentThread.CurrentCulture.Name; - strURL = Globals.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); + strURL = NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); } return strURL; diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs index 67352eb4c48..2e1998d5e01 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs @@ -29,6 +29,7 @@ using System.Threading; using System.Web; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; using DotNetNuke.Common.Utilities; @@ -60,13 +61,20 @@ namespace DotNetNuke.UI.ControlPanel { - using System.Web.UI.WebControls; + using DotNetNuke.Common.Interfaces; + using System.Web.UI.WebControls; public partial class AddModule : UserControlBase, IDnnRibbonBarTool { + protected INavigationManager NavigationManager { get; } private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (AddModule)); private bool _enabled = true; + public AddModule() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + /// /// Return the for the selected portal (from the Site list), unless /// the site list is not visible or there are no other sites in our site group, in which case @@ -167,7 +175,7 @@ protected override void OnLoad(EventArgs e) var objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); if (objModule != null) { - var strURL = Globals.NavigateURL(objModule.TabID, true); + var strURL = NavigationManager.NavigateURL(objModule.TabID, true); hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; } else diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 3903d631a10..78d70f15af8 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -26,7 +26,8 @@ using System.Text.RegularExpressions; using System.Web; using System.Web.UI; - +using Microsoft.Extensions.DependencyInjection; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; @@ -40,6 +41,12 @@ namespace DotNetNuke.Common.Utilities { public class UrlUtils { + protected INavigationManager NavigationManager { get; } + public UrlUtils() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + public static string Combine(string baseUrl, string relativeUrl) { if (baseUrl.Length == 0) @@ -414,7 +421,7 @@ public static void Handle404Exception(HttpResponse response, PortalSettings port { if (portalSetting?.ErrorPage404 > Null.NullInteger) { - response.Redirect(Globals.NavigateURL(portalSetting.ErrorPage404, string.Empty, "status=404")); + response.Redirect(NavigationManager.NavigateURL(portalSetting.ErrorPage404, string.Empty, "status=404")); } else { diff --git a/DNN Platform/Library/Properties/AssemblyInfo.cs b/DNN Platform/Library/Properties/AssemblyInfo.cs index f21dd282c68..c42b8311b75 100644 --- a/DNN Platform/Library/Properties/AssemblyInfo.cs +++ b/DNN Platform/Library/Properties/AssemblyInfo.cs @@ -60,4 +60,7 @@ [assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refeactored to Dependency Injection we should be able to remove this [assembly: InternalsVisibleTo("Dnn.PersonaBar.Extensions")] // Once Globals is refeactored to Dependency Injection we should be able to remove this [assembly: InternalsVisibleTo("DotNetNuke.Modules.Html")] // Once Globals is refeactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Website.Deprecated")] // Once Globals is refeactored to Dependency Injection we should be able to remove this \ No newline at end of file +[assembly: InternalsVisibleTo("DotNetNuke.Website.Deprecated")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("Dnn.PersonaBar.UI")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("Dnn.PersonaBar.Library")] // Once Globals is refeactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("DotNetNuke.Modules.Groups")] // Once Globals is refeactored to Dependency Injection we should be able to remove this \ No newline at end of file diff --git a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs index 9a5af7ba9d4..b3c833b5836 100644 --- a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs @@ -23,8 +23,10 @@ using System; using System.Globalization; using System.Threading; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -36,6 +38,12 @@ namespace DotNetNuke.UI.Modules { public abstract class ProfileModuleUserControlBase : ModuleUserControlBase, IProfileModule { + protected INavigationManager NavigationManager { get; } + public ProfileModuleUserControlBase() + { + NavigationManager = Globals.DependencyProvider.GetService(); + } + #region IProfileModule Members public abstract bool DisplayModule { get; } @@ -104,7 +112,7 @@ protected override void OnInit(EventArgs e) { //Clicked on breadcrumb - don't know which user Response.Redirect(Request.IsAuthenticated - ? Globals.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) : GetRedirectUrl(), true); } catch (ThreadAbortException) diff --git a/DNN Platform/Library/UI/Skins/Skin.cs b/DNN Platform/Library/UI/Skins/Skin.cs index a797f0fcf6f..59491fa8f36 100644 --- a/DNN Platform/Library/UI/Skins/Skin.cs +++ b/DNN Platform/Library/UI/Skins/Skin.cs @@ -35,6 +35,7 @@ using DotNetNuke.Application; using DotNetNuke.Collections.Internal; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; @@ -105,6 +106,7 @@ public class Skin : UserControlBase public Skin() { ModuleControlPipeline = Globals.DependencyProvider.GetRequiredService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -125,6 +127,7 @@ internal Control ControlPanel } protected IModuleControlPipeline ModuleControlPipeline { get; } + protected INavigationManager NavigationManager { get; } #endregion #region Friend Properties @@ -464,7 +467,7 @@ private bool ProcessMasterModules() if (TabVersionController.Instance.GetTabVersions(TabController.CurrentPage.TabID).All(tabVersion => tabVersion.Version != urlVersion)) { - Response.Redirect(Globals.NavigateURL(PortalSettings.ErrorPage404, string.Empty, "status=404")); + Response.Redirect(NavigationManager.NavigateURL(PortalSettings.ErrorPage404, string.Empty, "status=404")); } } diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index 1d66802548f..9e15beefb66 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -21,8 +21,10 @@ using System; using System.Linq; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; @@ -35,6 +37,12 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class EditFolderMapping : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public EditFolderMapping() + { + NavigationManager = DependencyProvider.GetService(); + } + #region Private Variables private readonly IFolderMappingController _folderMappingController = FolderMappingController.Instance; @@ -200,8 +208,8 @@ private void cmdUpdate_Click(object sender, EventArgs e) return; } - if (!Response.IsRequestBeingRedirected) - Response.Redirect(Globals.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); + if (!Response.IsRequestBeingRedirected) + Response.Redirect(NavigationManager.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index f7d41154867..4a523b6bd3e 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -128,7 +128,7 @@ protected void MappingsGrid_OnItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == "Edit") { - Response.Redirect(Globals.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); + Response.Redirect(NavigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); } else { @@ -181,7 +181,7 @@ protected void OnNewMappingClick(object sender, EventArgs e) { try { - Response.Redirect(Globals.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); + Response.Redirect(NavigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { diff --git a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs index 85f50836fd3..5df075a0933 100644 --- a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs +++ b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs @@ -2,17 +2,19 @@ using System.Collections.Generic; using System.Linq; using System.Web; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Entities.Portals; using DotNetNuke.Security.Roles; using DotNetNuke.Entities.Users; using DotNetNuke.Common; using DotNetNuke.Services.Localization; +using DotNetNuke.Common.Interfaces; namespace DotNetNuke.Modules.Groups.Components { public class GroupViewParser { - + protected INavigationManager NavigationManager { get; } PortalSettings PortalSettings { get; set; } RoleInfo RoleInfo { get; set; } UserInfo CurrentUser { get; set; } @@ -27,6 +29,7 @@ public GroupViewParser(PortalSettings portalSettings, RoleInfo roleInfo, UserInf CurrentUser = currentUser; Template = template; GroupViewTabId = groupViewTabId; + NavigationManager = Globals.DependencyProvider.GetService(); } public string ParseView() @@ -87,7 +90,7 @@ public string ParseView() Template = Template.Replace("[GROUPEDITBUTTON]", String.Empty); - var url = Globals.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); + var url = NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); Template = Utilities.ParseTokenWrapper(Template, "IsPendingMember", membershipPending); Template = Template.Replace("[groupviewurl]", url); diff --git a/DNN Platform/Modules/Groups/GroupsModuleBase.cs b/DNN Platform/Modules/Groups/GroupsModuleBase.cs index 2897562fd05..210b7313097 100644 --- a/DNN Platform/Modules/Groups/GroupsModuleBase.cs +++ b/DNN Platform/Modules/Groups/GroupsModuleBase.cs @@ -28,7 +28,9 @@ using DotNetNuke.Entities.Modules; using DotNetNuke.Modules.Groups.Components; using System; +using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Security.Permissions; +using DotNetNuke.Common.Interfaces; #endregion @@ -36,6 +38,12 @@ namespace DotNetNuke.Modules.Groups { public class GroupsModuleBase : PortalModuleBase { + protected INavigationManager NavigationManager { get; } + public GroupsModuleBase() + { + NavigationManager = DependencyProvider.GetService(); + } + public enum GroupMode { Setup = 0, @@ -267,7 +275,7 @@ public string GetCreateUrl() public string GetClearFilterUrl() { - return Globals.NavigateURL(TabId, ""); + return NavigationManager.NavigateURL(TabId, ""); } public string GetEditUrl() diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/app.config b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/app.config index 195db1f423d..44298137ae7 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/app.config +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/app.config @@ -4,7 +4,7 @@ - + diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index d22add16e9c..77d4edf2d35 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -24,11 +24,13 @@ using System.Threading; using System.Web; using System.Web.UI; +using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Common; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Helper; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Application; +using DotNetNuke.Common.Interfaces; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; @@ -40,6 +42,12 @@ namespace Dnn.PersonaBar.Library.Containers { public class PersonaBarContainer : IPersonaBarContainer { + protected INavigationManager NavigationManager { get; } + public PersonaBarContainer(INavigationManager navigationManager) + { + NavigationManager = navigationManager; + } + #region Instance Methods private static IPersonaBarContainer _instance; @@ -50,7 +58,7 @@ public static IPersonaBarContainer Instance { if (_instance == null) { - _instance = new PersonaBarContainer(); + _instance = new PersonaBarContainer(Globals.DependencyProvider.GetService()); } return _instance; @@ -113,7 +121,7 @@ private IDictionary GetConfigration(PortalSettings portalSetting settings.Add("userId", user.UserID); settings.Add("avatarUrl", Globals.ResolveUrl(Utilities.GetProfileAvatar(user))); settings.Add("culture", Thread.CurrentThread.CurrentUICulture.Name); - settings.Add("logOff", Globals.NavigateURL("Logoff")); + settings.Add("logOff", NavigationManager.NavigateURL("Logoff")); settings.Add("visible", Visible); settings.Add("userMode", portalSettings.UserMode.ToString()); settings.Add("userSettings", PersonaBarUserSettingsController.Instance.GetPersonaBarUserSettings()); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj index 52b87e53314..b2e1f871163 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj @@ -130,6 +130,12 @@ + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + False ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -150,6 +156,9 @@ + + + "); sb.Append(Environment.NewLine); sb.Append(""); - // Register Client Script + // Register Client Script ClientAPI.RegisterClientScriptBlock(control.Page, "InitialFocus", sb.ToString()); } } @@ -2290,7 +2290,7 @@ private static void DeleteFile(string filePath) Logger.Error(ex); } } - + private static void DeleteFolder(string strRoot) { try @@ -2366,7 +2366,7 @@ public static string CleanFileName(string FileName, string BadChars, string Repl /// ----------------------------------------------------------------------------- /// /// CleanName - removes characters from Module/Tab names that are being used for file names - /// in Module/Tab Import/Export. + /// in Module/Tab Import/Export. /// /// /// @@ -2386,9 +2386,9 @@ public static string CleanName(string Name) /// ----------------------------------------------------------------------------- /// - /// CreateValidClass - removes characters from Module/Tab names which are invalid + /// CreateValidClass - removes characters from Module/Tab names which are invalid /// for use as an XHTML class attribute / CSS class selector value and optionally - /// prepends the letter 'A' if the first character is not alphabetic. This differs + /// prepends the letter 'A' if the first character is not alphabetic. This differs /// from CreateValidID which replaces invalid characters with an underscore /// and replaces the first letter with an 'A' if it is not alphabetic /// @@ -2432,7 +2432,7 @@ public static string CreateValidClass(string inputValue, bool validateFirstChar) // If we're asked to validate the first character... if ((validateFirstChar)) { - // classes should begin with a letter ([A-Za-z])' + // classes should begin with a letter ([A-Za-z])' // prepend a starting non-letter character with an A if ((InvalidCharacters.IsMatch(returnValue))) { @@ -2486,7 +2486,7 @@ public static string CreateValidID(string inputValue) // Replace all characters that aren't in the list with an underscore returnValue = InvalidCharacters.Replace(inputValue, "_"); - // identifiers '... must begin with a letter ([A-Za-z])' + // identifiers '... must begin with a letter ([A-Za-z])' // replace a starting non-letter character with an A returnValue = InvalidInitialCharacters.Replace(returnValue, "A"); @@ -2515,7 +2515,7 @@ public static string AccessDeniedURL() /// URL to access denied view public static string AccessDeniedURL(string Message) { - var navigationManager = DependencyProvider.GetService(); + var navigationManager = DependencyProvider.GetRequiredService(); string strURL = ""; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (HttpContext.Current.Request.IsAuthenticated) @@ -2573,7 +2573,7 @@ public static string ApplicationURL() { return (ApplicationURL(_portalSettings.ActiveTab.TabID)); } - return (ApplicationURL(-1)); + return (ApplicationURL(-1)); } /// ----------------------------------------------------------------------------- @@ -2695,7 +2695,7 @@ public static string FriendlyUrl(TabInfo tab, string path, PortalSettings settin /// Generates the correctly formatted friendly URL /// /// - /// This overload includes an optional page to include in the URL, and the portal + /// This overload includes an optional page to include in the URL, and the portal /// settings for the site /// /// The current tab @@ -2712,7 +2712,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName, Port /// Generates the correctly formatted friendly url /// /// - /// This overload includes an optional page to include in the url, and the portal + /// This overload includes an optional page to include in the url, and the portal /// alias for the site /// /// The current tab @@ -2758,7 +2758,7 @@ public static TabType GetURLType(string URL) /// /// Url's as internal links to Files, Tabs and Users should only be imported if /// those files, tabs and users exist. This function parses the url, and checks - /// whether the internal links exist. + /// whether the internal links exist. /// If the link does not exist, the function will return an empty string /// /// Integer @@ -2842,7 +2842,7 @@ public static string LoginURL(string returnUrl, bool overrideSetting) /// Formatted URL. public static string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings) { - var navigationManager = DependencyProvider.GetService(); + var navigationManager = DependencyProvider.GetRequiredService(); string loginUrl; if (!string.IsNullOrEmpty(returnUrl)) { @@ -2891,7 +2891,7 @@ public static string UserProfileURL(int userId) string strURL = ""; PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - strURL = DependencyProvider.GetService().NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); + strURL = DependencyProvider.GetRequiredService().NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); return strURL; } @@ -2904,7 +2904,7 @@ public static string UserProfileURL(int userId) [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL() { - return DependencyProvider.GetService().NavigateURL(); + return DependencyProvider.GetRequiredService().NavigateURL(); } /// @@ -2916,7 +2916,7 @@ public static string NavigateURL() [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID) { - return DependencyProvider.GetService().NavigateURL(tabID); + return DependencyProvider.GetRequiredService().NavigateURL(tabID); } /// @@ -2929,7 +2929,7 @@ public static string NavigateURL(int tabID) [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab) { - return DependencyProvider.GetService().NavigateURL(tabID, isSuperTab); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab); } /// @@ -2941,7 +2941,7 @@ public static string NavigateURL(int tabID, bool isSuperTab) [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey) { - return DependencyProvider.GetService().NavigateURL(controlKey); + return DependencyProvider.GetRequiredService().NavigateURL(controlKey); } /// @@ -2954,7 +2954,7 @@ public static string NavigateURL(string controlKey) [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(controlKey, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(controlKey, additionalParameters); } /// @@ -2967,7 +2967,7 @@ public static string NavigateURL(string controlKey, params string[] additionalPa [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey) { - return DependencyProvider.GetService().NavigateURL(tabID, controlKey); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, controlKey); } /// @@ -2981,7 +2981,7 @@ public static string NavigateURL(int tabID, string controlKey) [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(tabID, controlKey, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, controlKey, additionalParameters); } /// @@ -2996,7 +2996,7 @@ public static string NavigateURL(int tabID, string controlKey, params string[] a [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(tabID, settings, controlKey, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, settings, controlKey, additionalParameters); } /// @@ -3012,7 +3012,7 @@ public static string NavigateURL(int tabID, PortalSettings settings, string cont [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } /// @@ -3028,7 +3028,7 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); } /// @@ -3045,7 +3045,7 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { - return DependencyProvider.GetService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); + return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); } /// @@ -3092,7 +3092,7 @@ public static string QueryStringDecode(string QueryString) /// Formatted url. public static string RegisterURL(string returnURL, string originalURL) { - var navigationManager = DependencyProvider.GetService(); + var navigationManager = DependencyProvider.GetRequiredService(); string strURL; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); string extraParams = String.Empty; @@ -3321,7 +3321,7 @@ public static string LinkClick(string Link, int TabID, int ModuleID, bool TrackC strLink = ApplicationPath + "/LinkClick.aspx?fileticket=" + UrlUtils.EncryptParameter(UrlUtils.GetParameterValue(Link), portalGuid); if (PortalId == Null.NullInteger) //To track Host files { - strLink += "&hf=1"; + strLink += "&hf=1"; } } if (String.IsNullOrEmpty(strLink)) @@ -3359,7 +3359,7 @@ public static string LinkClick(string Link, int TabID, int ModuleID, bool TrackC switch (UrlType) { case TabType.Tab: - strLink = DependencyProvider.GetService().NavigateURL(int.Parse(Link)); + strLink = DependencyProvider.GetRequiredService().NavigateURL(int.Parse(Link)); break; default: strLink = Link; @@ -3701,8 +3701,8 @@ public static bool IsHostTab(int tabId) /// /// Return User Profile Picture Formatted Url. UserId, width and height can be passed to build a formatted Avatar Url. - /// - /// Formatted url, e.g. http://www.mysite.com/DnnImageHandler.ashx?mode=profilepic&userid={0}&h={1}&w={2} + /// + /// Formatted url, e.g. http://www.mysite.com/DnnImageHandler.ashx?mode=profilepic&userid={0}&h={1}&w={2} /// /// Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> /// code behind - avatar.ImageUrl = string.Format(Globals.UserProfilePicFormattedUrl(), userInfo.UserID, 32, 32) @@ -3720,14 +3720,14 @@ public static string UserProfilePicFormattedUrl() avatarUrl, !HttpContext.Current.Request.Url.IsDefaultPort && !avatarUrl.Contains(":") ? ":" + HttpContext.Current.Request.Url.Port : string.Empty); - avatarUrl += "/DnnImageHandler.ashx?mode=profilepic&userId={0}&h={1}&w={2}"; + avatarUrl += "/DnnImageHandler.ashx?mode=profilepic&userId={0}&h={1}&w={2}"; return avatarUrl; } /// /// Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url. - /// + /// /// Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal /// /// Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> @@ -3741,7 +3741,7 @@ public static string UserProfilePicRelativeUrl() /// /// Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url. - /// + /// /// Indicates if cdv (Cache Delayed Verification) has to be included in the returned URL. /// Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal /// @@ -3768,9 +3768,9 @@ public static string UserProfilePicRelativeUrl(bool includeCdv) return ApplicationPath + childPortalAlias + query + cdv; } - + #region "Obsolete - retained for Binary Compatability" - + // **************************************************************************************** // Constants are inlined in code and would require a rebuild of any module or skinobject // that may be using these constants. @@ -3888,4 +3888,4 @@ public static TimeSpan ElapsedSinceAppStart } } } -} \ No newline at end of file +} diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index faaedad1cf8..24e646d0ec6 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; @@ -35,7 +35,7 @@ public class GlobalsImpl : IGlobals protected INavigationManager NavigationManager { get; } public GlobalsImpl() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string ApplicationPath @@ -91,7 +91,7 @@ public string GetDomainName(Uri requestedUri) public string GetDomainName(Uri requestedUri, bool parsePortNumber) { var domainName = new StringBuilder(); - + // split both URL separater, and parameter separator // We trim right of '?' so test for filename extensions can occur at END of URL-componenet. // Test: 'www.aspxforum.net' should be returned as a valid domain name. @@ -126,7 +126,7 @@ public string GetDomainName(Uri requestedUri, bool parsePortNumber) needExit = true; break; default: - // exclude filenames ENDing in ".aspx" or ".axd" --- + // exclude filenames ENDing in ".aspx" or ".axd" --- // we'll use reverse match, // - but that means we are checking position of left end of the match; // - and to do that, we need to ensure the string we test against is long enough; @@ -266,4 +266,4 @@ public string FriendlyUrl(TabInfo tab, string path, string pageName, string port return Globals.FriendlyUrl(tab, path, pageName, portalAlias); } } -} \ No newline at end of file +} diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index 25f5eb9c9bc..4dedd32a1c8 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -41,7 +41,7 @@ namespace DotNetNuke.Common.Utilities { public class UrlUtils { - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetService(); + private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); public static string Combine(string baseUrl, string relativeUrl) { @@ -194,12 +194,12 @@ public static bool IsSecureConnectionOrSslOffload(HttpRequest request) { return true; } - + } } return false; } - + private static bool IsRequestSSLOffloaded(HttpRequest request) { var sslOffLoadHeader = HostController.Instance.GetString("SSLOffloadHeader", ""); @@ -223,7 +223,7 @@ public static void OpenNewWindow(Page page, Type type, string url) public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect) { return PopUpUrl(url, control, portalSettings, onClickEvent, responseRedirect, 550, 950); - } + } public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth) { @@ -237,7 +237,7 @@ public static string PopUpUrl(string url, PortalSettings portalSettings, bool on public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth, bool refresh, string closingUrl) { - + if (UrlUtils.IsSecureConnectionOrSslOffload(HttpContext.Current.Request)) { url = url.Replace("http://", "https://"); diff --git a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs index b3c833b5836..7be1d22da39 100644 --- a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -41,7 +41,7 @@ public abstract class ProfileModuleUserControlBase : ModuleUserControlBase, IPro protected INavigationManager NavigationManager { get; } public ProfileModuleUserControlBase() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region IProfileModule Members @@ -104,8 +104,8 @@ private string GetRedirectUrl() protected override void OnInit(EventArgs e) { - if (string.IsNullOrEmpty(Request.Params["UserId"]) && - (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId + if (string.IsNullOrEmpty(Request.Params["UserId"]) && + (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId || ModuleContext.PortalSettings.ActiveTab.ParentId == ModuleContext.PortalSettings.UserTabId)) { try @@ -126,4 +126,4 @@ protected override void OnInit(EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs index 60c188e71a8..b8508cc13d6 100644 --- a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs +++ b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs @@ -27,7 +27,7 @@ public static string GetLoginUrl() if (request.IsAuthenticated) { - return Globals.DependencyProvider.GetService().NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); + return Globals.DependencyProvider.GetRequiredService().NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); } var returnUrl = HttpContext.Current.Request.RawUrl; @@ -48,7 +48,7 @@ public static string GetUserUrl() { if (portalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { - return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.DependencyProvider.GetService().NavigateURL()), Null.NullString); + return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.DependencyProvider.GetRequiredService().NavigateURL()), Null.NullString); } } else @@ -88,4 +88,4 @@ public static void DNNNodeToMenuNode(DNNNode dnnNode, MenuNode menuNode) menuNode.LargeImage = dnnNode.LargeImage; } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index 9e15beefb66..30fccc37d41 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -40,7 +40,7 @@ public partial class EditFolderMapping : PortalModuleBase protected INavigationManager NavigationManager { get; } public EditFolderMapping() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Variables @@ -135,7 +135,7 @@ protected override void OnLoad(EventArgs e) private void cmdUpdate_Click(object sender, EventArgs e) { Page.Validate("vgEditFolderMapping"); - + if (!Page.IsValid) return; try @@ -262,7 +262,7 @@ private void BindFolderMappingSettings() } if (string.IsNullOrEmpty(folderProviderType)) return; - + var settingsControlVirtualPath = FolderProvider.Instance(folderProviderType).GetSettingsControlVirtualPath(); if (String.IsNullOrEmpty(settingsControlVirtualPath)) return; @@ -281,5 +281,5 @@ private void BindFolderMappingSettings() } #endregion - } -} \ No newline at end of file + } +} diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index 4a523b6bd3e..0f8bfcaf99c 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -43,7 +43,7 @@ public partial class FolderMappings : PortalModuleBase protected INavigationManager NavigationManager { get; } public FolderMappings() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Variables @@ -205,4 +205,4 @@ private void UpdateFolderMappings(IList folderMappingsList) #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index 442277fbc8a..9bece1e65ac 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -70,7 +70,7 @@ public partial class View : PortalModuleBase, IActionable public View() { controller = new Factory().DigitalAssetsController; - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } private IExtensionPointFilter Filter @@ -154,7 +154,7 @@ protected string NavigateUrl } protected IEnumerable DefaultFolderProviderValues - { + { get { return this.controller.GetDefaultFolderProviderValues(this.ModuleId).Select(f => f.FolderMappingID.ToString(CultureInfo.InvariantCulture)).ToList(); @@ -226,7 +226,7 @@ private void InitializeGrid() var index = Math.Min(columnExtension.ColumnAt, Grid.Columns.Count - 1); Grid.Columns.AddAt(index, column); - } + } } private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderName, out DnnTreeNode nextNode, out int nextFolderId) @@ -246,7 +246,7 @@ private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderNam { newNode.Expanded = true; nextNode = newNode; - nextFolderId = folder.FolderID; + nextFolderId = folder.FolderID; } } } @@ -280,9 +280,9 @@ private void InitializeTreeViews(string initialPath) if (rootNode.Nodes.Count == 0) { - this.SetExpandable(rootNode, false); + this.SetExpandable(rootNode, false); } - + SetupNodeAttributes(rootNode, GetPermissionsForRootFolder(rootFolder.Permissions), rootFolder); FolderTreeView.Nodes.Clear(); @@ -331,21 +331,21 @@ private void InitializeTreeViewContextMenu() Value = "NewFolder", CssClass = "permission_ADD disabledIfFiltered", ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RefreshFolder", LocalResourceFile), Value = "RefreshFolder", CssClass = "permission_BROWSE permission_READ", ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RenameFolder", LocalResourceFile), Value = "RenameFolder", CssClass = "permission_MANAGE", ImageUrl = IconController.IconURL("FileRename", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Move", LocalResourceFile), @@ -375,7 +375,7 @@ private void InitializeTreeViewContextMenu() ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn") }, }); - + // Dnn Menu Item Extension Point foreach (var menuItem in epm.GetMenuItemExtensionPoints("DigitalAssets", "TreeViewContextMenu", Filter)) { @@ -409,42 +409,42 @@ private void InitializeGridContextMenu() Value = "Download", CssClass = "permission_READ", ImageUrl = IconController.IconURL("FileDownload", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Rename", LocalResourceFile), Value = "Rename", CssClass = "permission_MANAGE singleItem", ImageUrl = IconController.IconURL("FileRename", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Copy", LocalResourceFile), Value = "Copy", CssClass = "permission_COPY onlyFiles", ImageUrl = IconController.IconURL("FileCopy", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Move", LocalResourceFile), Value = "Move", CssClass = "permission_COPY disabledIfFiltered", ImageUrl = IconController.IconURL("FileMove", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Delete", LocalResourceFile), Value = "Delete", CssClass = "permission_DELETE", ImageUrl = IconController.IconURL("FileDelete", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Unlink", LocalResourceFile), Value = "Unlink", CssClass = "permission_DELETE singleItem onlyFolders", ImageUrl = IconController.IconURL("UnLink", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("UnzipFile", LocalResourceFile), @@ -458,7 +458,7 @@ private void InitializeGridContextMenu() Value = "Properties", CssClass = "permission_READ singleItem", ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn") - }, + }, new DnnMenuItem { Text = Localization.GetString("GetUrl", LocalResourceFile), @@ -491,21 +491,21 @@ private void InitializeEmptySpaceContextMenu() Value = "NewFolder", CssClass = "permission_ADD disabledIfFiltered", ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RefreshFolder", LocalResourceFile), Value = "RefreshFolder", CssClass = "permission_READ permission_BROWSE", ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("UploadFiles.Title", LocalResourceFile), Value = "UploadFiles", CssClass = "permission_ADD", ImageUrl = IconController.IconURL("UploadFiles", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("ViewFolderProperties", LocalResourceFile), @@ -580,8 +580,8 @@ protected override void OnLoad(EventArgs e) Skin.AddModuleMessage(this, Localization.GetString("InvalidUser.Error", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - - this.RootFolderViewModel = this.controller.GetUserFolder(this.PortalSettings.UserInfo); + + this.RootFolderViewModel = this.controller.GetUserFolder(this.PortalSettings.UserInfo); break; default: @@ -590,7 +590,7 @@ protected override void OnLoad(EventArgs e) this.RootFolderViewModel = this.controller.GetRootFolder(ModuleId); break; } - + var initialPath = ""; int folderId; if (int.TryParse(Request["folderId"] ?? DAMState["folderId"], out folderId)) @@ -697,10 +697,10 @@ protected void GridOnItemCreated(object sender, GridItemEventArgs e) new RadComboBoxItem { Text = "25", Value = "25" }, new RadComboBoxItem { Text = "50", Value = "50" }, new RadComboBoxItem { Text = "100", Value = "100" }, - new RadComboBoxItem - { - Text = Localization.GetString("All", LocalResourceFile), - Value = int.MaxValue.ToString(CultureInfo.InvariantCulture) + new RadComboBoxItem + { + Text = Localization.GetString("All", LocalResourceFile), + Value = int.MaxValue.ToString(CultureInfo.InvariantCulture) } }; @@ -713,4 +713,4 @@ protected void GridOnItemCreated(object sender, GridItemEventArgs e) } } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs index 5df075a0933..3c9ae80392b 100644 --- a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs +++ b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs @@ -29,7 +29,7 @@ public GroupViewParser(PortalSettings portalSettings, RoleInfo roleInfo, UserInf CurrentUser = currentUser; Template = template; GroupViewTabId = groupViewTabId; - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string ParseView() @@ -91,7 +91,7 @@ public string ParseView() Template = Template.Replace("[GROUPEDITBUTTON]", String.Empty); var url = NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); - + Template = Utilities.ParseTokenWrapper(Template, "IsPendingMember", membershipPending); Template = Template.Replace("[groupviewurl]", url); Components.GroupItemTokenReplace tokenReplace = new Components.GroupItemTokenReplace(RoleInfo); @@ -99,4 +99,4 @@ public string ParseView() return Template; } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/Components/Utilities.cs b/DNN Platform/Modules/Groups/Components/Utilities.cs index f5f909956c5..f120f293a42 100644 --- a/DNN Platform/Modules/Groups/Components/Utilities.cs +++ b/DNN Platform/Modules/Groups/Components/Utilities.cs @@ -19,7 +19,7 @@ internal static string ParseTokenWrapper(string Template, string Token, bool Con } public static string NavigateUrl(int TabId, string[] @params) { - return Globals.DependencyProvider.GetService()?.NavigateURL(TabId, "", @params); + return Globals.DependencyProvider.GetRequiredService()?.NavigateURL(TabId, "", @params); } public static string[] AddParams(string param, string[] currParams) { @@ -31,4 +31,4 @@ public static string[] AddParams(string param, string[] currParams) return tmpParams; } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/Create.ascx.cs b/DNN Platform/Modules/Groups/Create.ascx.cs index 0431e3286c8..fb55f57852a 100644 --- a/DNN Platform/Modules/Groups/Create.ascx.cs +++ b/DNN Platform/Modules/Groups/Create.ascx.cs @@ -21,7 +21,7 @@ public partial class Create : GroupsModuleBase protected INavigationManager NavigationManager { get; } public Create() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) { @@ -168,4 +168,4 @@ private void Create_Click(object sender, EventArgs e) Response.Redirect(NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() })); } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs index 2b2b101b432..dd961f3e510 100644 --- a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs @@ -15,7 +15,7 @@ public partial class GroupEdit : GroupsModuleBase protected INavigationManager NavigationManager { get; } public GroupEdit() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) @@ -58,11 +58,11 @@ protected void Page_Load(object sender, EventArgs e) txtGroupName.Text = roleInfo.RoleName; else litGroupName.Text = roleInfo.RoleName; - + txtDescription.Text = roleInfo.Description; rdAccessTypePrivate.Checked = !roleInfo.IsPublic; rdAccessTypePublic.Checked = roleInfo.IsPublic; - + if (roleInfo.Settings.ContainsKey("ReviewMembers")) { @@ -112,7 +112,7 @@ private void Save_Click(object sender, EventArgs e) { roleInfo.RoleName = txtGroupName.Text; } - + roleInfo.Description = txtDescription.Text; roleInfo.IsPublic = rdAccessTypePublic.Checked; @@ -153,4 +153,4 @@ private void Save_Click(object sender, EventArgs e) } } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/GroupsModuleBase.cs b/DNN Platform/Modules/Groups/GroupsModuleBase.cs index 210b7313097..f2141c77277 100644 --- a/DNN Platform/Modules/Groups/GroupsModuleBase.cs +++ b/DNN Platform/Modules/Groups/GroupsModuleBase.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -41,7 +41,7 @@ public class GroupsModuleBase : PortalModuleBase protected INavigationManager NavigationManager { get; } public GroupsModuleBase() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } public enum GroupMode @@ -284,4 +284,4 @@ public string GetEditUrl() } #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/List.ascx.cs b/DNN Platform/Modules/Groups/List.ascx.cs index 9cdc20816da..38ce33a8b45 100644 --- a/DNN Platform/Modules/Groups/List.ascx.cs +++ b/DNN Platform/Modules/Groups/List.ascx.cs @@ -11,7 +11,7 @@ public partial class List : GroupsModuleBase public INavigationManager NavigationManager { get; } public List() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } protected void Page_Load(object sender, EventArgs e) { @@ -58,4 +58,4 @@ protected void btnSearch_Click(object sender, EventArgs e) Response.Redirect(NavigationManager.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index 2b10e521411..bf65cd52c61 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -51,7 +51,7 @@ public partial class View : GroupsModuleBase protected INavigationManager NavigationManager { get; } public View() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Event Handlers @@ -87,7 +87,7 @@ private void Page_Load(object sender, EventArgs e) ctl.ModuleConfiguration = this.ModuleConfiguration; plhContent.Controls.Clear(); plhContent.Controls.Add(ctl); - + } catch (Exception exc) //Module failed to load { @@ -96,7 +96,7 @@ private void Page_Load(object sender, EventArgs e) } #endregion - - + + } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs index cec3d9183e5..af575df9c87 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; @@ -66,7 +66,7 @@ public class HtmlTextController : ModuleSearchBase, IPortable, IUpgradeable protected INavigationManager NavigationManager { get; } public HtmlTextController() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Private Methods @@ -115,7 +115,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) // if not published if (objHtmlText.IsPublished == false) { - arrUsers.Add(objHtmlText.CreatedByUserID); // include content owner + arrUsers.Add(objHtmlText.CreatedByUserID); // include content owner } // if not draft and not published @@ -155,7 +155,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) // process notifications if (arrUsers.Count > 0 || (objHtmlText.IsPublished && objHtmlText.Notify)) { - // get tabid from module + // get tabid from module ModuleInfo objModule = ModuleController.Instance.GetModule(objHtmlText.ModuleID, Null.NullInteger, true); PortalSettings objPortalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -175,7 +175,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) foreach (int intUserID in arrUsers) { - // create user notification record + // create user notification record _htmlTextUser = new HtmlTextUserInfo(); _htmlTextUser.ItemID = objHtmlText.ItemID; _htmlTextUser.StateID = objHtmlText.StateID; @@ -272,7 +272,7 @@ public string ReplaceWithRootToken(Match m) var aliases = PortalAliasController.Instance.GetPortalAliases(); if (!aliases.Contains(domain)) { - // this is no not a portal url so even if it contains /portals/.. + // this is no not a portal url so even if it contains /portals/.. // we do not need to replace it with a token return m.ToString(); } @@ -387,8 +387,8 @@ public HtmlTextInfo GetTopHtmlText(int moduleId, bool isPublished, int workflowI htmlText.WorkflowName = "[REPAIR_WORKFLOW]"; var workflowStateController = new WorkflowStateController(); - htmlText.StateID = htmlText.IsPublished - ? workflowStateController.GetLastWorkflowStateID(workflowId) + htmlText.StateID = htmlText.IsPublished + ? workflowStateController.GetLastWorkflowStateID(workflowId) : workflowStateController.GetFirstWorkflowStateID(workflowId); // update object UpdateHtmlText(htmlText, GetMaximumVersionHistory(htmlText.PortalID)); @@ -523,7 +523,7 @@ public static string ManageRelativePaths(string strHTML, string strUploadDirecto strURL = strURL.Substring(strURL.IndexOf(strDirectory) + strDirectory.Length); } // add upload directory - if (!strURL.StartsWith("/") + if (!strURL.StartsWith("/") && !String.IsNullOrEmpty(strURL.Trim())) //We don't write the UploadDirectory if the token/attribute has not value. Therefore we will avoid an unnecessary request { sbBuff.Append(uploadDirectory); @@ -844,7 +844,7 @@ private static List CollectHierarchicalTags(List terms) return collectTagsFunc(terms, new List()); } - + #endregion #region IUpgradeable Members @@ -889,4 +889,4 @@ private void AddNotificationTypes() #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index 8f151d003df..71ff251d285 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -56,7 +56,7 @@ public partial class EditHtml : HtmlModuleBase protected INavigationManager NavigationManager { get; } public EditHtml() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -243,11 +243,11 @@ private void DisplayMasterContentButton() { cmdMasterContent.Visible = true; cmdMasterContent.Text = Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + cmdMasterContent.Text = phMasterContent.Visible ? Localization.GetString("cmdHideMasterContent", LocalResourceFile) : Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + } } @@ -306,7 +306,7 @@ private void DisplayEdit(string htmlContent) cmdHistory.Enabled = true; DisplayMasterContentButton(); ddlRender.Visible = true; - + } /// @@ -441,7 +441,7 @@ private HtmlTextInfo GetLastPublishedVersion(int publishedStateID) protected override void OnInit(EventArgs e) { base.OnInit(e); - + hlCancel.NavigateUrl = NavigationManager.NavigateURL(); cmdEdit.Click += OnEditClick; @@ -465,7 +465,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try - { + { var htmlContentItemID = -1; var htmlContent = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID); @@ -512,7 +512,7 @@ protected override void OnLoad(EventArgs e) BindRenderItems(); ddlRender.SelectedValue = txtContent.Mode; } - + } catch (Exception exc) { @@ -529,7 +529,7 @@ protected void OnSaveClick(object sender, EventArgs e) // get content var htmlContent = GetLatestHTMLContent(); - var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) + var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) select pa.HTTPAlias; string content; if (phEdit.Visible) @@ -634,7 +634,7 @@ private void OnHistoryClick(object sender, EventArgs e) } } - + private void OnMasterContentClick(object sender, EventArgs e) { try @@ -643,7 +643,7 @@ private void OnMasterContentClick(object sender, EventArgs e) cmdMasterContent.Text = phMasterContent.Visible ? Localization.GetString("cmdHideMasterContent", LocalResourceFile) : Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + if (phMasterContent.Visible) DisplayMasterLanguageContent(); } @@ -733,7 +733,7 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e if (createdByByUser != null) { createdBy = createdByByUser.DisplayName; - } + } } foreach (TableCell cell in e.Row.Cells) @@ -801,4 +801,4 @@ private void BindRenderItems() #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index 1708409cab6..bb9e7f5eab7 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -57,7 +57,7 @@ public partial class HtmlModule : HtmlModuleBase, IActionable protected INavigationManager NavigationManager { get; } public HtmlModule() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region "Private Methods" @@ -203,7 +203,7 @@ private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) { try { - // verify security + // verify security if ((!PortalSecurity.Instance.InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting).Equals(e.Text))) { throw new SecurityException(); @@ -253,7 +253,7 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) { if (e.Action.CommandArgument == "publish") { - // verify security + // verify security if (IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content @@ -388,4 +388,4 @@ public ModuleActionCollection ModuleActions #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index 8d2955fe6f4..dd321e93b89 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -42,7 +42,7 @@ public partial class MyWork : PortalModuleBase protected INavigationManager NavigationManager { get; } public MyWork() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Protected Methods @@ -85,4 +85,4 @@ protected override void OnLoad(EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Journal/Components/FeatureController.cs b/DNN Platform/Modules/Journal/Components/FeatureController.cs index d29df055087..a1d8b4a1993 100644 --- a/DNN Platform/Modules/Journal/Components/FeatureController.cs +++ b/DNN Platform/Modules/Journal/Components/FeatureController.cs @@ -1,13 +1,13 @@ /* ' Copyright (c) 2011 DotNetNuke Corporation ' All rights reserved. -' +' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. -' +' */ using System; @@ -43,7 +43,7 @@ public class FeatureController : ModuleSearchBase, IModuleSearchResultController protected INavigationManager NavigationManager { get; } public FeatureController() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Optional Interfaces @@ -224,7 +224,7 @@ public bool HasViewPermission(SearchResult searchResult) var securityKeys = searchResult.UniqueKey.Split('_')[2].Split(','); var userInfo = UserController.Instance.GetCurrentUserInfo(); - + var selfKey = string.Format("U{0}", userInfo.UserID); if (securityKeys.Contains("E") || securityKeys.Contains(selfKey)) diff --git a/DNN Platform/Modules/Journal/Components/JournalParser.cs b/DNN Platform/Modules/Journal/Components/JournalParser.cs index 5f5ddc86dd1..6f1e8c26e54 100644 --- a/DNN Platform/Modules/Journal/Components/JournalParser.cs +++ b/DNN Platform/Modules/Journal/Components/JournalParser.cs @@ -18,9 +18,9 @@ using DotNetNuke.Entities.Modules; using DotNetNuke.Common.Interfaces; -namespace DotNetNuke.Modules.Journal.Components +namespace DotNetNuke.Modules.Journal.Components { - public class JournalParser + public class JournalParser { protected INavigationManager NavigationManager { get; } PortalSettings PortalSettings { get; set; } @@ -39,9 +39,9 @@ public class JournalParser private static readonly Regex TemplateRegex = new Regex("{CanComment}(.*?){/CanComment}", RegexOptions.IgnoreCase | RegexOptions.Compiled); - public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, int socialGroupId, UserInfo userInfo) + public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, int socialGroupId, UserInfo userInfo) { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); PortalSettings = portalSettings; ModuleId = moduleId; ProfileId = profileId; @@ -66,7 +66,7 @@ public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, private static readonly Regex BaseUrlRegex = new Regex("\\[BaseUrl\\]", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public string GetList(int currentIndex, int rows) + public string GetList(int currentIndex, int rows) { if (CurrentUser.UserID > 0) { isAdmin = CurrentUser.IsInRole(PortalSettings.AdministratorRoleName); @@ -74,7 +74,7 @@ public string GetList(int currentIndex, int rows) isUnverifiedUser = !CurrentUser.IsSuperUser && CurrentUser.IsInRole("Unverified Users"); var journalControllerInternal = InternalJournalController.Instance; - var sb = new StringBuilder(); + var sb = new StringBuilder(); string statusTemplate = Localization.GetString("journal_status", ResxPath); string linkTemplate = Localization.GetString("journal_link", ResxPath); @@ -87,7 +87,7 @@ public string GetList(int currentIndex, int rows) fileTemplate = BaseUrlRegex.Replace(fileTemplate, url); string comment = Localization.GetString("comment", ResxPath); - + IList journalList; if (JournalId > 0) { @@ -99,15 +99,15 @@ public string GetList(int currentIndex, int rows) journalList.Add(journal); } } - else if (ProfileId > 0) + else if (ProfileId > 0) { journalList = journalControllerInternal.GetJournalItemsByProfile(OwnerPortalId, ModuleId, CurrentUser.UserID, ProfileId, currentIndex, rows); - } - else if (SocialGroupId > 0) + } + else if (SocialGroupId > 0) { journalList = journalControllerInternal.GetJournalItemsByGroup(OwnerPortalId, ModuleId, CurrentUser.UserID, SocialGroupId, currentIndex, rows); - } - else + } + else { journalList = journalControllerInternal.GetJournalItems(OwnerPortalId, ModuleId, CurrentUser.UserID, currentIndex, rows); } @@ -134,41 +134,41 @@ public string GetList(int currentIndex, int rows) } else { rowTemplate = GetJournalTemplate(ji.JournalType, ji); } - + var ctl = new JournalControl(); - + bool isLiked = false; ctl.LikeList = GetLikeListHTML(ji, ref isLiked); ctl.LikeLink = String.Empty; ctl.CommentLink = String.Empty; - + ctl.AuthorNameLink = "" + ji.JournalAuthor.Name + ""; - if (CurrentUser.UserID > 0 && !isUnverifiedUser) + if (CurrentUser.UserID > 0 && !isUnverifiedUser) { if (!ji.CommentsDisabled) { ctl.CommentLink = "" + comment + ""; } - if (isLiked) + if (isLiked) { ctl.LikeLink = "{resx:unlike}"; - } - else + } + else { ctl.LikeLink = "{resx:like}"; } } - + ctl.CommentArea = GetCommentAreaHTML(ji, comments); ji.TimeFrame = DateUtils.CalculateDateForDisplay(ji.DateCreated); ji.DateCreated = CurrentUser.LocalTime(ji.DateCreated); - + if (ji.Summary != null) { ji.Summary = ji.Summary.Replace("\n", "
"); } - + if (ji.Body != null) { ji.Body = ji.Body.Replace(Environment.NewLine, "
"); @@ -184,11 +184,11 @@ public string GetList(int currentIndex, int rows) sb.Append(tmp); sb.Append(""); } - + return Utilities.LocalizeControl(sb.ToString()); } - internal string GetJournalTemplate(string journalType, JournalItem ji) + internal string GetJournalTemplate(string journalType, JournalItem ji) { string template = Localization.GetString("journal_" + journalType, ResxPath); if (String.IsNullOrEmpty(template)) @@ -203,7 +203,7 @@ internal string GetJournalTemplate(string journalType, JournalItem ji) return TemplateRegex.Replace(template, replacement); } - internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) + internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) { var sb = new StringBuilder(); isLiked = false; @@ -247,7 +247,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) } else { sb.Append(" {resx:other}"); } - break; + break; } sb.AppendFormat("{1}", userId, name); xc += 1; @@ -278,7 +278,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) } } - + sb.Append(""); return sb.ToString(); } @@ -304,7 +304,7 @@ internal string GetCommentAreaHTML(JournalItem journal, IList comme sb.Append("
  • "); sb.Append("{resx:comment}
  • "); } - + sb.Append(""); return sb.ToString(); } @@ -320,14 +320,14 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { sb.Append("

    "); string userUrl = NavigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] { "userId=" + comment.UserId }); sb.AppendFormat("{0}", comment.DisplayName, userUrl); - + if (comment.CommentXML != null && comment.CommentXML.SelectSingleNode("/root/comment") != null) { string text; if (CdataRegex.IsMatch(comment.CommentXML.SelectSingleNode("/root/comment").InnerText)) { var match = CdataRegex.Match(comment.CommentXML.SelectSingleNode("/root/comment").InnerText); - text = match.Groups["text"].Value; + text = match.Groups["text"].Value; } else { @@ -338,12 +338,12 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { else { sb.Append(comment.Comment.Replace("\n", "
    ")); - } + } var timeFrame = DateUtils.CalculateDateForDisplay(comment.DateCreated); comment.DateCreated = CurrentUser.LocalTime(comment.DateCreated); sb.AppendFormat("{1}", comment.DateCreated, timeFrame); - + sb.Append("

    "); sb.Append(""); return sb.ToString(); @@ -365,4 +365,4 @@ private string GetStringReplacement(JournalItem journalItem) } #endregion } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/Journal/View.ascx.cs b/DNN Platform/Modules/Journal/View.ascx.cs index 8b42ed73220..2b9e5978fbf 100644 --- a/DNN Platform/Modules/Journal/View.ascx.cs +++ b/DNN Platform/Modules/Journal/View.ascx.cs @@ -1,13 +1,13 @@ /* ' Copyright (c) 2011 DotNetNuke Corporation ' All rights reserved. -' +' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. -' +' */ using System; @@ -52,18 +52,18 @@ public partial class View : JournalModuleBase { public View() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Event Handlers - override protected void OnInit(EventArgs e) + override protected void OnInit(EventArgs e) { JavaScript.RequestRegistration(CommonJs.DnnPlugins); JavaScript.RequestRegistration(CommonJs.jQueryFileUpload); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.Knockout); - + ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journal.js"); ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journalcomments.js"); ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/mentionsInput.js"); @@ -73,7 +73,7 @@ override protected void OnInit(EventArgs e) if (!Request.IsAuthenticated || (!UserInfo.IsSuperUser && !isAdmin && UserInfo.IsInRole("Unverified Users"))) { ShowEditor = false; - } + } else { ShowEditor = EditorEnabled; @@ -99,44 +99,44 @@ override protected void OnInit(EventArgs e) ctlJournalList.ProfileId = -1; ctlJournalList.PageSize = PageSize; ctlJournalList.ModuleId = ModuleId; - + ModuleInfo moduleInfo = ModuleContext.Configuration; - foreach (var module in ModuleController.Instance.GetTabModules(TabId).Values) + foreach (var module in ModuleController.Instance.GetTabModules(TabId).Values) { - if (module.ModuleDefinition.FriendlyName == "Social Groups") + if (module.ModuleDefinition.FriendlyName == "Social Groups") { - if (GroupId == -1 && FilterMode == JournalMode.Auto) + if (GroupId == -1 && FilterMode == JournalMode.Auto) { ShowEditor = false; ctlJournalList.Enabled = false; } - if (GroupId > 0) + if (GroupId > 0) { RoleInfo roleInfo = RoleController.Instance.GetRoleById(moduleInfo.OwnerPortalID, GroupId); - if (roleInfo != null) + if (roleInfo != null) { - if (UserInfo.IsInRole(roleInfo.RoleName)) + if (UserInfo.IsInRole(roleInfo.RoleName)) { ShowEditor = true; CanComment = true; IsGroup = true; - } else + } else { ShowEditor = false; CanComment = false; } - - if (!roleInfo.IsPublic && !ShowEditor) + + if (!roleInfo.IsPublic && !ShowEditor) { - ctlJournalList.Enabled = false; + ctlJournalList.Enabled = false; } - if (roleInfo.IsPublic && !ShowEditor) + if (roleInfo.IsPublic && !ShowEditor) { ctlJournalList.Enabled = true; } - if (roleInfo.IsPublic && ShowEditor) + if (roleInfo.IsPublic && ShowEditor) { ctlJournalList.Enabled = true; } @@ -144,30 +144,30 @@ override protected void OnInit(EventArgs e) { IsPublicGroup = true; } - } - else + } + else { ShowEditor = false; ctlJournalList.Enabled = false; } } - + } } - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(Request.QueryString["userId"])) { ctlJournalList.ProfileId = Convert.ToInt32(Request.QueryString["userId"]); if (!UserInfo.IsSuperUser && !isAdmin && ctlJournalList.ProfileId != UserId) { - ShowEditor = ShowEditor && Utilities.AreFriends(UserController.GetUserById(PortalId, ctlJournalList.ProfileId), UserInfo); + ShowEditor = ShowEditor && Utilities.AreFriends(UserController.GetUserById(PortalId, ctlJournalList.ProfileId), UserInfo); } - } - else if (GroupId > 0) + } + else if (GroupId > 0) { ctlJournalList.SocialGroupId = Convert.ToInt32(Request.QueryString["groupId"]); } - + InitializeComponent(); base.OnInit(e); } @@ -175,14 +175,14 @@ override protected void OnInit(EventArgs e) private void InitializeComponent() { Load += Page_Load; } - + /// ----------------------------------------------------------------------------- /// /// Page_Load runs when the control is loaded /// /// ----------------------------------------------------------------------------- private void Page_Load(object sender, EventArgs e) { - try + try { BaseUrl = Globals.ApplicationPath; BaseUrl = BaseUrl.EndsWith("/") ? BaseUrl : BaseUrl + "/"; @@ -190,18 +190,18 @@ private void Page_Load(object sender, EventArgs e) { ProfilePage = NavigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(Request.QueryString["userId"])) { Pid = Convert.ToInt32(Request.QueryString["userId"]); - ctlJournalList.ProfileId = Pid; - } - else if (GroupId > 0) + ctlJournalList.ProfileId = Pid; + } + else if (GroupId > 0) { Gid = GroupId; - ctlJournalList.SocialGroupId = GroupId; + ctlJournalList.SocialGroupId = GroupId; } ctlJournalList.PageSize = PageSize; - } + } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); diff --git a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs index 7a5bf3a7304..a3693ca9fe2 100644 --- a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -42,9 +42,9 @@ public partial class AddScript : ModuleUserControlBase public AddScript() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } - + private void DisplayExtension() { fileExtension.Text = "." + scriptFileType.SelectedValue.ToLowerInvariant(); @@ -54,7 +54,7 @@ private void DisplayExtension() protected override void OnInit(EventArgs e) { base.OnInit(e); - + cmdCancel.Click += cmdCancel_Click; cmdAdd.Click += cmdAdd_Click; scriptFileType.SelectedIndexChanged += scriptFileType_SelectedIndexChanged; @@ -64,7 +64,7 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - + DisplayExtension(); } @@ -117,4 +117,4 @@ private void scriptFileType_SelectedIndexChanged(object sender, EventArgs e) DisplayExtension(); } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index 179f4aa2874..0eba4d77773 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -55,9 +55,9 @@ public partial class CreateModule : ModuleUserControlBase public CreateModule() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } - + [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] protected string ModuleControl { @@ -159,7 +159,7 @@ private void Create() { Logger.Error(ex); } - + //Optionally goto new Page if (chkAddPage.Checked) @@ -342,4 +342,4 @@ private void scriptList_SelectedIndexChanged(object sender, EventArgs e) DisplayFile(); } } -} \ No newline at end of file +} diff --git a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs index 1f9c1d91e84..77b05601f38 100644 --- a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -46,7 +46,7 @@ public partial class EditScript : ModuleUserControlBase public EditScript() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -177,7 +177,7 @@ private void cmdSaveClose_Click(object sender, EventArgs e) Exceptions.ProcessModuleLoadException(this, exc); } } - + private void cmdAdd_Click(object sender, EventArgs e) { try @@ -197,4 +197,4 @@ private void scriptList_SelectedIndexChanged(object sender, EventArgs e) } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs index 0bca0f272fa..6dcaf4d5fa7 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs @@ -24,7 +24,7 @@ public class CreateModuleController : ServiceLocator(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } protected override Func GetFactory() @@ -102,7 +102,7 @@ private int CreateNewModule(CreateModuleDto createModuleDto, out string newPageU var uniqueName = true; foreach (var package in PackageController.Instance.GetExtensionPackages(Null.NullInteger)) { - if (package.Name.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase) + if (package.Name.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase) || package.FriendlyName.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase)) { uniqueName = false; @@ -394,4 +394,4 @@ private string GetClassName(CreateModuleDto createModuleDto) return className.Replace(" ", ""); } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs index 52d88f81595..8867163179e 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -101,12 +101,12 @@ public class PackageInfoDto public PackageInfoDto() { - + } public PackageInfoDto(int portalId, PackageInfo package) { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); PackageType = package.PackageType; FriendlyName = package.FriendlyName; @@ -165,4 +165,4 @@ public PackageInfo ToPackageInfo() }; } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs index 95c0d81d149..57ce60616f9 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs @@ -16,7 +16,7 @@ namespace Dnn.PersonaBar.Extensions.Components.Editors public class AuthSystemPackageEditor : IPackageEditor { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(AuthSystemPackageEditor)); - private static readonly INavigationManager NavigationManager = Globals.DependencyProvider.GetService(); + private static readonly INavigationManager NavigationManager = Globals.DependencyProvider.GetRequiredService(); #region IPackageEditor Implementation public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -174,4 +174,4 @@ private static void SaveCustomSettings(PackageSettingsDto packageSettings) #endregion } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs index e7f69ec69a9..82ab4ceaa72 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs @@ -18,7 +18,7 @@ public class CoreLanguagePackageEditor : IPackageEditor protected INavigationManager NavigationManager { get; } public CoreLanguagePackageEditor() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -69,4 +69,4 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e } } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs index 46fa150331d..8cd3f524817 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs @@ -19,7 +19,7 @@ public class ExtensionLanguagePackageEditor : IPackageEditor public ExtensionLanguagePackageEditor() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -78,4 +78,4 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e } } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs index 8904406f45e..9f2c3308f0d 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -52,7 +52,7 @@ public class ExtensionsController protected INavigationManager NavigationManager { get; } public ExtensionsController() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public IDictionary GetPackageTypes() @@ -425,4 +425,4 @@ private static bool IconExists(string imagePath) #endregion } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs index caa7b4b9122..9a9ed1762fd 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs @@ -22,7 +22,7 @@ namespace Dnn.PersonaBar.Pages.Components { public static class Converters { - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetService(); + private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); public static T ConvertToPageItem(TabInfo tab, IEnumerable portalTabs) where T : PageItem, new() { return new T @@ -250,4 +250,4 @@ private static string GetTabPublishStatus(TabInfo tab) : Localization.GetString("lblDraft"); } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs index d21fc3c13a9..a723861ce94 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -81,7 +81,7 @@ public class UserDetailDto : UserBasicDto [DataMember(Name = "hasAgreedToTermsOn")] public DateTime HasAgreedToTermsOn { get; set; } - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetService(); + private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); public UserDetailDto() { @@ -132,4 +132,4 @@ private static string GetSettingUrl(int portalId, int userId) "editprofile=true"); } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs index e1b8093468b..1549b64f593 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs @@ -14,7 +14,7 @@ public class ExtensionMenuController : IMenuItemController protected INavigationManager NavigationManager { get; } public ExtensionMenuController() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public void UpdateParameters(MenuItem menuItem) @@ -35,4 +35,4 @@ public IDictionary GetSettings(MenuItem menuItem) return settings; } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs index 4b16bc3e7ab..c653dac7047 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs @@ -27,8 +27,8 @@ public IDictionary GetSettings(MenuItem menuItem) { return new Dictionary { - {"previewUrl", Globals.DependencyProvider.GetService().NavigateURL()}, + {"previewUrl", Globals.DependencyProvider.GetRequiredService().NavigateURL()}, }; } } -} \ No newline at end of file +} diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index 77d4edf2d35..bfe77b3c424 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -58,7 +58,7 @@ public static IPersonaBarContainer Instance { if (_instance == null) { - _instance = new PersonaBarContainer(Globals.DependencyProvider.GetService()); + _instance = new PersonaBarContainer(Globals.DependencyProvider.GetRequiredService()); } return _instance; @@ -82,13 +82,13 @@ public static void ClearInstance() #region IPersonaBarContainer Implements - public virtual IList RootItems => new List {"Content", "Manage", "Settings", "Edit"}; + public virtual IList RootItems => new List {"Content", "Manage", "Settings", "Edit"}; public virtual bool Visible => true; public virtual void Initialize(UserControl personaBarControl) { - + } public virtual IDictionary GetConfiguration() @@ -100,7 +100,7 @@ public virtual IDictionary GetConfiguration() public virtual void FilterMenu(PersonaBarMenu menu) { - + } #endregion diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs index ad1e1288047..f7db095b0d1 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -39,7 +39,7 @@ public class LinkMenuController : IMenuItemController protected INavigationManager NavigationManager { get; } public LinkMenuController() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public void UpdateParameters(MenuItem menuItem) @@ -129,6 +129,6 @@ private IDictionary GetPathQuery(MenuItem menuItem) .Select(p => p.Split('=')) .Where(q => q.Length == 2 && !string.IsNullOrEmpty(q[0]) && !string.IsNullOrEmpty(q[1])) .ToDictionary(q => q[0], q => q[1]); - } + } } } diff --git a/Website/Default.aspx.cs b/Website/Default.aspx.cs index 4cbb1b9d5ed..9d476d55126 100644 --- a/Website/Default.aspx.cs +++ b/Website/Default.aspx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -65,10 +65,10 @@ namespace DotNetNuke.Framework /// ----------------------------------------------------------------------------- /// Project : DotNetNuke /// Class : CDefault - /// + /// /// ----------------------------------------------------------------------------- /// - /// + /// /// /// /// @@ -84,7 +84,7 @@ public partial class DefaultPage : CDefault, IClientAPICallbackEventHandler public DefaultPage() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Properties @@ -153,7 +153,7 @@ public string CurrentSkinPath return ((PortalSettings)HttpContext.Current.Items["PortalSettings"]).ActiveTab.SkinPath; } } - + #endregion #region IClientAPICallbackEventHandler Members @@ -187,14 +187,14 @@ public string RaiseClientAPICallbackEvent(string eventArgument) /// ----------------------------------------------------------------------------- /// - /// + /// /// /// /// - Obtain PortalSettings from Current Context /// - redirect to a specific tab based on name /// - if first time loading this page then reload to avoid caching /// - set page title and stylesheet - /// - check to see if we should show the Assembly Version in Page Title + /// - check to see if we should show the Assembly Version in Page Title /// - set the background image if there is one selected /// - set META tags, copyright, keywords and description /// @@ -289,7 +289,7 @@ private void InitializePage() { metaPanel.Controls.Add(new LiteralControl(PortalSettings.PageHeadText)); } - + //set page title if (UrlUtils.InPopUp()) { @@ -320,7 +320,7 @@ private void InitializePage() break; } var title = Localization.LocalizeControlTitle(control); - + strTitle.Append(string.Concat(" > ", PortalSettings.ActiveTab.LocalizedTabName)); strTitle.Append(string.Concat(" > ", title)); } @@ -515,7 +515,7 @@ private void ManageFavicon() } //I realize the parsing of this is rather primitive. A better solution would be to use json serialization - //unfortunately, I don't have the time to write it. When we officially adopt MS AJAX, we will get this type of + //unfortunately, I don't have the time to write it. When we officially adopt MS AJAX, we will get this type of //functionality and this should be changed to utilize it for its plumbing. private Dictionary ParsePageCallBackArgs(string strArg) { @@ -672,7 +672,7 @@ protected override void OnInit(EventArgs e) } else //other modes just depend on the default alias { - if (string.Compare(PortalSettings.PortalAlias.HTTPAlias, PortalSettings.DefaultPortalAlias, StringComparison.InvariantCulture ) != 0) + if (string.Compare(PortalSettings.PortalAlias.HTTPAlias, PortalSettings.DefaultPortalAlias, StringComparison.InvariantCulture ) != 0) primaryHttpAlias = PortalSettings.DefaultPortalAlias; } if (primaryHttpAlias != null && string.IsNullOrEmpty(CanonicalLinkUrl))//a primary http alias was identified @@ -716,7 +716,7 @@ protected override void OnInit(EventArgs e) //add Favicon ManageFavicon(); - //ClientCallback Logic + //ClientCallback Logic ClientAPI.HandleClientAPICallbackEvent(this); //add viewstateuserkey to protect against CSRF attacks @@ -731,10 +731,10 @@ protected override void OnInit(EventArgs e) AJAX.GetScriptManager(this).AsyncPostBackTimeout = Host.AsyncTimeout; } } - + /// ----------------------------------------------------------------------------- /// - /// Initialize the Scrolltop html control which controls the open / closed nature of each module + /// Initialize the Scrolltop html control which controls the open / closed nature of each module /// /// /// @@ -766,7 +766,7 @@ protected override void OnPreRender(EventArgs evt) MetaAuthor.Content = PortalSettings.PortalName; /* * Never show to be html5 compatible and stay backward compatible - * + * * MetaCopyright.Content = Copyright; * MetaCopyright.Visible = (!String.IsNullOrEmpty(Copyright)); */ diff --git a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs index ec6cc3c70fd..44157e79eb7 100644 --- a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs +++ b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -79,7 +79,7 @@ public partial class Login : UserModuleBase public Login() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -200,7 +200,7 @@ protected string RedirectURL } if (Request.Params["appctx"] != null) { - //HACK return to the url passed to signin (LiveID) + //HACK return to the url passed to signin (LiveID) redirectURL = HttpUtility.UrlDecode(Request.Params["appctx"]); //clean the return url to avoid possible XSS attack. @@ -232,7 +232,7 @@ protected string RedirectURL } else { - //redirect to current page + //redirect to current page redirectURL = NavigationManager.NavigateURL(); } } @@ -641,7 +641,7 @@ private void InitialiseUser() //Load any Profile properties that may have been returned UpdateProfile(User, false); - //Set UserName to authentication Token + //Set UserName to authentication Token User.Username = GenerateUserName(); //Set DisplayName to UserToken if null @@ -711,7 +711,7 @@ private string GenerateUserName() } } - //Try First Name + space + First letter last name + //Try First Name + space + First letter last name if (!string.IsNullOrEmpty(User.LastName) && !string.IsNullOrEmpty(User.FirstName)) { var newUserName = User.FirstName + " " + User.LastName.Substring(0, 1); @@ -902,7 +902,7 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) Localization.SetLanguage(PortalSettings.DefaultLanguage); } - //Set the Authentication Type used + //Set the Authentication Type used AuthenticationController.SetAuthenticationType(AuthenticationType); //Complete Login @@ -1089,7 +1089,7 @@ protected override void OnLoad(EventArgs e) } catch (Exception ex) { - //control not there + //control not there Logger.Error(ex); } } @@ -1102,7 +1102,7 @@ protected override void OnLoad(EventArgs e) //if a Login Page has not been specified for the portal if (Globals.IsAdminControl()) { - //redirect browser + //redirect browser Response.Redirect(RedirectURL, true); } else //make module container invisible if user is not a page admin @@ -1432,4 +1432,4 @@ private void AddEventLog(int userId, string username, int portalId, string prope #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs index d7688435cbe..b6dcb109f06 100644 --- a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -46,14 +46,14 @@ public partial class AuthenticationEditor : PackageEditorBase public AuthenticationEditor() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Private Members" private AuthenticationInfo _AuthSystem; private AuthenticationSettingsBase _SettingsControl; - + #endregion #region "Protected Properties" @@ -193,7 +193,7 @@ protected void cmdUpdate_Click(object sender, EventArgs e) if (displayMode != "editor" && displayMode != "settings") Response.Redirect(NavigationManager.NavigateURL(), true); } - + #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs index 24da20fa02b..44ff5b98ab4 100644 --- a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -60,7 +60,7 @@ public partial class EditExtension : ModuleUserControlBase public EditExtension() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool IsSuperTab @@ -168,7 +168,7 @@ private void BindData() cmdUpdate.Visible = IsSuperTab; if (Package != null) { - + if (PackageEditor == null || PackageID == Null.NullInteger) { extensionSection.Visible = false; @@ -187,9 +187,9 @@ private void BindData() Package.IconFile = Util.ParsePackageIconFileName(Package); } - + switch (Package.PackageType) - { + { case "Auth_System": case "Container": case "Module": @@ -202,7 +202,7 @@ private void BindData() Package.IconFile = "Not Available"; break; } - + if (Mode != "All") { packageType.Visible = false; @@ -344,4 +344,4 @@ protected void OnUpdateClick(object sender, EventArgs e) } } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs index 57026799895..1d2d0d2b620 100644 --- a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs +++ b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -61,7 +61,7 @@ public partial class EditUser : UserModuleBase public EditUser() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Protected Members @@ -109,7 +109,7 @@ protected string RedirectURL } if (String.IsNullOrEmpty(_RedirectURL)) { - //redirect to current page + //redirect to current page _RedirectURL = NavigationManager.NavigateURL(); } } @@ -482,7 +482,7 @@ protected void cmdDelete_Click(object sender, EventArgs e) AddModuleMessage("UserDeleteError", ModuleMessage.ModuleMessageType.RedError, true); } - //DNN-26777 + //DNN-26777 PortalSecurity.Instance.SignOut(); Response.Redirect(NavigationManager.NavigateURL(PortalSettings.HomeTabId)); } @@ -591,7 +591,7 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) var accessingUser = (UserInfo)HttpContext.Current.Items["UserInfo"]; if (accessingUser.UserID != User.UserID) { - //The password was changed by someone else + //The password was changed by someone else Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings); } else diff --git a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs index 7b2e3501ef2..c989123893c 100644 --- a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -59,7 +59,7 @@ public partial class ManageUsers : UserModuleBase, IActionable protected INavigationManager NavigationManager { get; } public ManageUsers() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Protected Members @@ -107,7 +107,7 @@ protected string RedirectURL } if (String.IsNullOrEmpty(_RedirectURL)) { - //redirect to current page + //redirect to current page _RedirectURL = NavigationManager.NavigateURL(); } } @@ -198,7 +198,7 @@ public int PageNo ViewState["PageNo"] = value; } } - + #endregion #region IActionable Members @@ -264,7 +264,7 @@ private void BindData() { return; } - + if (AddUser) { cmdAdd.Text = Localization.GetString("AddUser", LocalResourceFile); @@ -316,7 +316,7 @@ private bool VerifyUserPermissions() DisableForm(); return false; } - + //Check if User is a member of the Current Portal (or a member of the MasterPortal if PortalGroups enabled) if (User.PortalID != Null.NullInteger && User.PortalID != PortalId) { @@ -324,7 +324,7 @@ private bool VerifyUserPermissions() DisableForm(); return false; } - + //Check if User is a SuperUser and that the current User is a SuperUser if (User.IsSuperUser && !UserInfo.IsSuperUser) { @@ -473,8 +473,8 @@ private void ShowPanel() if(EditProfileMode) { adminTabNav.Visible = - dnnUserDetails.Visible = - dnnRoleDetails.Visible = + dnnUserDetails.Visible = + dnnRoleDetails.Visible = dnnPasswordDetails.Visible = actionsRow.Visible = false; } @@ -669,7 +669,7 @@ private void MembershipAuthorized(object sender, EventArgs e) try { AddModuleMessage("UserAuthorized", ModuleMessage.ModuleMessageType.GreenSuccess, true); - + //Send Notification to User if (string.IsNullOrEmpty(User.Membership.Password) && !MembershipProviderConfig.RequiresQuestionAndAnswer && MembershipProviderConfig.PasswordRetrievalEnabled) { @@ -853,7 +853,7 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) var accessingUser = (UserInfo) HttpContext.Current.Items["UserInfo"]; if (accessingUser.UserID != User.UserID) { - //The password was changed by someone else + //The password was changed by someone else Mail.SendMail(User, MessageType.PasswordUpdated, PortalSettings); } else @@ -887,7 +887,7 @@ private void ProfileUpdateCompleted(object sender, EventArgs e) { return; } - + //Redirect to same page (this will update all controls for any changes to profile //and leave us at Page 0 (User Credentials) Response.Redirect(Request.RawUrl, true); @@ -999,7 +999,7 @@ private void UserUpdateError(object sender, UserUserControlBase.UserUpdateErrorA { AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); } - + #endregion } } diff --git a/Website/DesktopModules/Admin/Security/Membership.ascx.cs b/Website/DesktopModules/Admin/Security/Membership.ascx.cs index 2b3e7553dd2..c965528f392 100644 --- a/Website/DesktopModules/Admin/Security/Membership.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Membership.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -54,7 +54,7 @@ public partial class Membership : UserModuleBase protected INavigationManager NavigationManager { get; } public Membership() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region "Public Properties" @@ -76,7 +76,7 @@ public UserMembership UserMembership return membership; } } - + #endregion #region "Events" @@ -94,7 +94,7 @@ public UserMembership UserMembership public event EventHandler MembershipUnLocked; public event EventHandler MembershipPromoteToSuperuser; public event EventHandler MembershipDemoteFromSuperuser; - + #endregion #region "Event Methods" @@ -134,7 +134,7 @@ public void OnMembershipDemoteFromSuperuser(EventArgs e) } } - + /// ----------------------------------------------------------------------------- /// /// Raises the MembershipAuthorized Event @@ -232,7 +232,7 @@ public override void DataBind() if (UserController.Instance.GetCurrentUserInfo().IsSuperUser && UserController.Instance.GetCurrentUserInfo().UserID!=User.UserID) { cmdToggleSuperuser.Visible = true; - + if (User.IsSuperUser) { cmdToggleSuperuser.Text = Localization.GetString("DemoteFromSuperUser", LocalResourceFile); @@ -246,8 +246,8 @@ public override void DataBind() cmdToggleSuperuser.Visible = false; } } - lastLockoutDate.Value = UserMembership.LastLockoutDate.Year > 2000 - ? (object) UserMembership.LastLockoutDate + lastLockoutDate.Value = UserMembership.LastLockoutDate.Year > 2000 + ? (object) UserMembership.LastLockoutDate : LocalizeString("Never"); // ReSharper disable SpecifyACultureInStringConversionExplicitly isOnLine.Value = LocalizeString(UserMembership.IsOnLine.ToString()); @@ -255,7 +255,7 @@ public override void DataBind() approved.Value = LocalizeString(UserMembership.Approved.ToString()); updatePassword.Value = LocalizeString(UserMembership.UpdatePassword.ToString()); isDeleted.Value = LocalizeString(UserMembership.IsDeleted.ToString()); - + //show the user folder path without default parent folder, and only visible to admin. userFolder.Visible = UserInfo.IsInRole(PortalSettings.AdministratorRoleName); if (userFolder.Visible) @@ -349,14 +349,14 @@ private void cmdPassword_Click(object sender, EventArgs e) //Update User UserController.UpdateUser(PortalId, User); - OnMembershipPasswordUpdateChanged(EventArgs.Empty); + OnMembershipPasswordUpdateChanged(EventArgs.Empty); } else { message = Localization.GetString("OptionUnavailable", LocalResourceFile); UI.Skins.Skin.AddModuleMessage(this, message, ModuleMessage.ModuleMessageType.YellowWarning); } - + } /// ----------------------------------------------------------------------------- @@ -396,13 +396,13 @@ private void cmdToggleSuperuser_Click(object sender, EventArgs e) if (Request.IsAuthenticated != true) return; ////ensure only superusers can change user superuser state if (UserController.Instance.GetCurrentUserInfo().IsSuperUser != true) return; - + var currentSuperUserState = User.IsSuperUser; User.IsSuperUser = !currentSuperUserState; //Update User UserController.UpdateUser(PortalId, User); DataCache.ClearCache(); - + if (currentSuperUserState) { OnMembershipDemoteFromSuperuser(EventArgs.Empty); @@ -436,7 +436,7 @@ private void cmdUnLock_Click(Object sender, EventArgs e) OnMembershipUnLocked(EventArgs.Empty); } } - + #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs index 8789361302b..b435d1cbc64 100644 --- a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -55,7 +55,7 @@ public partial class ProfileDefinitions : PortalModuleBase, IActionable protected INavigationManager NavigationManager { get; } public ProfileDefinitions() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Constants @@ -439,7 +439,7 @@ public void Update() catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); - } + } } #endregion @@ -613,7 +613,7 @@ private void grdProfileProperties_ItemCommand(object source, DataGridCommandEven /// ----------------------------------------------------------------------------- /// - /// When it is determined that the client supports a rich interactivity the grdProfileProperties_ItemCreated + /// When it is determined that the client supports a rich interactivity the grdProfileProperties_ItemCreated /// event is responsible for disabling all the unneeded AutoPostBacks, along with assiging the appropriate /// client-side script for each event handler /// @@ -627,7 +627,7 @@ private void grdProfileProperties_ItemCreated(object sender, DataGridItemEventAr switch (e.Item.ItemType) { case ListItemType.Header: - //we combined the header label and checkbox in same place, so it is control 1 instead of 0 + //we combined the header label and checkbox in same place, so it is control 1 instead of 0 ((WebControl)e.Item.Cells[COLUMN_REQUIRED].Controls[1]).Attributes.Add("onclick", "dnn.util.checkallChecked(this," + COLUMN_REQUIRED + ");"); ((CheckBox)e.Item.Cells[COLUMN_REQUIRED].Controls[1]).AutoPostBack = false; @@ -683,4 +683,4 @@ protected void grdProfileProperties_ItemDataBound(object sender, DataGridItemEve #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/Security/Register.ascx.cs b/Website/DesktopModules/Admin/Security/Register.ascx.cs index 4e95db89503..7e8d475f482 100644 --- a/Website/DesktopModules/Admin/Security/Register.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Register.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -71,7 +71,7 @@ public partial class Register : UserUserControlBase public Register() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -300,7 +300,7 @@ protected override void OnLoad(EventArgs e) //if a Login Page has not been specified for the portal if (Globals.IsAdminControl()) { - //redirect to current page + //redirect to current page Response.Redirect(NavigationManager.NavigateURL(), true); } else //make module container invisible if user is not a page admin @@ -515,7 +515,7 @@ private void CreateUser() User.Membership.Approved = PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PublicRegistration; var user = User; CreateStatus = UserController.CreateUser(ref user); - + DataCache.ClearPortalUserCountCache(PortalId); try @@ -813,7 +813,7 @@ private string GetRedirectUrl(bool checkSetting = true) } if (String.IsNullOrEmpty(redirectUrl)) { - //redirect to current page + //redirect to current page redirectUrl = NavigationManager.NavigateURL(); } } diff --git a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs index 5ff4ff130d7..e689c944a36 100644 --- a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs +++ b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -77,7 +77,7 @@ public partial class SecurityRoles : PortalModuleBase, IActionable public SecurityRoles() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region "Protected Members" @@ -208,7 +208,7 @@ protected int PageSize /// /// ----------------------------------------------------------------------------- public PortalModuleBase ParentModule { get; set; } - + #endregion #region IActionable Members @@ -277,7 +277,7 @@ private void BindData() plRoles.Visible = false; } } - + //bind all portal users to dropdownlist if (UserId == -1) { @@ -334,7 +334,7 @@ private void BindData() /// ----------------------------------------------------------------------------- private void BindGrid() { - + if (RoleId != Null.NullInteger) { @@ -358,7 +358,7 @@ private void BindGrid() ctlPagingControl.TabID = TabId; ctlPagingControl.QuerystringParams = System.Web.HttpUtility.UrlDecode(string.Join("&", Request.QueryString.ToString().Split('&'). ToList(). - Where(s => s.StartsWith("ctl", StringComparison.OrdinalIgnoreCase) + Where(s => s.StartsWith("ctl", StringComparison.OrdinalIgnoreCase) || s.StartsWith("mid", StringComparison.OrdinalIgnoreCase) || s.StartsWith("RoleId", StringComparison.OrdinalIgnoreCase) || s.StartsWith("UserId", StringComparison.OrdinalIgnoreCase) @@ -702,10 +702,10 @@ private void cmdAdd_Click(Object sender, EventArgs e) { datExpiryDate = Null.NullDate; } - + //Add User to Role var isOwner = false; - + if(((Role.SecurityMode == SecurityMode.SocialGroup) || (Role.SecurityMode == SecurityMode.Both))) isOwner = chkIsOwner.Checked; @@ -808,7 +808,7 @@ protected void grdUserRoles_ItemDataBound(object sender, DataGridItemEventArgs e } } } - + #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs index 1a6f8134438..67d96eb959c 100644 --- a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs +++ b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -52,7 +52,7 @@ public partial class ViewProfile : ProfileModuleUserControlBase protected INavigationManager NavigationManager { get; } public ViewProfile() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public override bool DisplayModule @@ -63,7 +63,7 @@ public override bool DisplayModule } } - public bool IncludeButton + public bool IncludeButton { get { @@ -271,7 +271,7 @@ private void ProcessQuerystring() var action = Request.QueryString["action"]; - if (!Request.IsAuthenticated && !string.IsNullOrEmpty(action)) //action requested but not logged in. + if (!Request.IsAuthenticated && !string.IsNullOrEmpty(action)) //action requested but not logged in. { string loginUrl = Common.Globals.LoginURL(Request.RawUrl, false); Response.Redirect(loginUrl); @@ -279,7 +279,7 @@ private void ProcessQuerystring() if (Request.IsAuthenticated && !string.IsNullOrEmpty(action) ) // only process this for authenticated requests { //current user, i.e. the one that the request was for - var currentUser = UserController.Instance.GetCurrentUserInfo(); + var currentUser = UserController.Instance.GetCurrentUserInfo(); // the initiating user,i.e. the one who wanted to be friend // note that in this case here currentUser is visiting the profile of initiatingUser, most likely from a link in the notification e-mail var initiatingUser = UserController.Instance.GetUserById(PortalSettings.Current.PortalId, Convert.ToInt32(Request.QueryString["UserID"])); @@ -288,15 +288,15 @@ private void ProcessQuerystring() { return; //do not further process for users who are on their own profile page } - + var friendRelationship = RelationshipController.Instance.GetFriendRelationship(currentUser, initiatingUser); if (friendRelationship != null) - { + { if (action.ToLowerInvariant() == "acceptfriend") { var friend = UserController.GetUserById(PortalSettings.Current.PortalId, friendRelationship.UserId); - FriendsController.Instance.AcceptFriend(friend); + FriendsController.Instance.AcceptFriend(friend); } if (action.ToLowerInvariant() == "followback") @@ -315,7 +315,7 @@ private void ProcessQuerystring() { //ignore } - } + } } Response.Redirect(Common.Globals.UserProfileURL(initiatingUser.UserID)); @@ -324,4 +324,4 @@ private void ProcessQuerystring() #endregion } -} \ No newline at end of file +} diff --git a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs index d3bcca96dcd..3af1b6a5d01 100644 --- a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs +++ b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -55,7 +55,7 @@ public partial class Login : AuthenticationLoginBase public Login() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -86,7 +86,7 @@ public override bool Enabled return AuthenticationConfig.GetConfig(PortalId).Enabled; } } - + #endregion #region Event Handlers @@ -224,7 +224,7 @@ protected override void OnLoad(EventArgs e) } catch (Exception ex) { - //control not there + //control not there Logger.Error(ex); } } @@ -262,25 +262,25 @@ private void OnLoginClick(object sender, EventArgs e) if ((UseCaptcha && ctlCaptcha.IsValid) || !UseCaptcha) { var loginStatus = UserLoginStatus.LOGIN_FAILURE; - string userName = PortalSecurity.Instance.InputFilter(txtUsername.Text, - PortalSecurity.FilterFlag.NoScripting | - PortalSecurity.FilterFlag.NoAngleBrackets | + string userName = PortalSecurity.Instance.InputFilter(txtUsername.Text, + PortalSecurity.FilterFlag.NoScripting | + PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup); //DNN-6093 //check if we use email address here rather than username UserInfo userByEmail = null; - var emailUsedAsUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + var emailUsedAsUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); if (emailUsedAsUsername) { // one additonal call to db to see if an account with that email actually exists - userByEmail = UserController.GetUserByEmail(PortalId, userName); + userByEmail = UserController.GetUserByEmail(PortalId, userName); if (userByEmail != null) { //we need the username of the account in order to authenticate in the next step - userName = userByEmail.Username; + userName = userByEmail.Username; } } @@ -311,18 +311,18 @@ private void OnLoginClick(object sender, EventArgs e) userName = objUser.Username = objUser.Email; } } - + //Raise UserAuthenticated Event var eventArgs = new UserAuthenticatedEventArgs(objUser, userName, loginStatus, "DNN") { - Authenticated = authenticated, + Authenticated = authenticated, Message = message, RememberMe = chkCookie.Checked }; OnUserAuthenticated(eventArgs); } } - + #endregion #region Private Methods @@ -357,7 +357,7 @@ protected string GetRedirectUrl(bool checkSettings = true) } if (String.IsNullOrEmpty(redirectUrl)) { - //redirect to current page + //redirect to current page redirectUrl = NavigationManager.NavigateURL(); } } @@ -368,4 +368,4 @@ protected string GetRedirectUrl(bool checkSettings = true) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Modules/Export.ascx.cs b/Website/admin/Modules/Export.ascx.cs index c75c637c407..333e83d5421 100644 --- a/Website/admin/Modules/Export.ascx.cs +++ b/Website/admin/Modules/Export.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -59,7 +59,7 @@ public partial class Export : PortalModuleBase protected INavigationManager NavigationManager { get; } public Export() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -97,7 +97,7 @@ private string ExportModule(int moduleID, string fileName, IFolderInfo folder) try { var objObject = Reflection.CreateObject(Module.DesktopModule.BusinessControllerClass, Module.DesktopModule.BusinessControllerClass); - + //Double-check if (objObject is IPortable) { @@ -244,7 +244,7 @@ protected void OnExportClick(object sender, EventArgs e) UI.Skins.Skin.AddModuleMessage(this, strMessage, ModuleMessage.ModuleMessageType.RedError); } } - + } else { @@ -260,4 +260,4 @@ protected void OnExportClick(object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Modules/Import.ascx.cs b/Website/admin/Modules/Import.ascx.cs index 210102bfc9e..d0e33c938eb 100644 --- a/Website/admin/Modules/Import.ascx.cs +++ b/Website/admin/Modules/Import.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -53,7 +53,7 @@ public partial class Import : PortalModuleBase protected INavigationManager NavigationManager { get; } public Import() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -277,4 +277,4 @@ protected void OnImportClick(object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Modules/ModulePermissions.ascx.cs b/Website/admin/Modules/ModulePermissions.ascx.cs index b83b440c4bc..0f332862f0e 100644 --- a/Website/admin/Modules/ModulePermissions.ascx.cs +++ b/Website/admin/Modules/ModulePermissions.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -41,7 +41,7 @@ namespace DotNetNuke.Modules.Admin.Modules { /// - /// The ModuleSettingsPage PortalModuleBase is used to edit the settings for a + /// The ModuleSettingsPage PortalModuleBase is used to edit the settings for a /// module. /// /// @@ -51,7 +51,7 @@ public partial class ModulePermissions : PortalModuleBase protected INavigationManager NavigationManager { get; } public ModulePermissions() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -145,4 +145,4 @@ protected void OnUpdateClick(object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Modules/Modulesettings.ascx.cs b/Website/admin/Modules/Modulesettings.ascx.cs index 531ff52c3ba..17c1a9955cd 100644 --- a/Website/admin/Modules/Modulesettings.ascx.cs +++ b/Website/admin/Modules/Modulesettings.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -55,7 +55,7 @@ namespace DotNetNuke.Modules.Admin.Modules { /// - /// The ModuleSettingsPage PortalModuleBase is used to edit the settings for a + /// The ModuleSettingsPage PortalModuleBase is used to edit the settings for a /// module. /// /// @@ -66,7 +66,7 @@ public partial class ModuleSettingsPage : PortalModuleBase protected INavigationManager NavigationManager { get; } public ModuleSettingsPage() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -358,7 +358,7 @@ protected override void OnInit(EventArgs e) if (moduleControlInfo != null) { - + _control = ModuleControlFactory.LoadSettingsControl(Page, Module, moduleControlInfo.ControlSrc); var settingsControl = _control as ISettingsControl; @@ -442,11 +442,11 @@ protected override void OnLoad(EventArgs e) chkAllowIndex.Enabled = false; cboTab.Enabled = false; } - + if (_moduleId != -1) { BindData(); - cmdDelete.Visible = (ModulePermissionController.CanDeleteModule(Module) || + cmdDelete.Visible = (ModulePermissionController.CanDeleteModule(Module) || TabPermissionController.CanAddContentToPage()) && !HideDeleteButton; } else @@ -668,8 +668,8 @@ protected void OnUpdateClick(object sender, EventArgs e) } } - //These Module Copy/Move statements must be - //at the end of the Update as the Controller code assumes all the + //These Module Copy/Move statements must be + //at the end of the Update as the Controller code assumes all the //Updates to the Module have been carried out. //Check if the Module is to be Moved to a new Tab @@ -751,4 +751,4 @@ protected void OnWebSliceCheckChanged(object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Modules/viewsource.ascx.cs b/Website/admin/Modules/viewsource.ascx.cs index 829f2c8927a..c64ab4a4c80 100644 --- a/Website/admin/Modules/viewsource.ascx.cs +++ b/Website/admin/Modules/viewsource.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -41,7 +41,7 @@ public partial class ViewSource : PortalModuleBase protected INavigationManager NavigationManager { get; } public ViewSource() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -227,4 +227,4 @@ private void OnUpdateClick(object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Sales/Purchase.ascx.cs b/Website/admin/Sales/Purchase.ascx.cs index 9ca95a8e232..7d154d0ff8a 100644 --- a/Website/admin/Sales/Purchase.ascx.cs +++ b/Website/admin/Sales/Purchase.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -50,7 +50,7 @@ public partial class Purchase : PortalModuleBase public Purchase() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -124,7 +124,7 @@ protected override void OnLoad(EventArgs e) Response.Redirect(NavigationManager.NavigateURL(), true); } } - + //Store URL Referrer to return to portal if (Request.UrlReferrer != null) { @@ -248,4 +248,4 @@ private double ConvertCurrency(string Amount, string FromCurrency, string ToCurr return retValue; } } -} \ No newline at end of file +} diff --git a/Website/admin/Security/PasswordReset.ascx.cs b/Website/admin/Security/PasswordReset.ascx.cs index 86a0b6a6e89..01a8e8a6a70 100644 --- a/Website/admin/Security/PasswordReset.ascx.cs +++ b/Website/admin/Security/PasswordReset.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -48,13 +48,13 @@ namespace DotNetNuke.Modules.Admin.Security { - + public partial class PasswordReset : UserModuleBase { protected INavigationManager NavigationManager { get; } public PasswordReset() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -75,7 +75,7 @@ private string ResetToken } #endregion - + #region Event Handlers protected override void OnLoad(EventArgs e) @@ -96,14 +96,14 @@ protected override void OnLoad(EventArgs e) Response.Redirect(NavigationManager.NavigateURL(PortalSettings.LoginTabId) + Request.Url.Query); } cmdChangePassword.Click +=cmdChangePassword_Click; - + hlCancel.NavigateUrl = NavigationManager.NavigateURL(); if (Request.QueryString["resetToken"] != null) { ResetToken = Request.QueryString["resetToken"]; txtUsername.Enabled = false; - + } var useEmailAsUserName = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); @@ -222,7 +222,7 @@ private void cmdChangePassword_Click(object sender, EventArgs e) var failed = Localization.GetString("PasswordResetFailed"); LogFailure(failed); lblHelp.Text = failed; - return; + return; } //Check New Password is not same as username or banned @@ -237,7 +237,7 @@ private void cmdChangePassword_Click(object sender, EventArgs e) var failed = Localization.GetString("PasswordResetFailed"); LogFailure(failed); lblHelp.Text = failed; - return; + return; } } @@ -281,8 +281,8 @@ private void cmdChangePassword_Click(object sender, EventArgs e) var loginStatus = UserLoginStatus.LOGIN_FAILURE; UserController.UserLogin(PortalSettings.PortalId, username, txtPassword.Text, "", "", "", ref loginStatus, false); RedirectAfterLogin(); - } - } + } + } } protected void RedirectAfterLogin() @@ -319,7 +319,7 @@ protected void RedirectAfterLogin() } else { - //redirect to current page + //redirect to current page redirectURL = NavigationManager.NavigateURL(); } } @@ -375,11 +375,11 @@ private void LogResult(string message) log.LogProperties.Add(new LogDetailInfo("Cause", message)); } log.AddProperty("IP", _ipAddress); - + LogController.Instance.AddLog(log); } #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Security/SendPassword.ascx.cs b/Website/admin/Security/SendPassword.ascx.cs index f177c077f53..a6ea04766ce 100644 --- a/Website/admin/Security/SendPassword.ascx.cs +++ b/Website/admin/Security/SendPassword.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -60,7 +60,7 @@ public partial class SendPassword : UserModuleBase protected INavigationManager NavigationManager { get; } public SendPassword() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -90,7 +90,7 @@ protected string RedirectURL } else { - + if (Convert.ToInt32(setting) <= 0) { if (Request.QueryString["returnurl"] != null) @@ -113,7 +113,7 @@ protected string RedirectURL } if (String.IsNullOrEmpty(_RedirectURL)) { - //redirect to current page + //redirect to current page _RedirectURL = NavigationManager.NavigateURL(); } } @@ -125,7 +125,7 @@ protected string RedirectURL return _RedirectURL; } - + } /// @@ -186,7 +186,7 @@ protected override void OnInit(EventArgs e) base.OnInit(e); var isEnabled = true; - + //both retrieval and reset now use password token resets if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { @@ -199,7 +199,7 @@ protected override void OnInit(EventArgs e) lblHelp.Text = Localization.GetString("DisabledPasswordHelp", LocalResourceFile); divPassword.Visible = false; } - + if (!MembershipProviderConfig.PasswordResetEnabled) { isEnabled = false; @@ -211,7 +211,7 @@ protected override void OnInit(EventArgs e) { lblHelp.Text += Localization.GetString("RequiresUniqueEmail", LocalResourceFile); } - + if (MembershipProviderConfig.RequiresQuestionAndAnswer && isEnabled) { lblHelp.Text += Localization.GetString("RequiresQuestionAndAnswer", LocalResourceFile); @@ -232,7 +232,7 @@ protected override void OnLoad(EventArgs e) cmdSendPassword.Click += OnSendPasswordClick; lnkCancel.NavigateUrl = NavigationManager.NavigateURL(); - _ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); + _ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); divEmail.Visible = ShowEmailField; divUsername.Visible = !UsernameDisabled; @@ -302,7 +302,7 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) { canSend = false; } - else + else { if (_user.Membership.Approved == false) { @@ -376,7 +376,7 @@ private void LogResult(string message) LogUserID = UserId, LogUserName = portalSecurity.InputFilter(txtUsername.Text, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup) }; - + if (string.IsNullOrEmpty(message)) { log.LogTypeKey = "PASSWORD_SENT_SUCCESS"; @@ -386,9 +386,9 @@ private void LogResult(string message) log.LogTypeKey = "PASSWORD_SENT_FAILURE"; log.LogProperties.Add(new LogDetailInfo("Cause", message)); } - + log.AddProperty("IP", _ipAddress); - + LogController.Instance.AddLog(log); } @@ -396,4 +396,4 @@ private void LogResult(string message) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/BreadCrumb.ascx.cs b/Website/admin/Skins/BreadCrumb.ascx.cs index 5a90a8e9659..307f9f93b80 100644 --- a/Website/admin/Skins/BreadCrumb.ascx.cs +++ b/Website/admin/Skins/BreadCrumb.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke? - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -51,7 +51,7 @@ public partial class BreadCrumb : SkinObjectBase protected INavigationManager NavigationManager { get; } public BreadCrumb() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } // Separator between breadcrumb elements @@ -181,13 +181,13 @@ protected override void OnLoad(EventArgs e) // Get the absolute URL of the tab var tabUrl = tab.FullUrl; - // + // if (ProfileUserId > -1) { tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId); } - // + // if (GroupId > -1) { tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId); @@ -211,7 +211,7 @@ protected override void OnLoad(EventArgs e) } _breadcrumb.Append(""); //End of BreadcrumbList - + lblBreadCrumb.Text = _breadcrumb.ToString(); } @@ -251,9 +251,9 @@ private void ResolveSeparatorPaths() if (changed) { - var newMatch = string.Format("{0}={1}{2}{3}", - match.Groups[1].Value, - match.Groups[2].Value, + var newMatch = string.Format("{0}={1}{2}{3}", + match.Groups[1].Value, + match.Groups[2].Value, url, match.Groups[4].Value); @@ -264,4 +264,4 @@ private void ResolveSeparatorPaths() } } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Login.ascx.cs b/Website/admin/Skins/Login.ascx.cs index 4982fcb22de..827d0b25b9d 100644 --- a/Website/admin/Skins/Login.ascx.cs +++ b/Website/admin/Skins/Login.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -45,7 +45,7 @@ public partial class Login : SkinObjectBase protected INavigationManager NavigationManager { get; } public Login() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); LegacyMode = true; } @@ -55,7 +55,7 @@ public Login() #endregion #region Public Members - + public string Text { get; set; } public string CssClass { get; set; } @@ -166,7 +166,7 @@ protected override void OnLoad(EventArgs e) loginLink.Attributes.Add("onclick", oneclick); enhancedLoginLink.Attributes.Add("onclick", oneclick); } - + if (PortalSettings.EnablePopUps && PortalSettings.LoginTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this)) { //To avoid duplicated encodes of URL @@ -185,4 +185,4 @@ protected override void OnLoad(EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Logo.ascx.cs b/Website/admin/Skins/Logo.ascx.cs index a730ba04303..0eb916b9081 100644 --- a/Website/admin/Skins/Logo.ascx.cs +++ b/Website/admin/Skins/Logo.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -48,7 +48,7 @@ public partial class Logo : SkinObjectBase public Logo() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } protected override void OnLoad(EventArgs e) @@ -115,4 +115,4 @@ private IFileInfo GetLogoFileInfoCallBack(CacheItemArgs itemArgs) return FileManager.Instance.GetFile(PortalSettings.PortalId, PortalSettings.LogoFile); } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Privacy.ascx.cs b/Website/admin/Skins/Privacy.ascx.cs index 0794418a50c..80b54577d29 100644 --- a/Website/admin/Skins/Privacy.ascx.cs +++ b/Website/admin/Skins/Privacy.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -47,7 +47,7 @@ public partial class Privacy : SkinObjectBase public Privacy() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -87,4 +87,4 @@ protected override void OnLoad(EventArgs e) } } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Search.ascx.cs b/Website/admin/Skins/Search.ascx.cs index a6d376a4ba2..7d1f2b7c8fd 100644 --- a/Website/admin/Skins/Search.ascx.cs +++ b/Website/admin/Skins/Search.ascx.cs @@ -1,20 +1,20 @@ -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using DotNetNuke.Common.Interfaces; @@ -41,7 +41,7 @@ public partial class Search : SkinObjectBase protected INavigationManager NavigationManager { get; } public Search() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Private Members @@ -107,8 +107,8 @@ public bool ShowWeb /// Gets or sets the site icon URL. /// /// The site icon URL. - /// If the SiteIconURL is not set or is an empty string then this will return a site relative URL for the - /// DnnSearch_16X16_Standard.png image in the images/search subfolder. SiteIconURL supports using + /// If the SiteIconURL is not set or is an empty string then this will return a site relative URL for the + /// DnnSearch_16X16_Standard.png image in the images/search subfolder. SiteIconURL supports using /// app relative virtual paths designated by the use of the tilde (~). public string SiteIconURL { @@ -125,7 +125,7 @@ public string SiteIconURL _siteIconURL = value; } } - + public string SeeMoreText { get @@ -201,7 +201,7 @@ public string SiteToolTip _siteToolTip = value; } } - + /// /// Gets or sets the URL for doing web based site searches. /// @@ -244,7 +244,7 @@ public string SiteURL /// /// Gets or sets a value indicating whether to display the site/web options using a drop down list. /// - /// If true, then the site and web options are displayed in a drop down list. If the + /// If true, then the site and web options are displayed in a drop down list. If the /// drop down list is used, then the ShowWeb and ShowSite /// properties are not used. public bool UseDropDownList { get; set; } @@ -253,8 +253,8 @@ public string SiteURL /// Gets or sets the web icon URL. /// /// The web icon URL. - /// If the WebIconURL is not set or is an empty string then this will return a site relative URL for the - /// google-icon.gif image in the images/search subfolder. WebIconURL supports using + /// If the WebIconURL is not set or is an empty string then this will return a site relative URL for the + /// google-icon.gif image in the images/search subfolder. WebIconURL supports using /// app relative virtual paths designated by the use of the tilde (~). public string WebIconURL { @@ -474,11 +474,11 @@ protected void ExecuteSearch(string searchText, string searchType) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - + Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Search/SearchSkinObjectPreview.css", FileOrder.Css.ModuleCss); ClientResourceManager.RegisterScript(Page, "~/Resources/Search/SearchSkinObjectPreview.js"); - + cmdSearch.Click += CmdSearchClick; cmdSearchNew.Click += CmdSearchNewClick; @@ -553,7 +553,7 @@ protected override void OnPreRender(EventArgs e) ClassicSearch.Visible = !UseDropDownList; DropDownSearch.Visible = UseDropDownList; CultureCode = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); - + if (UseDropDownList) { //Client Variables will survive a postback so there is no reason to register them. @@ -603,4 +603,4 @@ protected override void OnPreRender(EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Terms.ascx.cs b/Website/admin/Skins/Terms.ascx.cs index 7213fd4b133..e7a8e8a7513 100644 --- a/Website/admin/Skins/Terms.ascx.cs +++ b/Website/admin/Skins/Terms.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -47,7 +47,7 @@ public partial class Terms : SkinObjectBase public Terms() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -88,4 +88,4 @@ protected override void OnLoad(EventArgs e) } } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/Toast.ascx.cs b/Website/admin/Skins/Toast.ascx.cs index a8677f9cb41..bf130a22954 100644 --- a/Website/admin/Skins/Toast.ascx.cs +++ b/Website/admin/Skins/Toast.ascx.cs @@ -41,7 +41,7 @@ public partial class Toast : SkinObjectBase public Toast() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public bool IsOnline() @@ -91,7 +91,7 @@ private int GetMessageTab() //This method is copied from user skin object private int FindMessageTab() { - //On brand new install the new Message Center Module is on the child page of User Profile Page + //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); if (profileTab != null) @@ -104,15 +104,15 @@ private int FindMessageTab() var module = kvp.Value; if (module.DesktopModule.FriendlyName == "Message Center") { - return tab.TabID; + return tab.TabID; } } } } //default to User Profile Page - return PortalSettings.UserTabId; - } + return PortalSettings.UserTabId; + } protected override void OnLoad(EventArgs e) { @@ -137,7 +137,7 @@ private void InitializeConfig() if (toastConfig == null) { var configFile = Server.MapPath(Path.Combine(TemplateSourceDirectory, "Toast.config")); - + if (File.Exists(configFile)) { var xmlDocument = new XmlDocument { XmlResolver = null }; @@ -196,4 +196,4 @@ private void InitializeConfig() } } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/User.ascx.cs b/Website/admin/Skins/User.ascx.cs index cf5e258e5e1..fe204a70daa 100644 --- a/Website/admin/Skins/User.ascx.cs +++ b/Website/admin/Skins/User.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -57,7 +57,7 @@ public partial class User : SkinObjectBase public User() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); ShowUnreadMessages = true; ShowAvatar = true; LegacyMode = true; @@ -132,7 +132,7 @@ protected override void OnLoad(EventArgs e) enhancedRegisterLink.ToolTip = registerLink.Text; } if (PortalSettings.Users < PortalSettings.UserQuota || PortalSettings.UserQuota == 0) - { + { if (LegacyMode) registerLink.Visible = true; else enhancedRegisterLink.Visible = true; } @@ -142,8 +142,8 @@ protected override void OnLoad(EventArgs e) registerLink.Visible = false; } - registerLink.NavigateUrl = !String.IsNullOrEmpty(URL) - ? URL + registerLink.NavigateUrl = !String.IsNullOrEmpty(URL) + ? URL : Globals.RegisterURL(HttpUtility.UrlEncode(NavigationManager.NavigateURL()), Null.NullString); enhancedRegisterLink.NavigateUrl = registerLink.NavigateUrl; @@ -167,8 +167,8 @@ protected override void OnLoad(EventArgs e) var userInfo = UserController.Instance.GetCurrentUserInfo(); if (userInfo.UserID != -1) { - registerLink.Text = userInfo.DisplayName; - registerLink.NavigateUrl = Globals.UserProfileURL(userInfo.UserID); + registerLink.Text = userInfo.DisplayName; + registerLink.NavigateUrl = Globals.UserProfileURL(userInfo.UserID); registerLink.ToolTip = Localization.GetString("VisitMyProfile", Localization.GetResourceFile(this, MyFileName)); enhancedRegisterLink.Text = registerLink.Text; @@ -206,7 +206,7 @@ protected override void OnLoad(EventArgs e) avatar.ImageUrl = GetAvatarUrl(userInfo); avatar.NavigateUrl = enhancedRegisterLink.NavigateUrl; avatar.ToolTip = avatar.Text = Localization.GetString("ProfileAvatar", Localization.GetResourceFile(this, MyFileName)); - avatarGroup.Visible = true; + avatarGroup.Visible = true; } else { @@ -245,7 +245,7 @@ private int GetMessageTab() private int FindMessageTab() { - //On brand new install the new Message Center Module is on the child page of User Profile Page + //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); if (profileTab != null) @@ -258,14 +258,14 @@ private int FindMessageTab() var module = kvp.Value; if (module.DesktopModule.FriendlyName == "Message Center" && !module.IsDeleted) { - return tab.TabID; + return tab.TabID; } } } } //default to User Profile Page - return PortalSettings.UserTabId; + return PortalSettings.UserTabId; } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/UserAndLogin.ascx.cs b/Website/admin/Skins/UserAndLogin.ascx.cs index 16287f9be8b..e838189edbf 100644 --- a/Website/admin/Skins/UserAndLogin.ascx.cs +++ b/Website/admin/Skins/UserAndLogin.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -51,7 +51,7 @@ public partial class UserAndLogin : SkinObjectBase public UserAndLogin() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool CanRegister @@ -113,7 +113,7 @@ protected bool UsePopUp { get { - return PortalSettings.EnablePopUps + return PortalSettings.EnablePopUps && PortalSettings.LoginTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this); } @@ -155,7 +155,7 @@ protected string UserProfileUrl protected string LocalizeString(string key) { - return Localization.GetString(key, Localization.GetResourceFile(this, MyFileName)); + return Localization.GetString(key, Localization.GetResourceFile(this, MyFileName)); } protected override void OnInit(EventArgs e) @@ -239,7 +239,7 @@ private int GetMessageTab() private int FindMessageTab() { - //On brand new install the new Message Center Module is on the child page of User Profile Page + //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); if (profileTab != null) @@ -252,14 +252,14 @@ private int FindMessageTab() var module = kvp.Value; if (module.DesktopModule.FriendlyName == "Message Center" && !module.IsDeleted) { - return tab.TabID; + return tab.TabID; } } } } //default to User Profile Page - return PortalSettings.UserTabId; + return PortalSettings.UserTabId; } private bool AlwaysShowCount() @@ -282,4 +282,4 @@ private bool AlwaysShowCount() return false; } } -} \ No newline at end of file +} diff --git a/Website/admin/Skins/tags.ascx.cs b/Website/admin/Skins/tags.ascx.cs index a1719cf3876..48384a51bdf 100644 --- a/Website/admin/Skins/tags.ascx.cs +++ b/Website/admin/Skins/tags.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -46,7 +46,7 @@ public partial class Tags : SkinObjectBase public Tags() { - NavigationManager = Globals.DependencyProvider.GetService(); + NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string AddImageUrl @@ -186,4 +186,4 @@ protected override void OnLoad(EventArgs e) tagsControl.ShowTags = ShowTags; } } -} \ No newline at end of file +} diff --git a/Website/admin/Tabs/Export.ascx.cs b/Website/admin/Tabs/Export.ascx.cs index 3ffd296fa39..ae6fdcda2ae 100644 --- a/Website/admin/Tabs/Export.ascx.cs +++ b/Website/admin/Tabs/Export.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -50,7 +50,7 @@ public partial class Export : PortalModuleBase public Export() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } public TabInfo Tab @@ -104,12 +104,12 @@ protected override void OnLoad(EventArgs e) var folderPath = "Templates/"; var templateFolder = FolderManager.Instance.GetFolder(UserInfo.PortalID, folderPath); cboFolders.Services.Parameters.Add("permission", "ADD"); - + if (templateFolder != null && IsAccessibleByUser(templateFolder)) { cboFolders.SelectedFolder = templateFolder; } - + if (Tab != null) { txtFile.Text = Globals.CleanName(Tab.TabName); @@ -166,7 +166,7 @@ protected void OnExportClick(Object sender, EventArgs e) { Services.FileSystem.FileManager.Instance.AddFile(folder, txtFile.Text + ".page.template", fileContent, true, true, "application/octet-stream"); } - + } } } @@ -180,4 +180,4 @@ protected void OnExportClick(Object sender, EventArgs e) #endregion } -} \ No newline at end of file +} diff --git a/Website/admin/Tabs/Import.ascx.cs b/Website/admin/Tabs/Import.ascx.cs index 16eae973207..81b29dee4ed 100644 --- a/Website/admin/Tabs/Import.ascx.cs +++ b/Website/admin/Tabs/Import.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -51,7 +51,7 @@ public partial class Import : PortalModuleBase public Import() { - NavigationManager = DependencyProvider.GetService(); + NavigationManager = DependencyProvider.GetRequiredService(); } private TabInfo _tab; @@ -351,4 +351,4 @@ protected void OptModeSelectedIndexChanged(object sender, EventArgs e) } } -} \ No newline at end of file +} From 87e5a6952ea000d876292234b588beed91e5fb42 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 19:20:57 -0400 Subject: [PATCH 24/44] Added new DotNetNuke.Abstractions project for storing different common abstractions for the platform --- .../DotNetNuke.Abstractions.csproj | 18 +++++++++++++ DNN_Platform.sln | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj diff --git a/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj b/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj new file mode 100644 index 00000000000..1af5f9edaba --- /dev/null +++ b/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj @@ -0,0 +1,18 @@ + + + + netstandard2.0 + false + + + + + SolutionInfo.cs + + + + + + + + diff --git a/DNN_Platform.sln b/DNN_Platform.sln index ae808b735eb..867f43df9cc 100644 --- a/DNN_Platform.sln +++ b/DNN_Platform.sln @@ -527,6 +527,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{8D99 Dnn.AdminExperience\Build\Symbols\releaseNotes.txt = Dnn.AdminExperience\Build\Symbols\releaseNotes.txt Dnn.AdminExperience\Build\Symbols\Symbols.dnn = Dnn.AdminExperience\Build\Symbols\Symbols.dnn EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1894,6 +1895,30 @@ Global {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|x86.ActiveCfg = Release|Any CPU {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|x86.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|Any CPU.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|x86.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|x86.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|Any CPU.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|Any CPU.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|x86.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|x86.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|x86.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|x86.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|Any CPU.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|x86.ActiveCfg = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|x86.Build.0 = Debug|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|Any CPU.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|x86.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|x86.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|Any CPU.Build.0 = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|x86.ActiveCfg = Release|Any CPU + {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2000,6 +2025,7 @@ Global {10D11155-ED05-40CB-9644-AD861A6D7096} = {392B91E8-C85D-4475-A169-1D4E33B06A4A} {622791DE-3AE7-4D54-9E66-2FED9686AA9E} = {10D11155-ED05-40CB-9644-AD861A6D7096} {8D99B9CD-004B-4237-8CFE-77CD327B4370} = {10D11155-ED05-40CB-9644-AD861A6D7096} + {6928A9B1-F88A-4581-A132-D3EB38669BB0} = {29273BE6-1AA8-4970-98A0-41BFFEEDA67B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46B6A641-57EB-4B19-B199-23E6FC2AB40B} From 35b14ae1e15d19d55caf22b28a50dfd196afcfc5 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 20:01:13 -0400 Subject: [PATCH 25/44] Updated all (non website project) classes to use INavigationManager from the new DotNetNuke.Abstractions project --- .../Dnn.Modules.Console.csproj | 5 ++++ .../Dnn.Modules.Console/ViewConsole.ascx.cs | 5 +--- .../CreateModule.ascx.cs | 2 +- .../Dnn.Modules.ModuleCreator.csproj | 6 ++++ .../viewsource.ascx.cs | 6 +--- .../INavigationManager.cs | 22 ++++---------- .../Portals/IPortalSettings.cs | 11 +++++++ .../DotNetNuke.Web.Mvc.csproj | 4 +++ .../ActionResults/DnnRedirecttoRouteResult.cs | 2 +- .../Routing/StandardModuleRoutingProvider.cs | 2 +- .../DotNetNuke.Web.Razor.csproj | 4 +++ .../DotNetNuke.Web.Razor/Helpers/UrlHelper.cs | 2 +- .../DotNetNuke.Web/DotNetNuke.Web.csproj | 4 +++ .../LanguageServiceController.cs | 6 +--- .../Mvp/ProfileModuleViewBase.cs | 2 +- .../UI/WebControls/DnnRibbonBarTool.cs | 2 +- .../DotNetNuke.Website.Deprecated.csproj | 4 +++ .../admin/ControlPanel/AddModule.ascx.cs | 10 ++----- .../admin/ControlPanel/AddPage.ascx.cs | 2 +- .../admin/ControlPanel/ControlBar.ascx.cs | 2 +- .../admin/ControlPanel/UpdatePage.ascx.cs | 2 +- .../admin/ControlPanel/WebUpload.ascx.cs | 2 +- .../HttpModules/DotNetNuke.HttpModules.csproj | 4 +++ .../UrlRewrite/FriendlyUrlProvider.cs | 4 +-- DNN Platform/Library/Common/Globals.cs | 20 +++++++++---- .../Library/Common/Internal/GlobalsImpl.cs | 2 +- .../Library/Common/NavigationManager.cs | 29 ++++++++++++------- .../Library/Common/Utilities/UrlUtils.cs | 2 +- .../Library/DotNetNuke.Library.csproj | 5 +++- .../Entities/Portals/IPortalController.cs | 8 +++++ .../Entities/Portals/PortalController.cs | 6 ++++ .../Entities/Portals/PortalSettings.cs | 3 +- .../Urls/AdvancedFriendlyUrlProvider.cs | 6 ++-- .../Entities/Urls/BasicFriendlyUrlProvider.cs | 8 ++--- .../Entities/Urls/FriendlyUrlProviderBase.cs | 4 +-- .../Url/FriendlyUrl/FriendlyUrlProvider.cs | 3 +- DNN Platform/Library/Startup.cs | 4 ++- .../Modules/ProfileModuleUserControlBase.cs | 2 +- DNN Platform/Library/UI/Skins/Skin.cs | 2 +- DNN Platform/Modules/DDRMenu/DNNAbstract.cs | 5 +--- .../DDRMenu/DotNetNuke.Modules.DDRMenu.csproj | 5 ++++ .../DotNetNuke.Modules.DigitalAssets.csproj | 5 ++++ .../DigitalAssets/EditFolderMapping.ascx.cs | 2 +- .../DigitalAssets/FolderMappings.ascx.cs | 2 +- .../Modules/DigitalAssets/View.ascx.cs | 2 +- .../Groups/Components/GroupViewParser.cs | 2 +- .../Modules/Groups/Components/Utilities.cs | 2 +- DNN Platform/Modules/Groups/Create.ascx.cs | 2 +- .../Groups/DotNetNuke.Modules.Groups.csproj | 4 +++ DNN Platform/Modules/Groups/GroupEdit.ascx.cs | 2 +- .../Modules/Groups/GroupsModuleBase.cs | 2 +- DNN Platform/Modules/Groups/List.ascx.cs | 2 +- .../Groups/ModerationServiceController.cs | 2 +- DNN Platform/Modules/Groups/View.ascx.cs | 2 +- .../HTML/Components/HtmlTextController.cs | 2 +- .../HTML/DotNetNuke.Modules.Html.csproj | 5 ++++ DNN Platform/Modules/HTML/EditHtml.ascx.cs | 2 +- DNN Platform/Modules/HTML/HtmlModule.ascx.cs | 2 +- DNN Platform/Modules/HTML/MyWork.ascx.cs | 2 +- .../Journal/Components/FeatureController.cs | 2 +- .../Journal/Components/JournalParser.cs | 2 +- .../Journal/DotNetNuke.Modules.Journal.csproj | 5 ++++ DNN Platform/Modules/Journal/View.ascx.cs | 2 +- .../DotNetNuke.Modules.MemberDirectory.csproj | 5 ++++ .../Modules/RazorHost/AddScript.ascx.cs | 2 +- .../Modules/RazorHost/CreateModule.ascx.cs | 2 +- .../DotNetNuke.Modules.RazorHost.csproj | 5 ++++ .../Modules/RazorHost/EditScript.ascx.cs | 2 +- .../Extensions/CreateModuleController.cs | 2 +- .../Extensions/Dto/PackageInfoDto.cs | 2 +- .../Editors/AuthSystemPackageEditor.cs | 2 +- .../Editors/CoreLanguagePackageEditor.cs | 2 +- .../Editors/ExtensionLanguagePackageEditor.cs | 2 +- .../Extensions/ExtensionsController.cs | 2 +- .../Components/Pages/Converters.cs | 2 +- .../Components/Users/Dto/UserDetailDto.cs | 2 +- .../Dnn.PersonaBar.Extensions.csproj | 4 +++ .../ExtensionMenuController.cs | 2 +- .../MenuControllers/ThemeMenuController.cs | 2 +- .../Services/LanguagesController.cs | 2 +- .../Services/PagesController.cs | 2 +- .../Services/SeoController.cs | 2 +- .../Services/ServerController.cs | 2 +- .../Services/SiteSettingsController.cs | 2 +- .../Containers/PersonaBarContainer.cs | 2 +- .../Dnn.PersonaBar.Library.csproj | 4 +++ .../Dnn.PersonaBar.UI.csproj | 4 +++ .../MenuControllers/LinkMenuController.cs | 3 +- 88 files changed, 221 insertions(+), 126 deletions(-) rename DNN Platform/{Library/Common/Interfaces => DotNetNuke.Abstractions}/INavigationManager.cs (75%) create mode 100644 DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj index 9a0152558d0..2dcc67178b6 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj @@ -20,6 +20,7 @@ + true @@ -109,6 +110,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs index d982a6ae67b..801904f3f31 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs @@ -29,17 +29,14 @@ using System.IO; using System.Linq; using System.Text; -using System.Web.UI; using System.Web.UI.WebControls; using Microsoft.Extensions.DependencyInjection; using Dnn.Modules.Console.Components; -using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Users; -using DotNetNuke.Framework; using DotNetNuke.Framework.JavaScriptLibraries; using DotNetNuke.Instrumentation; using DotNetNuke.Security.Permissions; diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs index 0e2e4a6d691..2ec81de0f0d 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs @@ -40,7 +40,7 @@ using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Services.Log.EventLog; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using Microsoft.Extensions.DependencyInjection; #endregion diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj index 16ce8e76934..a1f30e63c0b 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj @@ -19,6 +19,8 @@ + + true @@ -172,6 +174,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index af80471b0ee..1dc83b91e8f 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -25,11 +25,10 @@ using System; using System.IO; -using System.Collections; -using System.Collections.Generic; using System.Web.UI.WebControls; using Microsoft.Extensions.DependencyInjection; +using DotNetNuke.Abstractions; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; @@ -40,11 +39,8 @@ using DotNetNuke.Entities.Controllers; using DotNetNuke.Security; using DotNetNuke.Entities.Modules.Definitions; -using DotNetNuke.Services.Installer; using DotNetNuke.Services.Installer.Packages; -using DotNetNuke.Services.Installer.Writers; using DotNetNuke.Services.Log.EventLog; -using DotNetNuke.Common.Interfaces; #endregion diff --git a/DNN Platform/Library/Common/Interfaces/INavigationManager.cs b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs similarity index 75% rename from DNN Platform/Library/Common/Interfaces/INavigationManager.cs rename to DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs index bab075a65de..68897f493fe 100644 --- a/DNN Platform/Library/Common/Interfaces/INavigationManager.cs +++ b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs @@ -1,7 +1,6 @@ -using DotNetNuke.Entities.Portals; -using System.ComponentModel; +using DotNetNuke.Abstractions.Portals; -namespace DotNetNuke.Common.Interfaces +namespace DotNetNuke.Abstractions { public interface INavigationManager { @@ -9,7 +8,6 @@ public interface INavigationManager /// Gets the URL to the current page. ///
    /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(); /// @@ -17,7 +15,6 @@ public interface INavigationManager /// /// The tab ID. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(int tabID); /// @@ -26,7 +23,6 @@ public interface INavigationManager /// The tab ID. /// if set to true the page is a "super-tab," i.e. a host-level page. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(int tabID, bool isSuperTab); /// @@ -34,7 +30,6 @@ public interface INavigationManager /// /// The control key, or or null. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(string controlKey); /// @@ -43,7 +38,6 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters, in "key=value" format. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(string controlKey, params string[] additionalParameters); /// @@ -52,7 +46,6 @@ public interface INavigationManager /// The tab ID. /// The control key, or or null. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(int tabID, string controlKey); /// @@ -62,7 +55,6 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] string NavigateURL(int tabID, string controlKey, params string[] additionalParameters); /// @@ -73,8 +65,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - string NavigateURL(int tabID, PortalSettings 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. @@ -85,8 +76,7 @@ public interface INavigationManager /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - string NavigateURL(int tabID, bool isSuperTab, PortalSettings 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. @@ -98,7 +88,7 @@ public interface INavigationManager /// The language code. /// Any additional parameters. /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, PortalSettings 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. @@ -111,6 +101,6 @@ public interface INavigationManager /// The page name to pass to . /// Any additional parameters. /// Formatted url. - string NavigateURL(int tabID, bool isSuperTab, PortalSettings 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/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs new file mode 100644 index 00000000000..99dc282438c --- /dev/null +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -0,0 +1,11 @@ +namespace DotNetNuke.Abstractions.Portals +{ + public interface IPortalSettings + { + int PortalId { get; } + bool ContentLocalizationEnabled { get; } + bool EnableUrlLanguage { get; } + bool SSLEnabled { get; } + string SSLURL { get; } + } +} diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj index 3a2df51a852..10138b1eb7c 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj +++ b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj @@ -197,6 +197,10 @@ + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs index 4212c4fbdb2..dba43cbe51e 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs @@ -23,7 +23,7 @@ using System.Web.Routing; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Web.Mvc.Framework.Controllers; using DotNetNuke.Web.Mvc.Helpers; diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs index 4612baef5b8..5e5fc686fed 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs @@ -27,7 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Collections; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.UI.Modules; diff --git a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj index fccba35c5ec..04694be556c 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj +++ b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj @@ -128,6 +128,10 @@ + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs index 99a8434abfd..8cc41313293 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs @@ -21,7 +21,7 @@ #region Usings using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.UI.Modules; using System; using Microsoft.Extensions.DependencyInjection; diff --git a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj index 620702eb8f0..58492dd158b 100644 --- a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj +++ b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj @@ -419,6 +419,10 @@ + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs index 721ad739ff0..b33b0dcf549 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs @@ -25,19 +25,15 @@ using System.Linq; using System.Net; using System.Net.Http; -using System.Threading; using System.Web; using System.Web.Http; using System.Collections.Generic; -using DotNetNuke.Application; -using DotNetNuke.Common; -using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Portals; using DotNetNuke.Services.Localization; using DotNetNuke.Web.Api; using DotNetNuke.Entities.Tabs; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Web.InternalServices { diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs index 216b8e88700..5d942d8512e 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs @@ -24,7 +24,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs index 894550be918..06815b5a702 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs @@ -28,7 +28,7 @@ using DotNetNuke.Application; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj index ae6fd79db08..b5b35e0cb6e 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj +++ b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj @@ -157,6 +157,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} DotNetNuke.Instrumentation diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs index 0f2ba84ab2f..27490b5bef5 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs @@ -23,15 +23,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; using System.Linq; -using System.Text; using System.Threading; using System.Web; -using System.Web.UI; +using System.Web.UI.WebControls; using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Application; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Entities.Modules; @@ -46,7 +44,6 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Services.Personalization; -using DotNetNuke.UI.ControlPanels; using DotNetNuke.UI.Utilities; using DotNetNuke.Web.UI; using DotNetNuke.Web.UI.WebControls; @@ -61,9 +58,6 @@ namespace DotNetNuke.UI.ControlPanel { - using DotNetNuke.Common.Interfaces; - using System.Web.UI.WebControls; - public partial class AddModule : UserControlBase, IDnnRibbonBarTool { protected INavigationManager NavigationManager { get; } diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs index 4f28fcf04f7..575c92a071e 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs @@ -42,7 +42,7 @@ namespace DotNetNuke.UI.ControlPanel { - using DotNetNuke.Common.Interfaces; + using DotNetNuke.Abstractions; using System.Web.UI.WebControls; public partial class AddPage : UserControl, IDnnRibbonBarTool diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs index 9fe3498f575..666c48fa7eb 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs @@ -53,7 +53,7 @@ using DotNetNuke.Web.Components.Controllers; using DotNetNuke.Web.Components.Controllers.Models; using Globals = DotNetNuke.Common.Globals; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs index f92d401aaa7..2f72a432d9b 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs @@ -44,7 +44,7 @@ namespace DotNetNuke.UI.ControlPanel { - using DotNetNuke.Common.Interfaces; + using DotNetNuke.Abstractions; using System.Web.UI.WebControls; public partial class UpdatePage : UserControl, IDnnRibbonBarTool diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs index 03ccfed28f8..21db386e455 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs @@ -29,7 +29,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Modules; diff --git a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj index 7b42500b543..7ddc4120994 100644 --- a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj +++ b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj @@ -80,6 +80,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {6b29aded-7b56-4484-bea5-c0e09079535b} DotNetNuke.Library diff --git a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs index aa14afeb46c..39e10cc9f41 100644 --- a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs +++ b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs @@ -24,7 +24,7 @@ #region Usings using System; - +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Urls; @@ -108,7 +108,7 @@ public override string FriendlyUrl(TabInfo tab, string path, string pageName) return _providerInstance.FriendlyUrl(tab, path, pageName); } - public override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) + public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { return _providerInstance.FriendlyUrl(tab, path, pageName, settings); } diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index ed5a26c63ee..f81990284b2 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -40,10 +40,10 @@ using System.Web.UI; using System.Web.UI.HtmlControls; using System.Xml; - +using DotNetNuke.Abstractions; +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Application; using DotNetNuke.Collections.Internal; -using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; @@ -552,13 +552,21 @@ public static string InstallPath /// public static Version DatabaseEngineVersion { get; set; } + private static IServiceProvider _serviceProvider; /// /// Gets or sets the Dependency Service. /// /// /// The Dependency Service. /// - internal static IServiceProvider DependencyProvider { get; set; } + internal static IServiceProvider DependencyProvider + { + get => _serviceProvider; + set + { + _serviceProvider = value; + } + } /// /// Redirects the specified URL. @@ -810,7 +818,7 @@ private static bool IsInstallationURL() /// if set to true [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, PortalSettings settings) + internal static string GetCultureCode(int TabID, bool IsSuperTab, IPortalSettings settings) { string cultureCode = Null.NullString; if (settings != null) @@ -2686,7 +2694,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName) /// The path to format. /// The portal settings /// The formatted (friendly) URL - public static string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings settings) { return FriendlyUrl(tab, path, glbDefaultPage, settings); } @@ -2703,7 +2711,7 @@ public static string FriendlyUrl(TabInfo tab, string path, PortalSettings settin /// The page to include in the URL. /// The portal settings /// The formatted (friendly) url - public static string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { return FriendlyUrlProvider.Instance().FriendlyUrl(tab, path, pageName, settings); } diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 24e646d0ec6..3835ea7138f 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -21,7 +21,7 @@ using System; using System.Text; using System.Web; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs index f41996d4757..18f163621e1 100644 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -1,4 +1,5 @@ -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; @@ -13,6 +14,12 @@ namespace DotNetNuke.Common { internal class NavigationManager : INavigationManager { + private readonly IPortalController _portalController; + public NavigationManager(IPortalController portalController) + { + _portalController = portalController; + } + /// /// Gets the URL to the current page. /// @@ -20,7 +27,7 @@ internal class NavigationManager : INavigationManager [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL() { - PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + PortalSettings portalSettings = _portalController.GetCurrentPortalSettings(); return NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); } @@ -44,7 +51,7 @@ public string NavigateURL(int tabID) [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, bool isSuperTab) { - PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + IPortalSettings _portalSettings = _portalController.GetCurrentSettings(); string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, _portalSettings); return NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); } @@ -63,7 +70,7 @@ public string NavigateURL(string controlKey) } else { - PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); return NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); } } @@ -77,7 +84,7 @@ public string NavigateURL(string controlKey) [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(string controlKey, params string[] additionalParameters) { - PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); return NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); } @@ -90,7 +97,7 @@ public string NavigateURL(string controlKey, params string[] additionalParameter [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, string controlKey) { - PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); return NavigateURL(tabID, _portalSettings, controlKey, null); } @@ -104,7 +111,7 @@ public string NavigateURL(int tabID, string controlKey) [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); return NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); } @@ -117,7 +124,7 @@ public string NavigateURL(int tabID, string controlKey, params string[] addition /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters) { bool isSuperTab = Globals.IsHostTab(tabID); @@ -134,7 +141,7 @@ public string NavigateURL(int tabID, PortalSettings settings, string controlKey, /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) + public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) { string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); return NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); @@ -150,7 +157,7 @@ public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, s /// The language code. /// Any additional parameters. /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, PortalSettings 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 NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); } @@ -166,7 +173,7 @@ public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, s /// The page name to pass to . /// Any additional parameters. /// Formatted url. - public string NavigateURL(int tabID, bool isSuperTab, PortalSettings 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) { string 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 4dedd32a1c8..d3620619ae7 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -27,7 +27,7 @@ using System.Web; using System.Web.UI; using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; diff --git a/DNN Platform/Library/DotNetNuke.Library.csproj b/DNN Platform/Library/DotNetNuke.Library.csproj index 2f52632c34b..38e7b8b8d1e 100644 --- a/DNN Platform/Library/DotNetNuke.Library.csproj +++ b/DNN Platform/Library/DotNetNuke.Library.csproj @@ -189,7 +189,6 @@ - @@ -1839,6 +1838,10 @@ {ca056730-5759-41f8-a6c1-420f9c0c63e7} CountryListBox + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/Library/Entities/Portals/IPortalController.cs b/DNN Platform/Library/Entities/Portals/IPortalController.cs index 79c23ee7f1c..b5f4384a455 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalController.cs @@ -24,6 +24,7 @@ using System; using System.Collections; using System.Collections.Generic; +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Entities.Users; namespace DotNetNuke.Entities.Portals @@ -94,8 +95,15 @@ int CreatePortal(string portalName, UserInfo adminUser, string description, stri /// Gets the current portal settings. /// /// portal settings. + [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0. Use GetCurrentSettings instead.")] PortalSettings GetCurrentPortalSettings(); + /// + /// Gets the current portal settings. + /// + /// portal settings. + IPortalSettings GetCurrentSettings(); + /// /// Gets information of a portal /// diff --git a/DNN Platform/Library/Entities/Portals/PortalController.cs b/DNN Platform/Library/Entities/Portals/PortalController.cs index 2702fc625ed..4914c689a8f 100644 --- a/DNN Platform/Library/Entities/Portals/PortalController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalController.cs @@ -63,6 +63,7 @@ using DotNetNuke.Web.Client; using ICSharpCode.SharpZipLib.Zip; using FileInfo = DotNetNuke.Services.FileSystem.FileInfo; +using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettings; #endregion @@ -2335,6 +2336,11 @@ PortalSettings IPortalController.GetCurrentPortalSettings() return GetCurrentPortalSettingsInternal(); } + IAbPortalSettings IPortalController.GetCurrentSettings() + { + return GetCurrentPortalSettingsInternal(); + } + /// /// Gets information of a portal /// diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index 0ab1286f26a..5989960fd49 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -34,6 +34,7 @@ using DotNetNuke.Services.Personalization; using DotNetNuke.Services.Tokens; using DotNetNuke.Common; +using DotNetNuke.Abstractions.Portals; #endregion @@ -47,7 +48,7 @@ namespace DotNetNuke.Entities.Portals /// /// ----------------------------------------------------------------------------- [Serializable] - public partial class PortalSettings : BaseEntityInfo, IPropertyAccess + public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettings { #region ControlPanelPermission enum diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index c0ac90af887..25bf5bb51da 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -31,7 +31,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Web; - +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -72,13 +72,13 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) return FriendlyUrl(tab, path, pageName, PortalController.Instance.GetCurrentPortalSettings()); } - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings portalSettings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings) { if (portalSettings == null) { throw new ArgumentNullException("portalSettings"); } - return FriendlyUrlInternal(tab, path, pageName, String.Empty, portalSettings); + return FriendlyUrlInternal(tab, path, pageName, String.Empty, (PortalSettings)portalSettings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) diff --git a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs index d528caefdc6..13faef5af0a 100644 --- a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs @@ -28,7 +28,7 @@ using System.Collections.Specialized; using System.Text.RegularExpressions; using System.Web; - +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Common; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -324,9 +324,9 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) return FriendlyUrl(tab, path, pageName, _portalSettings); } - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { - return FriendlyUrl(tab, path, pageName, settings.PortalAlias.HTTPAlias, settings); + return FriendlyUrl(tab, path, pageName, ((PortalSettings)settings)?.PortalAlias.HTTPAlias, settings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) @@ -334,7 +334,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName, return FriendlyUrl(tab, path, pageName, portalAlias, null); } - private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, PortalSettings 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/FriendlyUrlProviderBase.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs index 17ab55c27ae..79df757019c 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Specialized; - +using DotNetNuke.Abstractions.Portals; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -64,7 +64,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, PortalSettings 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/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs index 8367f0ed3a3..50401affca8 100644 --- a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs +++ b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs @@ -20,6 +20,7 @@ #endregion #region Usings +using DotNetNuke.Abstractions.Portals; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -46,7 +47,7 @@ public static FriendlyUrlProvider Instance() public abstract string FriendlyUrl(TabInfo tab, string path, string pageName); - public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings); + public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings); public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias); diff --git a/DNN Platform/Library/Startup.cs b/DNN Platform/Library/Startup.cs index 2a62adffde8..c411541f521 100644 --- a/DNN Platform/Library/Startup.cs +++ b/DNN Platform/Library/Startup.cs @@ -1,6 +1,7 @@ using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.DependencyInjection; +using DotNetNuke.Entities.Portals; using DotNetNuke.UI.Modules; using DotNetNuke.UI.Modules.Html5; using Microsoft.Extensions.DependencyInjection; @@ -14,6 +15,7 @@ public void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddTransient(x => PortalController.Instance); services.AddTransient(); } } diff --git a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs index 7be1d22da39..c777300f23f 100644 --- a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs @@ -26,7 +26,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; diff --git a/DNN Platform/Library/UI/Skins/Skin.cs b/DNN Platform/Library/UI/Skins/Skin.cs index 59491fa8f36..d19eac71597 100644 --- a/DNN Platform/Library/UI/Skins/Skin.cs +++ b/DNN Platform/Library/UI/Skins/Skin.cs @@ -35,7 +35,7 @@ using DotNetNuke.Application; using DotNetNuke.Collections.Internal; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; diff --git a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs index b8508cc13d6..da69ab1c024 100644 --- a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs +++ b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Web; using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Framework; +using DotNetNuke.Abstractions; using DotNetNuke.UI; using DotNetNuke.UI.WebControls; using DotNetNuke.Web.DDRMenu.DNNCommon; @@ -16,9 +16,6 @@ namespace DotNetNuke.Web.DDRMenu { - using DotNetNuke.Common.Interfaces; - using DotNetNuke.Framework.JavaScriptLibraries; - internal static class DNNAbstract { public static string GetLoginUrl() diff --git a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj index 0b4b91633e3..98925809467 100644 --- a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj +++ b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj @@ -13,6 +13,7 @@ + Debug @@ -201,6 +202,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {03e3afa5-ddc9-48fb-a839-ad4282ce237e} DotNetNuke.Web.Client diff --git a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj index e2f4c6f5777..fea1d9a177d 100644 --- a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj +++ b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj @@ -23,6 +23,7 @@ ..\..\..\ true + true @@ -297,6 +298,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {9ba59b3d-9ffb-4a9e-bd7d-8b58d08b3a33} DotNetNuke.Web.Deprecated diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index 30fccc37d41..8e5d2496524 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -23,8 +23,8 @@ using System.Linq; using Microsoft.Extensions.DependencyInjection; +using DotNetNuke.Abstractions; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index 0f8bfcaf99c..32737ae8959 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -24,7 +24,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Framework.JavaScriptLibraries; diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index 9bece1e65ac..a3867f52de1 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -30,7 +30,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Icons; using DotNetNuke.Entities.Modules; diff --git a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs index 3c9ae80392b..d8da3f3ae4c 100644 --- a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs +++ b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs @@ -8,7 +8,7 @@ using DotNetNuke.Entities.Users; using DotNetNuke.Common; using DotNetNuke.Services.Localization; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Groups.Components { diff --git a/DNN Platform/Modules/Groups/Components/Utilities.cs b/DNN Platform/Modules/Groups/Components/Utilities.cs index f120f293a42..66c243ebcaa 100644 --- a/DNN Platform/Modules/Groups/Components/Utilities.cs +++ b/DNN Platform/Modules/Groups/Components/Utilities.cs @@ -2,7 +2,7 @@ using System.Text.RegularExpressions; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; namespace DotNetNuke.Modules.Groups { diff --git a/DNN Platform/Modules/Groups/Create.ascx.cs b/DNN Platform/Modules/Groups/Create.ascx.cs index fb55f57852a..7598c416f3b 100644 --- a/DNN Platform/Modules/Groups/Create.ascx.cs +++ b/DNN Platform/Modules/Groups/Create.ascx.cs @@ -10,7 +10,7 @@ using System.IO; using DotNetNuke.Security.Permissions; using DotNetNuke.Modules.Groups.Components; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Modules.Groups diff --git a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj index 529bfbc7c05..3a9179c47d5 100644 --- a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj +++ b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj @@ -235,6 +235,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs index dd961f3e510..19143db9181 100644 --- a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs @@ -5,7 +5,7 @@ using DotNetNuke.Common.Utilities; using System.IO; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Modules.Groups diff --git a/DNN Platform/Modules/Groups/GroupsModuleBase.cs b/DNN Platform/Modules/Groups/GroupsModuleBase.cs index f2141c77277..1721d929f5f 100644 --- a/DNN Platform/Modules/Groups/GroupsModuleBase.cs +++ b/DNN Platform/Modules/Groups/GroupsModuleBase.cs @@ -30,7 +30,7 @@ using System; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Security.Permissions; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/DNN Platform/Modules/Groups/List.ascx.cs b/DNN Platform/Modules/Groups/List.ascx.cs index 38ce33a8b45..04eef1d6022 100644 --- a/DNN Platform/Modules/Groups/List.ascx.cs +++ b/DNN Platform/Modules/Groups/List.ascx.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Framework; namespace DotNetNuke.Modules.Groups diff --git a/DNN Platform/Modules/Groups/ModerationServiceController.cs b/DNN Platform/Modules/Groups/ModerationServiceController.cs index 6992e1f20f0..05c5e919d43 100644 --- a/DNN Platform/Modules/Groups/ModerationServiceController.cs +++ b/DNN Platform/Modules/Groups/ModerationServiceController.cs @@ -39,7 +39,7 @@ using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Web.Api; using DotNetNuke.Security; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Groups { diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index bf65cd52c61..ff46dd1ad59 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -35,7 +35,7 @@ using DotNetNuke.Modules.Groups.Components; using DotNetNuke.Common; using DotNetNuke.Framework; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs index af575df9c87..7d76e249072 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs @@ -45,7 +45,7 @@ using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Services.Tokens; using DotNetNuke.Services.Exceptions; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Html { diff --git a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj index a6dab435b12..71c522f66b9 100644 --- a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj +++ b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj @@ -28,6 +28,7 @@ + true @@ -211,6 +212,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index 71ff251d285..f1ff747c6e4 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -39,7 +39,7 @@ using DotNetNuke.Common.Utilities; using Telerik.Web.UI; using DotNetNuke.Modules.Html.Components; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index bb9e7f5eab7..3a2c1466014 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -35,7 +35,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.UI.WebControls; using DotNetNuke.Modules.Html.Components; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index dd321e93b89..98ab54f0cc7 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -23,7 +23,7 @@ using System; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; diff --git a/DNN Platform/Modules/Journal/Components/FeatureController.cs b/DNN Platform/Modules/Journal/Components/FeatureController.cs index a1d8b4a1993..bd52f5c5a10 100644 --- a/DNN Platform/Modules/Journal/Components/FeatureController.cs +++ b/DNN Platform/Modules/Journal/Components/FeatureController.cs @@ -16,7 +16,7 @@ using System.Web; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Data; using DotNetNuke.Entities.Modules; diff --git a/DNN Platform/Modules/Journal/Components/JournalParser.cs b/DNN Platform/Modules/Journal/Components/JournalParser.cs index 6f1e8c26e54..1cf050b695d 100644 --- a/DNN Platform/Modules/Journal/Components/JournalParser.cs +++ b/DNN Platform/Modules/Journal/Components/JournalParser.cs @@ -16,7 +16,7 @@ using DotNetNuke.Services.Localization; using System.Xml; using DotNetNuke.Entities.Modules; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Journal.Components { diff --git a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj index cc5b844a8b8..61ddf1b8768 100644 --- a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj +++ b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj @@ -26,6 +26,7 @@ ..\..\..\..\Evoq.Content\ true + true @@ -228,6 +229,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/Journal/View.ascx.cs b/DNN Platform/Modules/Journal/View.ascx.cs index 2b9e5978fbf..cf0ca733254 100644 --- a/DNN Platform/Modules/Journal/View.ascx.cs +++ b/DNN Platform/Modules/Journal/View.ascx.cs @@ -23,7 +23,7 @@ using DotNetNuke.Web.Client.ClientResourceManagement; using DotNetNuke.Modules.Journal.Components; using DotNetNuke.Security.Roles; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Journal { diff --git a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj index 4e3f6ff4d25..6ab43a6f6b0 100644 --- a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj +++ b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj @@ -27,6 +27,7 @@ ..\..\..\..\Evoq.Content\ true + true @@ -166,6 +167,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs index a3693ca9fe2..5663c0937bc 100644 --- a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs @@ -24,7 +24,7 @@ using System.IO; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.Localization; using DotNetNuke.UI.Modules; diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index 0eba4d77773..7b39c859e63 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -27,7 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; diff --git a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj index 8e3fabaad13..d5e224f8955 100644 --- a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj +++ b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj @@ -27,6 +27,7 @@ + true @@ -188,6 +189,10 @@ + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {9806c125-8ca9-48cc-940a-ccd0442c5993} DotNetNuke.Web.Razor diff --git a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs index 77b05601f38..fb3b4edb93b 100644 --- a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs @@ -26,7 +26,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs index 6dcaf4d5fa7..3527741cec5 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs index 8867163179e..ffdf17eb6e3 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs @@ -23,7 +23,7 @@ using System.Linq; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs index 57ce60616f9..301e390e606 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs @@ -3,7 +3,7 @@ using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; using DotNetNuke.Instrumentation; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs index 82ab4ceaa72..8cb4a537ce7 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs @@ -3,7 +3,7 @@ using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Tabs; using DotNetNuke.Instrumentation; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs index 8cd3f524817..0caf20ba631 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs @@ -2,7 +2,7 @@ using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Tabs; using DotNetNuke.Instrumentation; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs index 9f2c3308f0d..e8f8fc8dc6e 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs @@ -32,7 +32,7 @@ using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs index 9a9ed1762fd..e51df588bcd 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs @@ -9,7 +9,7 @@ using Dnn.PersonaBar.Themes.Components; using Dnn.PersonaBar.Themes.Components.DTO; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs index a723861ce94..37930a6351b 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs @@ -31,7 +31,7 @@ using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.Users.Components.Dto { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj index 45b820e23e4..d4e781dcf9c 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj @@ -580,6 +580,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs index 1549b64f593..766005801ae 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs @@ -3,7 +3,7 @@ using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs index c653dac7047..3df6150582f 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs @@ -6,7 +6,7 @@ using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs index cae8196b8e7..6231c3e28c8 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs @@ -24,7 +24,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Web.Api; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.SiteSettings.Services { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs index 16a71153255..15ffcbe94cd 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs @@ -54,7 +54,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Social.Notifications; using Localization = Dnn.PersonaBar.Pages.Components.Localization; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.Pages.Services { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs index 324588903b9..9cb240a819b 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs @@ -36,7 +36,7 @@ using Dnn.PersonaBar.Seo.Components; using Dnn.PersonaBar.Seo.Services.Dto; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Modules; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs index 1ff475cb1ee..6b69ceeaaf9 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs @@ -28,7 +28,7 @@ using Dnn.PersonaBar.Library; using Dnn.PersonaBar.Library.Attributes; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Instrumentation; using DotNetNuke.Services.Localization; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs index 6b86290cf70..2b4017b5e19 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs @@ -23,7 +23,7 @@ using Dnn.PersonaBar.Library.Attributes; using Dnn.PersonaBar.SiteSettings.Services.Dto; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index bfe77b3c424..643741d95a1 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -30,7 +30,7 @@ using Dnn.PersonaBar.Library.Helper; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Application; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj index b2e1f871163..4b8c62f8626 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj @@ -111,6 +111,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj index f2ed8871610..f839ec80078 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj @@ -251,6 +251,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs index f7db095b0d1..bff3bfc50a6 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/MenuControllers/LinkMenuController.cs @@ -23,11 +23,12 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.DependencyInjection; + +using DotNetNuke.Abstractions; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Application; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; From ec10808dc9e43fcbbf4567614a3de3b7ab52eabf Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 20:04:53 -0400 Subject: [PATCH 26/44] Updated Website Project to use the INavigationManager from the new DotNetNuke.Abstractions project --- Website/Default.aspx.cs | 3 +-- Website/DesktopModules/Admin/Authentication/Login.ascx.cs | 2 +- .../Admin/EditExtension/AuthenticationEditor.ascx.cs | 2 +- .../DesktopModules/Admin/EditExtension/EditExtension.ascx.cs | 2 +- Website/DesktopModules/Admin/Security/EditUser.ascx.cs | 2 +- Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs | 2 +- Website/DesktopModules/Admin/Security/Membership.ascx.cs | 2 +- .../DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs | 2 +- Website/DesktopModules/Admin/Security/Register.ascx.cs | 2 +- Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs | 2 +- .../Admin/UrlManagement/UrlProviderSettings.ascx.cs | 2 +- Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs | 2 +- .../DesktopModules/AuthenticationServices/DNN/Login.ascx.cs | 2 +- Website/DotNetNuke.Website.csproj | 4 ++++ Website/admin/Modules/Export.ascx.cs | 2 +- Website/admin/Modules/Import.ascx.cs | 2 +- Website/admin/Modules/ModulePermissions.ascx.cs | 2 +- Website/admin/Modules/Modulesettings.ascx.cs | 2 +- Website/admin/Modules/viewsource.ascx.cs | 2 +- Website/admin/Sales/Purchase.ascx.cs | 2 +- Website/admin/Security/PasswordReset.ascx.cs | 2 +- Website/admin/Security/SendPassword.ascx.cs | 2 +- Website/admin/Skins/BreadCrumb.ascx.cs | 2 +- Website/admin/Skins/Login.ascx.cs | 2 +- Website/admin/Skins/Logo.ascx.cs | 2 +- Website/admin/Skins/Privacy.ascx.cs | 2 +- Website/admin/Skins/Search.ascx.cs | 2 +- Website/admin/Skins/Terms.ascx.cs | 2 +- Website/admin/Skins/Toast.ascx.cs | 2 +- Website/admin/Skins/User.ascx.cs | 2 +- Website/admin/Skins/UserAndLogin.ascx.cs | 2 +- Website/admin/Skins/tags.ascx.cs | 2 +- Website/admin/Tabs/Export.ascx.cs | 2 +- Website/admin/Tabs/Import.ascx.cs | 2 +- 34 files changed, 37 insertions(+), 34 deletions(-) diff --git a/Website/Default.aspx.cs b/Website/Default.aspx.cs index 9d476d55126..c0e2a4c768d 100644 --- a/Website/Default.aspx.cs +++ b/Website/Default.aspx.cs @@ -32,6 +32,7 @@ using System.Web.UI.WebControls; using Microsoft.Extensions.DependencyInjection; +using DotNetNuke.Abstractions; using DotNetNuke.Application; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; @@ -59,9 +60,7 @@ namespace DotNetNuke.Framework { - using DotNetNuke.Common.Interfaces; using Web.Client; - /// ----------------------------------------------------------------------------- /// Project : DotNetNuke /// Class : CDefault diff --git a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs index 44157e79eb7..a9d8293e248 100644 --- a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs +++ b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs @@ -55,7 +55,7 @@ using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using Microsoft.Extensions.DependencyInjection; #endregion diff --git a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs index b6dcb109f06..d7795eb3e90 100644 --- a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs @@ -24,7 +24,7 @@ using System.IO; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Services.Authentication; using DotNetNuke.Services.Installer.Packages; using DotNetNuke.Services.Localization; diff --git a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs index 44ff5b98ab4..42aeb28377b 100644 --- a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs @@ -27,7 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Framework; using DotNetNuke.Framework.JavaScriptLibraries; diff --git a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs index 1d2d0d2b620..4fbd15f48b4 100644 --- a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs +++ b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs @@ -21,7 +21,7 @@ #region Usings using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; diff --git a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs index c989123893c..a39b3b2caf6 100644 --- a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs @@ -25,7 +25,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; diff --git a/Website/DesktopModules/Admin/Security/Membership.ascx.cs b/Website/DesktopModules/Admin/Security/Membership.ascx.cs index c965528f392..1314db20f34 100644 --- a/Website/DesktopModules/Admin/Security/Membership.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Membership.ascx.cs @@ -33,7 +33,7 @@ using DotNetNuke.Services.Mail; using DotNetNuke.UI.Skins.Controls; using DotNetNuke.Services.Localization; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs index b435d1cbc64..74ba3c6014f 100644 --- a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs @@ -23,7 +23,7 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; diff --git a/Website/DesktopModules/Admin/Security/Register.ascx.cs b/Website/DesktopModules/Admin/Security/Register.ascx.cs index 7e8d475f482..f36e868bbda 100644 --- a/Website/DesktopModules/Admin/Security/Register.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Register.ascx.cs @@ -53,7 +53,7 @@ using System.Web.UI.WebControls; using DotNetNuke.Entities.Users.Membership; using DotNetNuke.Framework.JavaScriptLibraries; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs index e689c944a36..42e5d51eae3 100644 --- a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs +++ b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs @@ -27,7 +27,7 @@ using System.Threading; using System.Web.UI; using System.Web.UI.WebControls; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; diff --git a/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs b/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs index fd6bfbe44ec..fe834f5ce03 100644 --- a/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs +++ b/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs @@ -9,7 +9,7 @@ using System.Linq; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Urls; using DotNetNuke.UI.Modules; using Microsoft.Extensions.DependencyInjection; diff --git a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs index 67d96eb959c..97613059938 100644 --- a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs +++ b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs @@ -37,7 +37,7 @@ using DotNetNuke.UI.Modules; using DotNetNuke.Entities.Users.Social; using DotNetNuke.Services.Social.Notifications; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs index 3af1b6a5d01..f4190426d92 100644 --- a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs +++ b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs @@ -23,7 +23,7 @@ using System; using System.Web; using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; diff --git a/Website/DotNetNuke.Website.csproj b/Website/DotNetNuke.Website.csproj index 07aca3fba33..5718b7204be 100644 --- a/Website/DotNetNuke.Website.csproj +++ b/Website/DotNetNuke.Website.csproj @@ -3358,6 +3358,10 @@ + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation diff --git a/Website/admin/Modules/Export.ascx.cs b/Website/admin/Modules/Export.ascx.cs index 333e83d5421..dec606fe4e8 100644 --- a/Website/admin/Modules/Export.ascx.cs +++ b/Website/admin/Modules/Export.ascx.cs @@ -30,7 +30,7 @@ using System.Xml; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; diff --git a/Website/admin/Modules/Import.ascx.cs b/Website/admin/Modules/Import.ascx.cs index d0e33c938eb..db78cf4e81f 100644 --- a/Website/admin/Modules/Import.ascx.cs +++ b/Website/admin/Modules/Import.ascx.cs @@ -32,7 +32,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Users; diff --git a/Website/admin/Modules/ModulePermissions.ascx.cs b/Website/admin/Modules/ModulePermissions.ascx.cs index 0f332862f0e..c1b9d335424 100644 --- a/Website/admin/Modules/ModulePermissions.ascx.cs +++ b/Website/admin/Modules/ModulePermissions.ascx.cs @@ -31,7 +31,7 @@ using DotNetNuke.Security.Permissions; using DotNetNuke.Services.Exceptions; using Globals = DotNetNuke.Common.Globals; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/admin/Modules/Modulesettings.ascx.cs b/Website/admin/Modules/Modulesettings.ascx.cs index 17c1a9955cd..0b8e10f1bec 100644 --- a/Website/admin/Modules/Modulesettings.ascx.cs +++ b/Website/admin/Modules/Modulesettings.ascx.cs @@ -45,7 +45,7 @@ using DotNetNuke.UI.Skins.Controls; using Globals = DotNetNuke.Common.Globals; using DotNetNuke.Instrumentation; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/admin/Modules/viewsource.ascx.cs b/Website/admin/Modules/viewsource.ascx.cs index c64ab4a4c80..870b25143f3 100644 --- a/Website/admin/Modules/viewsource.ascx.cs +++ b/Website/admin/Modules/viewsource.ascx.cs @@ -25,7 +25,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; diff --git a/Website/admin/Sales/Purchase.ascx.cs b/Website/admin/Sales/Purchase.ascx.cs index 7d154d0ff8a..1fc5abe952c 100644 --- a/Website/admin/Sales/Purchase.ascx.cs +++ b/Website/admin/Sales/Purchase.ascx.cs @@ -27,7 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; diff --git a/Website/admin/Security/PasswordReset.ascx.cs b/Website/admin/Security/PasswordReset.ascx.cs index 01a8e8a6a70..cd2cee47975 100644 --- a/Website/admin/Security/PasswordReset.ascx.cs +++ b/Website/admin/Security/PasswordReset.ascx.cs @@ -41,7 +41,7 @@ using DotNetNuke.Web.Client.ClientResourceManagement; using DotNetNuke.Web.UI.WebControls; using DotNetNuke.Services.UserRequest; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/admin/Security/SendPassword.ascx.cs b/Website/admin/Security/SendPassword.ascx.cs index a6ea04766ce..34640ce452a 100644 --- a/Website/admin/Security/SendPassword.ascx.cs +++ b/Website/admin/Security/SendPassword.ascx.cs @@ -40,7 +40,7 @@ using DotNetNuke.Services.Mail; using DotNetNuke.UI.Skins.Controls; using DotNetNuke.Services.UserRequest; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/admin/Skins/BreadCrumb.ascx.cs b/Website/admin/Skins/BreadCrumb.ascx.cs index 307f9f93b80..b24391202e3 100644 --- a/Website/admin/Skins/BreadCrumb.ascx.cs +++ b/Website/admin/Skins/BreadCrumb.ascx.cs @@ -26,7 +26,7 @@ using System.Text.RegularExpressions; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Tabs; diff --git a/Website/admin/Skins/Login.ascx.cs b/Website/admin/Skins/Login.ascx.cs index 827d0b25b9d..02f056ade72 100644 --- a/Website/admin/Skins/Login.ascx.cs +++ b/Website/admin/Skins/Login.ascx.cs @@ -25,7 +25,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Services.Authentication; diff --git a/Website/admin/Skins/Logo.ascx.cs b/Website/admin/Skins/Logo.ascx.cs index 0eb916b9081..81f8259583a 100644 --- a/Website/admin/Skins/Logo.ascx.cs +++ b/Website/admin/Skins/Logo.ascx.cs @@ -25,7 +25,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Services.Exceptions; diff --git a/Website/admin/Skins/Privacy.ascx.cs b/Website/admin/Skins/Privacy.ascx.cs index 80b54577d29..9968e44bc3b 100644 --- a/Website/admin/Skins/Privacy.ascx.cs +++ b/Website/admin/Skins/Privacy.ascx.cs @@ -21,7 +21,7 @@ #region Usings using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.Localization; diff --git a/Website/admin/Skins/Search.ascx.cs b/Website/admin/Skins/Search.ascx.cs index 7d1f2b7c8fd..bd5ae741e26 100644 --- a/Website/admin/Skins/Search.ascx.cs +++ b/Website/admin/Skins/Search.ascx.cs @@ -17,7 +17,7 @@ // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Icons; diff --git a/Website/admin/Skins/Terms.ascx.cs b/Website/admin/Skins/Terms.ascx.cs index e7a8e8a7513..0fbb021fc9e 100644 --- a/Website/admin/Skins/Terms.ascx.cs +++ b/Website/admin/Skins/Terms.ascx.cs @@ -21,7 +21,7 @@ #region Usings using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.Localization; diff --git a/Website/admin/Skins/Toast.ascx.cs b/Website/admin/Skins/Toast.ascx.cs index bf130a22954..3b84effbb84 100644 --- a/Website/admin/Skins/Toast.ascx.cs +++ b/Website/admin/Skins/Toast.ascx.cs @@ -13,7 +13,7 @@ using System.Xml; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; diff --git a/Website/admin/Skins/User.ascx.cs b/Website/admin/Skins/User.ascx.cs index fe204a70daa..f0674f091da 100644 --- a/Website/admin/Skins/User.ascx.cs +++ b/Website/admin/Skins/User.ascx.cs @@ -43,7 +43,7 @@ namespace DotNetNuke.UI.Skins.Controls { - using DotNetNuke.Common.Interfaces; + using DotNetNuke.Abstractions; using DotNetNuke.Entities.Controllers; /// ----------------------------------------------------------------------------- diff --git a/Website/admin/Skins/UserAndLogin.ascx.cs b/Website/admin/Skins/UserAndLogin.ascx.cs index e838189edbf..356824efb93 100644 --- a/Website/admin/Skins/UserAndLogin.ascx.cs +++ b/Website/admin/Skins/UserAndLogin.ascx.cs @@ -36,7 +36,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Services.Social.Messaging.Internal; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; #endregion diff --git a/Website/admin/Skins/tags.ascx.cs b/Website/admin/Skins/tags.ascx.cs index 48384a51bdf..c5385ac06fe 100644 --- a/Website/admin/Skins/tags.ascx.cs +++ b/Website/admin/Skins/tags.ascx.cs @@ -23,7 +23,7 @@ using System; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Entities.Icons; #endregion diff --git a/Website/admin/Tabs/Export.ascx.cs b/Website/admin/Tabs/Export.ascx.cs index ae6fdcda2ae..75c826eb0e2 100644 --- a/Website/admin/Tabs/Export.ascx.cs +++ b/Website/admin/Tabs/Export.ascx.cs @@ -27,7 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; diff --git a/Website/admin/Tabs/Import.ascx.cs b/Website/admin/Tabs/Import.ascx.cs index 81b29dee4ed..56966dc596f 100644 --- a/Website/admin/Tabs/Import.ascx.cs +++ b/Website/admin/Tabs/Import.ascx.cs @@ -28,7 +28,7 @@ using System.Xml; using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Common.Interfaces; +using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; From cadd83babfd795b68bcc2434ab65d3ac970eeca7 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 20:25:10 -0400 Subject: [PATCH 27/44] Removed unnecessary attributes from NavigationManager --- DNN Platform/Library/Common/NavigationManager.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs index 18f163621e1..ddbd89d6092 100644 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -6,7 +6,6 @@ using DotNetNuke.Entities.Tabs; using DotNetNuke.Services.Localization; using System; -using System.ComponentModel; using System.Linq; using System.Threading; @@ -24,7 +23,6 @@ public NavigationManager(IPortalController portalController) /// Gets the URL to the current page. /// /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL() { PortalSettings portalSettings = _portalController.GetCurrentPortalSettings(); @@ -36,7 +34,6 @@ public string NavigateURL() /// /// The tab ID. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID) { return NavigateURL(tabID, Null.NullString); @@ -48,7 +45,6 @@ public string NavigateURL(int tabID) /// The tab ID. /// if set to true the page is a "super-tab," i.e. a host-level page. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, bool isSuperTab) { IPortalSettings _portalSettings = _portalController.GetCurrentSettings(); @@ -61,7 +57,6 @@ public string NavigateURL(int tabID, bool isSuperTab) /// /// The control key, or or null. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(string controlKey) { if (controlKey == "Access Denied") @@ -81,7 +76,6 @@ public string NavigateURL(string controlKey) /// The control key, or or null. /// Any additional parameters, in "key=value" format. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(string controlKey, params string[] additionalParameters) { PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); @@ -94,7 +88,6 @@ public string NavigateURL(string controlKey, params string[] additionalParameter /// The tab ID. /// The control key, or or null. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, string controlKey) { PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); @@ -108,7 +101,6 @@ public string NavigateURL(int tabID, string controlKey) /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); @@ -123,7 +115,6 @@ public string NavigateURL(int tabID, string controlKey, params string[] addition /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters) { bool isSuperTab = Globals.IsHostTab(tabID); @@ -140,7 +131,6 @@ public string NavigateURL(int tabID, IPortalSettings settings, string controlKey /// The control key, or or null. /// Any additional parameters. /// Formatted URL. - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) { string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); From 7d22dae04691b0528dde133c991e8c985eba66bf Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 21:13:02 -0400 Subject: [PATCH 28/44] Updated redirection controller tests to mock out the DependencyProvider and the INavigationManager to fix failing unit tests --- .../DotNetNuke.Tests.Core.csproj | 4 ++++ .../Mobile/RedirectionControllerTests.cs | 22 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj index 6a156602ebd..46825754996 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj @@ -205,6 +205,10 @@ + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {03e3afa5-ddc9-48fb-a839-ad4282ce237e} DotNetNuke.Web.Client diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index 413561e37ab..22370d99449 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -25,9 +25,8 @@ using System.Data; using System.Reflection; using System.Web; - -using DotNetNuke.Common.Internal; -using DotNetNuke.Common.Utilities; +using DotNetNuke.Abstractions; +using DotNetNuke.Common; using DotNetNuke.ComponentModel; using DotNetNuke.Data; using DotNetNuke.Entities.Controllers; @@ -35,7 +34,6 @@ using DotNetNuke.Security.Roles; using DotNetNuke.Services.Cache; using DotNetNuke.Services.ClientCapability; -using DotNetNuke.Services.Localization; using DotNetNuke.Services.Mobile; using DotNetNuke.Tests.Core.Services.ClientCapability; using DotNetNuke.Tests.Instance.Utilities; @@ -108,6 +106,16 @@ public class RedirectionControllerTests #region Set Up + [TestFixtureSetUp] + public void FixtureSetup() + { + var navigationManagerMock = new Mock(); + navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; + } + [SetUp] public void SetUp() { @@ -134,6 +142,12 @@ public void SetUp() } } + [TestFixtureTearDown] + public void FixtureTearDown() + { + Globals.DependencyProvider = null; + } + [TearDown] public void TearDown() { From ea2b32acb74c579a2d6c085a9eced66c812ce852 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 21:21:58 -0400 Subject: [PATCH 29/44] Fixed failing unit tests with mocking out INavigationManager --- .../Folder/StandardFolderProviderTests.cs | 16 ++++++++++++++ .../Mobile/RedirectionControllerTests.cs | 22 +++++-------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs index 01db024c58c..2483f0c5fab 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs @@ -22,6 +22,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using DotNetNuke.Abstractions; +using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Portals; @@ -57,6 +59,14 @@ public class StandardFolderProviderTests #endregion #region Setup + [TestFixtureSetUp] + public void FixtureSetup() + { + var navigationManagerMock = new Mock(); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; + } [SetUp] public void Setup() @@ -117,6 +127,12 @@ public void TearDown() MockComponentProvider.ResetContainer(); } + [TestFixtureTearDown] + public void FixtureTeardown() + { + Globals.DependencyProvider = null; + } + #endregion #region AddFile diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index 22370d99449..b87e7319fea 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -105,17 +105,6 @@ public class RedirectionControllerTests #endregion #region Set Up - - [TestFixtureSetUp] - public void FixtureSetup() - { - var navigationManagerMock = new Mock(); - navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; - } - [SetUp] public void SetUp() { @@ -140,12 +129,12 @@ public void SetUp() { dataProviderField.SetValue(tabController, _dataProvider.Object); } - } - [TestFixtureTearDown] - public void FixtureTearDown() - { - Globals.DependencyProvider = null; + var navigationManagerMock = new Mock(); + navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; } [TearDown] @@ -165,6 +154,7 @@ public void TearDown() _dtRules = null; } ComponentFactory.Container = null; + Globals.DependencyProvider = null; } #endregion From df2ba4d187f247869ae3b6399ae0ca4a073b4d07 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 22:35:13 -0400 Subject: [PATCH 30/44] Removed private fields for DependencyProvider --- DNN Platform/Library/Common/Globals.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index f81990284b2..faf938c754d 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -552,21 +552,13 @@ public static string InstallPath /// public static Version DatabaseEngineVersion { get; set; } - private static IServiceProvider _serviceProvider; /// /// Gets or sets the Dependency Service. /// /// /// The Dependency Service. /// - internal static IServiceProvider DependencyProvider - { - get => _serviceProvider; - set - { - _serviceProvider = value; - } - } + internal static IServiceProvider DependencyProvider { get; set; } /// /// Redirects the specified URL. From e808defd70fcd308463c952ce692ff7d41eb0d24 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 22:35:46 -0400 Subject: [PATCH 31/44] Added singleton clear statements to prevent the INavigationManager from remaining in memory and conflicts between unit tests --- .../Folder/StandardFolderProviderTests.cs | 8 ++--- .../Mobile/RedirectionControllerTests.cs | 35 +++++++++++-------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs index 2483f0c5fab..5562b2e5a39 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs @@ -24,6 +24,7 @@ using System.Linq; using DotNetNuke.Abstractions; using DotNetNuke.Common; +using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Portals; @@ -62,6 +63,7 @@ public class StandardFolderProviderTests [TestFixtureSetUp] public void FixtureSetup() { + TestableGlobals.ClearInstance(); var navigationManagerMock = new Mock(); var containerMock = new Mock(); containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); @@ -127,12 +129,6 @@ public void TearDown() MockComponentProvider.ResetContainer(); } - [TestFixtureTearDown] - public void FixtureTeardown() - { - Globals.DependencyProvider = null; - } - #endregion #region AddFile diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index b87e7319fea..fd4a0a9c4fa 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -27,6 +27,7 @@ using System.Web; using DotNetNuke.Abstractions; using DotNetNuke.Common; +using DotNetNuke.Common.Internal; using DotNetNuke.ComponentModel; using DotNetNuke.Data; using DotNetNuke.Entities.Controllers; @@ -49,11 +50,11 @@ namespace DotNetNuke.Tests.Core.Services.Mobile /// Summary description for RedirectionControllerTests /// [TestFixture] - public class RedirectionControllerTests + public class RedirectionControllerTests { - #region Private Properties + #region Private Properties - private Mock _dataProvider; + private Mock _dataProvider; private RedirectionController _redirectionController; private Mock _clientCapabilityProvider; private Mock _mockHostController; @@ -108,7 +109,8 @@ public class RedirectionControllerTests [SetUp] public void SetUp() { - ComponentFactory.Container = new SimpleContainer(); + SetupContianer(); + ComponentFactory.Container = new SimpleContainer(); UnitTestHelper.ClearHttpContext(); _dataProvider = MockComponentProvider.CreateDataProvider(); MockComponentProvider.CreateDataCacheProvider(); @@ -129,12 +131,6 @@ public void SetUp() { dataProviderField.SetValue(tabController, _dataProvider.Object); } - - var navigationManagerMock = new Mock(); - navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; } [TearDown] @@ -154,16 +150,25 @@ public void TearDown() _dtRules = null; } ComponentFactory.Container = null; - Globals.DependencyProvider = null; } - #endregion + private void SetupContianer() + { + TestableGlobals.ClearInstance(); + var navigationManagerMock = new Mock(); + navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; + } + #endregion - #region Tests + #region Tests - #region CURD API Tests + #region CURD API Tests - [Test] + + [Test] public void RedirectionController_Save_Valid_Redirection() { var redirection = new Redirection { Name = "Test R", PortalId = Portal0, SortOrder = 1, SourceTabId = -1, Type = RedirectionType.MobilePhone, TargetType = TargetType.Portal, TargetValue = Portal1 }; From 4d825104860111bedf7c3ffea0b7eb1818c3a346 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 22:39:33 -0400 Subject: [PATCH 32/44] Reset singleton state for PortalController to reduce side-effects from other tests and stale object state from Dependency Injection --- .../Services/Mobile/RedirectionControllerTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index fd4a0a9c4fa..b694501c194 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -31,6 +31,7 @@ using DotNetNuke.ComponentModel; using DotNetNuke.Data; using DotNetNuke.Entities.Controllers; +using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.Security.Roles; using DotNetNuke.Services.Cache; @@ -155,6 +156,7 @@ public void TearDown() private void SetupContianer() { TestableGlobals.ClearInstance(); + PortalController.ClearInstance(); var navigationManagerMock = new Mock(); navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); var containerMock = new Mock(); From 855edc3bcc7c5d71191fe10c30a8b4cebd24f0b9 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 22:57:05 -0400 Subject: [PATCH 33/44] Moved state cleanup code to teardown routine --- .../Providers/Folder/StandardFolderProviderTests.cs | 3 ++- .../Services/Mobile/RedirectionControllerTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs index 5562b2e5a39..8c5063a00b1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs @@ -63,7 +63,6 @@ public class StandardFolderProviderTests [TestFixtureSetUp] public void FixtureSetup() { - TestableGlobals.ClearInstance(); var navigationManagerMock = new Mock(); var containerMock = new Mock(); containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); @@ -127,6 +126,8 @@ private PortalSettings GetPortalSettingsMock() public void TearDown() { MockComponentProvider.ResetContainer(); + TestableGlobals.ClearInstance(); + PortalController.ClearInstance(); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index b694501c194..c98e779687e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -137,6 +137,8 @@ public void SetUp() [TearDown] public void TearDown() { + TestableGlobals.ClearInstance(); + PortalController.ClearInstance(); CachingProvider.Instance().PurgeCache(); MockComponentProvider.ResetContainer(); UnitTestHelper.ClearHttpContext(); @@ -155,8 +157,6 @@ public void TearDown() private void SetupContianer() { - TestableGlobals.ClearInstance(); - PortalController.ClearInstance(); var navigationManagerMock = new Mock(); navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); var containerMock = new Mock(); From 716f9744215d6a0d4385f952971be4750cdc8a33 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 23:01:22 -0400 Subject: [PATCH 34/44] Fixed failing unit tests in tests.web project. Added mocks for INavigationManager so the DepenencyProvider can resolve --- .../Api/PortalAliasRouteManagerTests.cs | 10 ++++++++++ .../Api/ServiceRoutingManagerTests.cs | 7 +++++++ .../DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs index 00862e2e78b..1620835869e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs @@ -25,6 +25,8 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using DotNetNuke.Abstractions; +using DotNetNuke.Common; using DotNetNuke.Common.Internal; using DotNetNuke.Entities.Portals; using DotNetNuke.Web.Api; @@ -36,6 +38,14 @@ namespace DotNetNuke.Tests.Web.Api [TestFixture] public class PortalAliasRouteManagerTests { + [SetUp] + public void SetUp() + { + var navigationManagerMock = new Mock(); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; + } [TearDown] public void TearDown() diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs index 04199d731a2..1fcbcd3c083 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs @@ -23,6 +23,8 @@ using System.Collections.Generic; using System.Linq; using System.Web.Routing; +using DotNetNuke.Abstractions; +using DotNetNuke.Common; using DotNetNuke.Entities.Portals; using DotNetNuke.Framework.Internal.Reflection; using DotNetNuke.Framework.Reflections; @@ -51,6 +53,11 @@ public void Setup() _mockPortalController = new Mock(); _portalController = _mockPortalController.Object; PortalController.SetTestableInstance(_portalController); + + var navigationManagerMock = new Mock(); + var containerMock = new Mock(); + containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); + Globals.DependencyProvider = containerMock.Object; } [TearDown] diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj index 61cf89bcfd5..7101d59a1ef 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj @@ -114,6 +114,10 @@ {3b2fa1d9-ec7d-4cec-8ff5-a7700cf5cb40} Dnn.AuthServices.Jwt + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + {04f77171-0634-46e0-a95e-d7477c88712e} DotNetNuke.Log4Net From 57c4c75b7e9ce2800e573ec14b7287e57c52eda5 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 23:49:36 -0400 Subject: [PATCH 35/44] Added new DotNetNuke.Abstractions.nuspec to create NuGets during build --- .../NuGet/DotNetNuke.Abstractions.nuspec | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec diff --git a/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec b/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec new file mode 100644 index 00000000000..6fad544ab67 --- /dev/null +++ b/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec @@ -0,0 +1,22 @@ + + + + DotNetNuke.Abstractions + $version$ + DNN Platform (Abstractions) + DNN Corp + DNN Corp + MIT + false + http://www.dnnsoftware.com/favicon.ico + https://github.com/dnnsoftware/Dnn.Platform + + Provides common abstraction API references for the DNN Platform. + + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + + + + + + From 1b93ce4835bac8527d44aeaba33b98b1bb87aa68 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Thu, 17 Oct 2019 23:51:43 -0400 Subject: [PATCH 36/44] Added missing nuspec files to the solution file --- DNN_Platform.sln | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DNN_Platform.sln b/DNN_Platform.sln index 867f43df9cc..271a9481405 100644 --- a/DNN_Platform.sln +++ b/DNN_Platform.sln @@ -440,8 +440,10 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{F4AAB2C9-8B8B-441B-8623-9347B62884A1}" ProjectSection(SolutionItems) = preProject Build\Tools\NuGet\Dnn.PersonaBar.Library.nuspec = Build\Tools\NuGet\Dnn.PersonaBar.Library.nuspec + Build\Tools\NuGet\DotNetNuke.Abstractions.nuspec = Build\Tools\NuGet\DotNetNuke.Abstractions.nuspec Build\Tools\NuGet\DotNetNuke.Bundle.nuspec = Build\Tools\NuGet\DotNetNuke.Bundle.nuspec Build\Tools\NuGet\DotNetNuke.Core.nuspec = Build\Tools\NuGet\DotNetNuke.Core.nuspec + Build\Tools\NuGet\DotNetNuke.DependencyInjection.nuspec = Build\Tools\NuGet\DotNetNuke.DependencyInjection.nuspec Build\Tools\NuGet\DotNetNuke.Instrumentation.nuspec = Build\Tools\NuGet\DotNetNuke.Instrumentation.nuspec Build\Tools\NuGet\DotNetNuke.Providers.FolderProviders.nuspec = Build\Tools\NuGet\DotNetNuke.Providers.FolderProviders.nuspec Build\Tools\NuGet\DotNetNuke.SiteExportImport.nuspec = Build\Tools\NuGet\DotNetNuke.SiteExportImport.nuspec @@ -528,6 +530,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{8D99 Dnn.AdminExperience\Build\Symbols\Symbols.dnn = Dnn.AdminExperience\Build\Symbols\Symbols.dnn EndProjectSection Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 68ab5fde766bf03455d37f6447fe187fcc2ef65a Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Fri, 18 Oct 2019 00:00:43 -0400 Subject: [PATCH 37/44] Updated copyright on all nuget files --- Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Bundle.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Core.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.Web.nuspec | 2 +- Build/Tools/NuGet/DotNetNuke.WebApi.nuspec | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec b/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec index 6fad544ab67..24365059835 100644 --- a/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec @@ -13,7 +13,7 @@ Provides common abstraction API references for the DNN Platform. - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec b/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec index 95ced463f27..5eb3fa1aef2 100644 --- a/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec @@ -13,7 +13,7 @@ This package is a metapackage that automatically includes all other available DNN Packages, this should only be used in situations where support for ALL types of development are truly needed. - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Core.nuspec b/Build/Tools/NuGet/DotNetNuke.Core.nuspec index 6835a3fb5a7..a4468a8ea30 100644 --- a/Build/Tools/NuGet/DotNetNuke.Core.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Core.nuspec @@ -13,7 +13,7 @@ Provides basic references to the DotNetNuke.dll to develop extensions for the DNN Platform. For MVC or WebAPI please see other packages available as well - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec b/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec index 2d9dbc5b781..8d6a6bf3fe3 100644 --- a/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec @@ -13,7 +13,7 @@ Provides API references needed to use Dependency Injection for the DNN Platform. - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec b/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec index 5dffdf8d456..ae6fd71060a 100644 --- a/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec @@ -13,7 +13,7 @@ Provides references to enhanced logging and instrumentation available within DNN Platform for extension developers. Including access to Log4Net - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec b/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec index 1fe82884eb6..6c6ba7840bc 100644 --- a/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec @@ -13,7 +13,7 @@ Provides API references needed to develop custom folder providers, or to consume folder providers - DotNetNuke is copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec b/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec index cb9a17f77eb..09a294bec9b 100644 --- a/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec @@ -13,7 +13,7 @@ This package contains components required for developing extensiong to utilize site export/import features. - DNN and DotNetNuke are copyright 2002-2018 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec index adb9ba22b5a..9d35ec99083 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec @@ -13,7 +13,7 @@ Provides API references for usage of the Client Dependency Framework (CDF) for the inclusion of CSS and JS files within DNN Platform - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec index 2aed056ceaf..b66b4d8c0ad 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec @@ -13,7 +13,7 @@ Provides API references for deprecated items removed from the primary API's, such as DNN's Telerik component. These elements may not be distributed with DNN in the future - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec index f4f93d06834..e65ea7c4f25 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec @@ -13,7 +13,7 @@ Provides API references needed to develop ASP.MVC extensions for DNN Platform - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.nuspec index 19187265f56..297f102e875 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.nuspec @@ -13,7 +13,7 @@ Provides references to core components such as Caching, Security and other security-related items for DNN Platform - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec b/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec index e6a3f201196..19f92884f72 100644 --- a/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec @@ -13,7 +13,7 @@ This package contains components required for developing WebAPI based services for DNN Platform. - DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. + Copyright (c) .NET Foundation and Contributors, All Rights Reserved. From 6bdaff185c8268c533f1a040f7f70a7af7fa8749 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Fri, 18 Oct 2019 00:01:42 -0400 Subject: [PATCH 38/44] Added .NET Foundation file headers to new Abstraction files --- DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs | 6 +++++- .../DotNetNuke.Abstractions/Portals/IPortalSettings.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs index 68897f493fe..9abf932250b 100644 --- a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs +++ b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs @@ -1,4 +1,8 @@ -using DotNetNuke.Abstractions.Portals; +// 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. + +using DotNetNuke.Abstractions.Portals; namespace DotNetNuke.Abstractions { diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs index 99dc282438c..7bfd99a725f 100644 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs @@ -1,4 +1,8 @@ -namespace DotNetNuke.Abstractions.Portals +// 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 { public interface IPortalSettings { From 94d277facba761629184cbc1aa2ae0dbd7407f16 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sat, 19 Oct 2019 09:22:50 -0400 Subject: [PATCH 39/44] Resolved duplicate addition of DotNetNuke.Abstractions to sln file --- DNN_Platform.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DNN_Platform.sln b/DNN_Platform.sln index 271a9481405..a1f33341453 100644 --- a/DNN_Platform.sln +++ b/DNN_Platform.sln @@ -529,7 +529,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{8D99 Dnn.AdminExperience\Build\Symbols\releaseNotes.txt = Dnn.AdminExperience\Build\Symbols\releaseNotes.txt Dnn.AdminExperience\Build\Symbols\Symbols.dnn = Dnn.AdminExperience\Build\Symbols\Symbols.dnn EndProjectSection -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" EndProject Global From 85b55537c95417496caab715c38f97ea930678b7 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sat, 19 Oct 2019 22:13:01 -0400 Subject: [PATCH 40/44] Added SetTestableInstance and Clear methods to make it easier to test Components. The new methods are internal --- .../Library/ComponentModel/ComponentBase.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/DNN Platform/Library/ComponentModel/ComponentBase.cs b/DNN Platform/Library/ComponentModel/ComponentBase.cs index 679039dcb14..e4190d1dd12 100644 --- a/DNN Platform/Library/ComponentModel/ComponentBase.cs +++ b/DNN Platform/Library/ComponentModel/ComponentBase.cs @@ -28,10 +28,16 @@ namespace DotNetNuke.ComponentModel { public abstract class ComponentBase where TType : class, TContract { + private static TContract _testableInstance; + private static bool _useTestable = false; + public static TContract Instance { get { + if (_useTestable && _testableInstance != null) + return _testableInstance; + var component = ComponentFactory.GetComponent(); if (component == null) @@ -44,6 +50,27 @@ public static TContract Instance } } + /// + /// Registers an instance to use for the Singleton + /// + /// Intended for unit testing purposes, not thread safe + /// + internal static void SetTestableInstance(TContract instance) + { + _testableInstance = instance; + _useTestable = true; + } + + /// + /// Clears the current instance, a new instance will be initialized when next requested + /// + /// Intended for unit testing purposes, not thread safe + internal static void ClearInstance() + { + _useTestable = false; + _testableInstance = default(TContract); + } + public static void RegisterInstance(TContract instance) { if ((ComponentFactory.GetComponent() == null)) From 4c0262aa70601dbbba2ab740ef66522ec0e87671 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sat, 19 Oct 2019 22:13:17 -0400 Subject: [PATCH 41/44] Added happy path test for Navigation Manager --- .../Common/NavigationManagerTests.cs | 96 +++++++++++++++++++ .../DotNetNuke.Tests.Core.csproj | 1 + 2 files changed, 97 insertions(+) create mode 100644 DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs new file mode 100644 index 00000000000..e6cc5c2305c --- /dev/null +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs @@ -0,0 +1,96 @@ +using DotNetNuke.Abstractions; +using DotNetNuke.Abstractions.Portals; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Tabs; +using DotNetNuke.Services.Localization; +using Moq; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DotNetNuke.Tests.Core.Common +{ + [TestFixture] + public class NavigationManagerTests + { + private INavigationManager _navigationManager; + private const int TabID = 100; + + [TestFixtureSetUp] + public void Setup() + { + + _navigationManager = new NavigationManager(PortalControllerMock()); + TabController.SetTestableInstance(TabControllerMock()); + LocaleController.SetTestableInstance(LocaleControllerMock()); + + IPortalController PortalControllerMock() + { + var mockPortalController = new Mock(); + mockPortalController + .Setup(x => x.GetCurrentPortalSettings()) + .Returns(PortalSettingsMock()); + + return mockPortalController.Object; + + PortalSettings PortalSettingsMock() + { + var portalSettings = new PortalSettings(); + portalSettings.ActiveTab = new TabInfo + { + TabID = TabID + }; + + return portalSettings; + } + } + ITabController TabControllerMock() + { + var mockTabController = new Mock(); + mockTabController + .Setup(x => x.GetTabsByPortal(Null.NullInteger)) + .Returns(default(TabCollection)); + mockTabController + .Setup(x => x.GetTab(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(new TabInfo + { + CultureCode = "en-US" + }); + + return mockTabController.Object; + } + ILocaleController LocaleControllerMock() + { + var mockLocaleController = new Mock(); + mockLocaleController + .Setup(x => x.GetLocales(It.IsAny())) + .Returns(new Dictionary()); + + return mockLocaleController.Object; + } + } + + [TestFixtureTearDown] + public void TearDown() + { + _navigationManager = null; + TabController.ClearInstance(); + LocaleController.ClearInstance(); + } + + [Test] + public void NavigateUrlTest() + { + var expected = "/Default.aspx?tabid=100"; + var actual = _navigationManager.NavigateURL(); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + } +} diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj index 46825754996..16fb778a4f3 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj @@ -125,6 +125,7 @@ + From 326c80ef39202082756db674534c68f91452a38e Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sat, 19 Oct 2019 23:55:38 -0400 Subject: [PATCH 42/44] Added NavigationManager tests --- .../Common/NavigationManagerTests.cs | 314 +++++++++++++++++- 1 file changed, 306 insertions(+), 8 deletions(-) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs index e6cc5c2305c..49daf861b39 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs @@ -7,11 +7,8 @@ using DotNetNuke.Services.Localization; using Moq; using NUnit.Framework; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DotNetNuke.Tests.Core.Common { @@ -20,6 +17,11 @@ public class NavigationManagerTests { private INavigationManager _navigationManager; private const int TabID = 100; + private const int PortalID = 7; + private const string DefaultURLPattern = "/Default.aspx?tabid={0}"; + private const string DefaultSuperTabPattern = "&portalid={0}"; + private const string ControlKeyPattern = "&ctl={0}"; + private const string LanguagePattern = "&language={0}"; [TestFixtureSetUp] public void Setup() @@ -35,15 +37,21 @@ IPortalController PortalControllerMock() mockPortalController .Setup(x => x.GetCurrentPortalSettings()) .Returns(PortalSettingsMock()); + mockPortalController + .Setup(x => x.GetCurrentSettings()) + .Returns(PortalSettingsMock()); return mockPortalController.Object; PortalSettings PortalSettingsMock() { - var portalSettings = new PortalSettings(); - portalSettings.ActiveTab = new TabInfo + var portalSettings = new PortalSettings { - TabID = TabID + PortalId = PortalID, + ActiveTab = new TabInfo + { + TabID = TabID + } }; return portalSettings; @@ -69,7 +77,11 @@ ILocaleController LocaleControllerMock() var mockLocaleController = new Mock(); mockLocaleController .Setup(x => x.GetLocales(It.IsAny())) - .Returns(new Dictionary()); + .Returns(new Dictionary + { + { "en-US", new Locale() }, + { "TEST", new Locale() } + }); return mockLocaleController.Object; } @@ -86,11 +98,297 @@ public void TearDown() [Test] public void NavigateUrlTest() { - var expected = "/Default.aspx?tabid=100"; + var expected = string.Format(DefaultURLPattern, TabID); var actual = _navigationManager.NavigateURL(); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + [TestCase(11)] + public void NavigateUrl_CustomTabID(int tabId) + { + var expected = string.Format(DefaultURLPattern, tabId); + var actual = _navigationManager.NavigateURL(tabId); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [Test] + public void NavigateUrl_CustomTab_NotSuperTab() + { + var customTabId = 55; + var expected = string.Format(DefaultURLPattern, customTabId); + var actual = _navigationManager.NavigateURL(customTabId, false); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + [TestCase(11)] + public void NavigateUrl_CustomTab_IsSuperTab(int tabId) + { + var expected = string.Format(DefaultURLPattern, tabId) + string.Format(DefaultSuperTabPattern, PortalID); + var actual = _navigationManager.NavigateURL(tabId, true); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [Test] + [Ignore] + public void NavigateUrl_ControlKey_AccessDenied() + { + // TODO - We can't properly test this until we migrate + // Globals.AccessDeniedURL to an interface in the abstraction + // project. The dependencies go very deep and make it very + // difficult to properly test just the NavigationManager logic. + var actual = _navigationManager.NavigateURL("Access Denied"); + } + + [Test] + public void NavigateUrl_ControlKey() + { + var controlKey = "My-Control-Key"; + var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); + var actual = _navigationManager.NavigateURL(controlKey); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [Test] + public void NavigateUrl_ControlKey_EmptyAdditionalParameter() + { + var controlKey = "My-Control-Key"; + var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); + var actual = _navigationManager.NavigateURL(controlKey, new string[0]); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [Test] + public void NavigateUrl_ControlKey_SingleAdditionalParameter() + { + var controlKey = "My-Control-Key"; + var parameters = new string[] { "My-Parameter" }; + var expected = string.Format(DefaultURLPattern, TabID) + + string.Format(ControlKeyPattern, controlKey) + + $"&{parameters[0]}"; + var actual = _navigationManager.NavigateURL(controlKey, parameters); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + public void NavigateUrl_ControlKey_MultipleAdditionalParameter(int count) + { + string[] parameters = new string[count]; + for (int index = 0; index < count; index++) + parameters[index] = $"My-Parameter{index}"; + + var controlKey = "My-Control-Key"; + var expected = string.Format(DefaultURLPattern, TabID) + + string.Format(ControlKeyPattern, controlKey) + + parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); + var actual = _navigationManager.NavigateURL(controlKey, parameters); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + [TestCase(11)] + public void NavigateUrl_TabID_ControlKey(int tabId) + { + var controlKey = "My-Control-Key"; + var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); + var actual = _navigationManager.NavigateURL(tabId, controlKey); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + [TestCase(11)] + public void NavigateUrl_TabID_EmptyControlKey(int tabId) + { + var expected = string.Format(DefaultURLPattern, tabId); + var actual = _navigationManager.NavigateURL(tabId, string.Empty); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + [TestCase(4)] + [TestCase(5)] + [TestCase(6)] + [TestCase(7)] + [TestCase(8)] + [TestCase(9)] + [TestCase(10)] + [TestCase(11)] + public void NavigateUrl_TabID_NullControlKey(int tabId) + { + var expected = string.Format(DefaultURLPattern, tabId); + var actual = _navigationManager.NavigateURL(tabId, string.Empty); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(0, "My-Control-Key-0")] + [TestCase(1, "My-Control-Key-1")] + [TestCase(2, "My-Control-Key-2")] + [TestCase(3, "My-Control-Key-3")] + [TestCase(4, "My-Control-Key-4")] + [TestCase(5, "My-Control-Key-5")] + [TestCase(6, "My-Control-Key-6")] + [TestCase(7, "My-Control-Key-7")] + [TestCase(8, "My-Control-Key-8")] + [TestCase(9, "My-Control-Key-9")] + [TestCase(10, "My-Control-Key-10")] + public void NavigateUrl_TabID_ControlKey_Parameter(int count, string controlKey) + { + string[] parameters = new string[count]; + for (int index = 0; index < count; index++) + parameters[index] = $"My-Parameter{index}"; + + var customTabId = 51; + var expected = string.Format(DefaultURLPattern, customTabId) + + string.Format(ControlKeyPattern, controlKey); + + if (parameters.Length > 0) + expected += parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); + + var actual = _navigationManager.NavigateURL(customTabId, controlKey, parameters); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(0, "My-Control-Key-0")] + [TestCase(1, "My-Control-Key-1")] + [TestCase(2, "My-Control-Key-2")] + [TestCase(3, "My-Control-Key-3")] + [TestCase(4, "My-Control-Key-4")] + [TestCase(5, "My-Control-Key-5")] + [TestCase(6, "My-Control-Key-6")] + [TestCase(7, "My-Control-Key-7")] + [TestCase(8, "My-Control-Key-8")] + [TestCase(9, "My-Control-Key-9")] + [TestCase(10, "My-Control-Key-10")] + public void NavigateUrl_TabID_ControlKey_NullParameter(int tabId, string controlKey) + { + var expected = string.Format(DefaultURLPattern, tabId) + + string.Format(ControlKeyPattern, controlKey); + + var actual = _navigationManager.NavigateURL(tabId, controlKey, null); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(0, "My-Control-Key-0")] + [TestCase(1, "My-Control-Key-1")] + [TestCase(2, "My-Control-Key-2")] + [TestCase(3, "My-Control-Key-3")] + [TestCase(4, "My-Control-Key-4")] + [TestCase(5, "My-Control-Key-5")] + [TestCase(6, "My-Control-Key-6")] + [TestCase(7, "My-Control-Key-7")] + [TestCase(8, "My-Control-Key-8")] + [TestCase(9, "My-Control-Key-9")] + [TestCase(10, "My-Control-Key-10")] + public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlKey) + { + var expected = string.Format(DefaultURLPattern, tabId) + + string.Format(ControlKeyPattern, controlKey); + + var actual = _navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } + + [TestCase(0, "My-Control-Key-0")] + [TestCase(1, "My-Control-Key-1")] + [TestCase(2, "My-Control-Key-2")] + [TestCase(3, "My-Control-Key-3")] + [TestCase(4, "My-Control-Key-4")] + [TestCase(5, "My-Control-Key-5")] + [TestCase(6, "My-Control-Key-6")] + [TestCase(7, "My-Control-Key-7")] + [TestCase(8, "My-Control-Key-8")] + [TestCase(9, "My-Control-Key-9")] + [TestCase(10, "My-Control-Key-10")] + public void NavigateUrl_TabId_Settings_ControlKey(int tabId, string controlKey) + { + var mockSettings = new Mock(); + mockSettings + .Setup(x => x.ContentLocalizationEnabled) + .Returns(true); + + var expected = string.Format(DefaultURLPattern, tabId) + + string.Format(ControlKeyPattern, controlKey) + + string.Format(LanguagePattern, "en-US"); + + var actual = _navigationManager.NavigateURL(tabId, mockSettings.Object, controlKey, null); + + Assert.IsNotNull(actual); + Assert.AreEqual(expected, actual); + } } } From 5791d465a9eee2911a5bd12bb1c21811d6c0c8cd Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sun, 20 Oct 2019 00:24:40 -0400 Subject: [PATCH 43/44] Updated all INavigationManager references in .ascx.cs files to use private readonly since there should never be a child class --- .../Dnn.Modules.Console/ViewConsole.ascx.cs | 8 +++--- .../CreateModule.ascx.cs | 6 ++--- .../viewsource.ascx.cs | 10 +++---- .../admin/ControlPanel/AddModule.ascx.cs | 6 ++--- .../admin/ControlPanel/AddPage.ascx.cs | 6 ++--- .../admin/ControlPanel/ControlBar.ascx.cs | 26 +++++++++---------- .../admin/ControlPanel/UpdatePage.ascx.cs | 6 ++--- .../admin/ControlPanel/WebUpload.ascx.cs | 8 +++--- .../DigitalAssets/EditFolderMapping.ascx.cs | 6 ++--- .../DigitalAssets/FolderMappings.ascx.cs | 10 +++---- .../Modules/DigitalAssets/View.ascx.cs | 6 ++--- DNN Platform/Modules/Groups/Create.ascx.cs | 8 +++--- DNN Platform/Modules/Groups/GroupEdit.ascx.cs | 6 ++--- DNN Platform/Modules/Groups/List.ascx.cs | 6 ++--- DNN Platform/Modules/Groups/View.ascx.cs | 6 ++--- DNN Platform/Modules/HTML/EditHtml.ascx.cs | 8 +++--- DNN Platform/Modules/HTML/HtmlModule.ascx.cs | 6 ++--- DNN Platform/Modules/HTML/MyWork.ascx.cs | 8 +++--- DNN Platform/Modules/Journal/View.ascx.cs | 6 ++--- .../Modules/RazorHost/AddScript.ascx.cs | 6 ++--- .../Modules/RazorHost/CreateModule.ascx.cs | 14 +++++----- .../Modules/RazorHost/EditScript.ascx.cs | 8 +++--- .../Admin/Authentication/Login.ascx.cs | 20 +++++++------- .../AuthenticationEditor.ascx.cs | 6 ++--- .../Admin/EditExtension/EditExtension.ascx.cs | 6 ++--- .../Admin/Security/EditUser.ascx.cs | 14 +++++----- .../Admin/Security/ManageUsers.ascx.cs | 14 +++++----- .../Admin/Security/Membership.ascx.cs | 8 +++--- .../Admin/Security/ProfileDefinitions.ascx.cs | 8 +++--- .../Admin/Security/Register.ascx.cs | 12 ++++----- .../Admin/Security/SecurityRoles.ascx.cs | 10 +++---- .../UrlManagement/UrlProviderSettings.ascx.cs | 8 +++--- .../Admin/ViewProfile/ViewProfile.ascx.cs | 10 +++---- .../AuthenticationServices/DNN/Login.ascx.cs | 16 ++++++------ Website/admin/Modules/Export.ascx.cs | 6 ++--- Website/admin/Modules/Import.ascx.cs | 8 +++--- .../admin/Modules/ModulePermissions.ascx.cs | 6 ++--- Website/admin/Modules/Modulesettings.ascx.cs | 8 +++--- Website/admin/Modules/viewsource.ascx.cs | 6 ++--- Website/admin/Sales/Purchase.ascx.cs | 6 ++--- Website/admin/Security/PasswordReset.ascx.cs | 16 ++++++------ Website/admin/Security/SendPassword.ascx.cs | 12 ++++----- Website/admin/Skins/BreadCrumb.ascx.cs | 10 +++---- Website/admin/Skins/Login.ascx.cs | 6 ++--- Website/admin/Skins/Logo.ascx.cs | 6 ++--- Website/admin/Skins/Privacy.ascx.cs | 6 ++--- Website/admin/Skins/Search.ascx.cs | 12 ++++----- Website/admin/Skins/Terms.ascx.cs | 6 ++--- Website/admin/Skins/Toast.ascx.cs | 6 ++--- Website/admin/Skins/User.ascx.cs | 10 +++---- Website/admin/Skins/UserAndLogin.ascx.cs | 16 ++++++------ Website/admin/Skins/tags.ascx.cs | 6 ++--- Website/admin/Tabs/Export.ascx.cs | 6 ++--- Website/admin/Tabs/Import.ascx.cs | 10 +++---- 54 files changed, 240 insertions(+), 240 deletions(-) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs index 801904f3f31..85b87bbae4e 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs @@ -52,7 +52,7 @@ namespace Dnn.Modules.Console { public partial class ViewConsole : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (ViewConsole)); private ConsoleController _consoleCtrl; private string _defaultSize = string.Empty; @@ -62,7 +62,7 @@ public partial class ViewConsole : PortalModuleBase public ViewConsole() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Public Properties @@ -508,12 +508,12 @@ protected string GetHtml(TabInfo tab) var tabUrl = tab.FullUrl; if (ProfileUserId > -1) { - tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); + tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); } if (GroupId > -1) { - tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); + tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); } returnValue += string.Format(sb.ToString(), diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs index 2ec81de0f0d..ee5ef8e40bf 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs @@ -49,10 +49,10 @@ namespace Dnn.Module.ModuleCreator public partial class CreateModule : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public CreateModule() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Methods @@ -444,7 +444,7 @@ protected void cmdCreate_Click(object sender, EventArgs e) HostController.Instance.Update("Owner", txtOwner.Text, false); if (CreateModuleDefinition()) { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } else diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index 1dc83b91e8f..bcd1f10c0ac 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -48,10 +48,10 @@ namespace Dnn.Module.ModuleCreator { public partial class ViewSource : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ViewSource() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } @@ -74,7 +74,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } @@ -526,7 +526,7 @@ private void OnPackageClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(NavigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); + Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); } private void OnConfigureClick(object sender, EventArgs e) @@ -535,7 +535,7 @@ private void OnConfigureClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(NavigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); + Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); } private void OnCreateClick(object sender, EventArgs e) diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs index 27490b5bef5..71f0a2d82e0 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs @@ -60,13 +60,13 @@ namespace DotNetNuke.UI.ControlPanel { public partial class AddModule : UserControlBase, IDnnRibbonBarTool { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (AddModule)); private bool _enabled = true; public AddModule() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } /// @@ -169,7 +169,7 @@ protected override void OnLoad(EventArgs e) var objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); if (objModule != null) { - var strURL = NavigationManager.NavigateURL(objModule.TabID, true); + var strURL = _navigationManager.NavigateURL(objModule.TabID, true); hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; } else diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs index 575c92a071e..9c4cddbeb15 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs @@ -47,10 +47,10 @@ namespace DotNetNuke.UI.ControlPanel public partial class AddPage : UserControl, IDnnRibbonBarTool { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public AddPage() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Event Handlers" @@ -124,7 +124,7 @@ protected void CmdAddPageClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(NavigationManager.NavigateURL(newTab.TabID)); + Response.Redirect(_navigationManager.NavigateURL(newTab.TabID)); } else { diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs index 666c48fa7eb..ed3ef32c5f4 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs @@ -63,10 +63,10 @@ namespace DotNetNuke.UI.ControlPanels { public partial class ControlBar : ControlPanelBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ControlBar() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } private readonly IList _adminCommonTabs = new List { "Site Settings", @@ -317,61 +317,61 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri case "PageSettings": if (TabPermissionController.CanManagePage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); } break; case "CopyPage": if (TabPermissionController.CanCopyPage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); } break; case "DeletePage": if (TabPermissionController.CanDeletePage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); } break; case "PageTemplate": if (TabPermissionController.CanManagePage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); } break; case "PageLocalization": if (TabPermissionController.CanManagePage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); } break; case "PagePermission": if (TabPermissionController.CanAdminPage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); } break; case "ImportPage": if (TabPermissionController.CanImportPage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); } break; case "ExportPage": if (TabPermissionController.CanExportPage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); } break; case "NewPage": if (TabPermissionController.CanAddPage()) { - returnValue = NavigationManager.NavigateURL("Tab", "activeTab=settingTab"); + returnValue = _navigationManager.NavigateURL("Tab", "activeTab=settingTab"); } break; case "PublishPage": if (TabPermissionController.CanAdminPage()) { - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID); + returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID); } break; default: @@ -413,7 +413,7 @@ protected string GetTabURL(List additionalParams, string toolName, bool } string currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; - strURL = NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); + strURL = _navigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); } return strURL; diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs index 2f72a432d9b..f30de71e5f9 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs @@ -49,10 +49,10 @@ namespace DotNetNuke.UI.ControlPanel public partial class UpdatePage : UserControl, IDnnRibbonBarTool { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public UpdatePage() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Event Handlers" @@ -135,7 +135,7 @@ protected void CmdUpdateClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(NavigationManager.NavigateURL(tab.TabID)); + Response.Redirect(_navigationManager.NavigateURL(tab.TabID)); } else { diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs index 21db386e455..3bce79d5c05 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs @@ -62,10 +62,10 @@ namespace DotNetNuke.Modules.Admin.FileManager public partial class WebUpload : PortalModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (WebUpload)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public WebUpload() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region "Members" @@ -192,7 +192,7 @@ private void CheckSecurity() { if (!ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "CONTENT,EDIT") && !UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators")) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } } @@ -243,7 +243,7 @@ public string ReturnURL() { TabID = int.Parse(Request.Params["rtab"]); } - return NavigationManager.NavigateURL(TabID); + return _navigationManager.NavigateURL(TabID); } protected override void OnInit(EventArgs e) diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index 8e5d2496524..87dbece2f5b 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -37,10 +37,10 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class EditFolderMapping : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public EditFolderMapping() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Variables @@ -209,7 +209,7 @@ private void cmdUpdate_Click(object sender, EventArgs e) } if (!Response.IsRequestBeingRedirected) - Response.Redirect(NavigationManager.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); + Response.Redirect(_navigationManager.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index 32737ae8959..fdf5c30031c 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -40,10 +40,10 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class FolderMappings : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public FolderMappings() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Variables @@ -110,7 +110,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); - CancelButton.NavigateUrl = NavigationManager.NavigateURL(); + CancelButton.NavigateUrl = _navigationManager.NavigateURL(); NewMappingButton.Click += OnNewMappingClick; if (!IsPostBack) @@ -128,7 +128,7 @@ protected void MappingsGrid_OnItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == "Edit") { - Response.Redirect(NavigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); + Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); } else { @@ -181,7 +181,7 @@ protected void OnNewMappingClick(object sender, EventArgs e) { try { - Response.Redirect(NavigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); + Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index a3867f52de1..5c9a59b8868 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -66,11 +66,11 @@ public partial class View : PortalModuleBase, IActionable private readonly ExtensionPointManager epm = new ExtensionPointManager(); private NameValueCollection damState; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public View() { controller = new Factory().DigitalAssetsController; - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } private IExtensionPointFilter Filter @@ -143,7 +143,7 @@ protected string NavigateUrl { get { - var url = NavigationManager.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(NavigationManager.NavigateURL())); + var url = _navigationManager.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(_navigationManager.NavigateURL())); //append popUp parameter var delimiter = url.Contains("?") ? "&" : "?"; diff --git a/DNN Platform/Modules/Groups/Create.ascx.cs b/DNN Platform/Modules/Groups/Create.ascx.cs index 7598c416f3b..e1c79c7cffb 100644 --- a/DNN Platform/Modules/Groups/Create.ascx.cs +++ b/DNN Platform/Modules/Groups/Create.ascx.cs @@ -18,10 +18,10 @@ namespace DotNetNuke.Modules.Groups public partial class Create : GroupsModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Create() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) { @@ -115,7 +115,7 @@ private void Create_Click(object sender, EventArgs e) roleInfo.RoleID = RoleController.Instance.AddRole(roleInfo); roleInfo = RoleController.Instance.GetRoleById(PortalId, roleInfo.RoleID); - var groupUrl = NavigationManager.NavigateURL(GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); + var groupUrl = _navigationManager.NavigateURL(GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); if (groupUrl.StartsWith("http://") || groupUrl.StartsWith("https://")) { const int startIndex = 8; // length of https:// @@ -165,7 +165,7 @@ private void Create_Click(object sender, EventArgs e) GroupUtilities.CreateJournalEntry(roleInfo, UserInfo); } - Response.Redirect(NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() })); + Response.Redirect(_navigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() })); } } } diff --git a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs index 19143db9181..213e5ce99c1 100644 --- a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs @@ -12,10 +12,10 @@ namespace DotNetNuke.Modules.Groups { public partial class GroupEdit : GroupsModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public GroupEdit() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) @@ -149,7 +149,7 @@ private void Save_Click(object sender, EventArgs e) } - Response.Redirect(NavigationManager.NavigateURL(TabId, "", new String[] { "groupid=" + GroupId.ToString() })); + Response.Redirect(_navigationManager.NavigateURL(TabId, "", new String[] { "groupid=" + GroupId.ToString() })); } } } diff --git a/DNN Platform/Modules/Groups/List.ascx.cs b/DNN Platform/Modules/Groups/List.ascx.cs index 04eef1d6022..ddc0db3b85e 100644 --- a/DNN Platform/Modules/Groups/List.ascx.cs +++ b/DNN Platform/Modules/Groups/List.ascx.cs @@ -8,10 +8,10 @@ namespace DotNetNuke.Modules.Groups { public partial class List : GroupsModuleBase { - public INavigationManager NavigationManager { get; } + public INavigationManager _navigationManager { get; } public List() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } protected void Page_Load(object sender, EventArgs e) { @@ -55,7 +55,7 @@ protected void btnSearch_Click(object sender, EventArgs e) { if(!Page.IsValid) return; - Response.Redirect(NavigationManager.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); + Response.Redirect(_navigationManager.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); } } } diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index ff46dd1ad59..3670b90c70a 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -48,10 +48,10 @@ namespace DotNetNuke.Modules.Groups /// ----------------------------------------------------------------------------- public partial class View : GroupsModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public View() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Event Handlers @@ -80,7 +80,7 @@ private void Page_Load(object sender, EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); if (GroupId < 0) { if (TabId != GroupListTabId && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) { - Response.Redirect(NavigationManager.NavigateURL(GroupListTabId)); + Response.Redirect(_navigationManager.NavigateURL(GroupListTabId)); } } GroupsModuleBase ctl = (GroupsModuleBase)LoadControl(ControlPath); diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index f1ff747c6e4..72029ba0bb9 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -53,10 +53,10 @@ namespace DotNetNuke.Modules.Html /// public partial class EditHtml : HtmlModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public EditHtml() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -442,7 +442,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - hlCancel.NavigateUrl = NavigationManager.NavigateURL(); + hlCancel.NavigateUrl = _navigationManager.NavigateURL(); cmdEdit.Click += OnEditClick; cmdPreview.Click += OnPreviewClick; @@ -590,7 +590,7 @@ protected void OnSaveClick(object sender, EventArgs e) // redirect back to portal if (redirect) { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } protected void OnEditClick(object sender, EventArgs e) diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index 3a2c1466014..43e7a09df8b 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -54,10 +54,10 @@ public partial class HtmlModule : HtmlModuleBase, IActionable private bool EditorEnabled; private int WorkflowID; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public HtmlModule() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region "Private Methods" @@ -270,7 +270,7 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); // refresh page - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } } diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index 98ab54f0cc7..b801ccef5ff 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -39,10 +39,10 @@ namespace DotNetNuke.Modules.Html /// public partial class MyWork : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public MyWork() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Protected Methods @@ -50,7 +50,7 @@ public MyWork() public string FormatURL(object dataItem) { var objHtmlTextUser = (HtmlTextUserInfo) dataItem; - return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; + return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; } #endregion @@ -65,7 +65,7 @@ public string FormatURL(object dataItem) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - hlCancel.NavigateUrl = NavigationManager.NavigateURL(); + hlCancel.NavigateUrl = _navigationManager.NavigateURL(); try { diff --git a/DNN Platform/Modules/Journal/View.ascx.cs b/DNN Platform/Modules/Journal/View.ascx.cs index cf0ca733254..b2770de2740 100644 --- a/DNN Platform/Modules/Journal/View.ascx.cs +++ b/DNN Platform/Modules/Journal/View.ascx.cs @@ -34,7 +34,7 @@ namespace DotNetNuke.Modules.Journal { /// ----------------------------------------------------------------------------- public partial class View : JournalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public int PageSize = 20; public bool AllowPhotos = true; public bool AllowFiles = true; @@ -52,7 +52,7 @@ public partial class View : JournalModuleBase { public View() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Event Handlers @@ -188,7 +188,7 @@ private void Page_Load(object sender, EventArgs e) { BaseUrl = BaseUrl.EndsWith("/") ? BaseUrl : BaseUrl + "/"; BaseUrl += "DesktopModules/Journal/"; - ProfilePage = NavigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); + ProfilePage = _navigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); if (!String.IsNullOrEmpty(Request.QueryString["userId"])) { diff --git a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs index 5663c0937bc..df1f1769c79 100644 --- a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs @@ -38,11 +38,11 @@ namespace DotNetNuke.Modules.RazorHost public partial class AddScript : ModuleUserControlBase { private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public AddScript() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void DisplayExtension() @@ -88,7 +88,7 @@ protected void cmdAdd_Click(object sender, EventArgs e) { if (!ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } if (Page.IsValid) diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index 7b39c859e63..35fdefa25ab 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -48,14 +48,14 @@ namespace DotNetNuke.Modules.RazorHost public partial class CreateModule : ModuleUserControlBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(CreateModule)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; private string razorScriptFolder = "~/DesktopModules/RazorModules/RazorHost/Scripts/"; public CreateModule() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -191,7 +191,7 @@ private void Create() objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - Response.Redirect(NavigationManager.NavigateURL(newTab.TabID), true); + Response.Redirect(_navigationManager.NavigateURL(newTab.TabID), true); } else { @@ -201,7 +201,7 @@ private void Create() else { //Redirect to main extensions page - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } @@ -295,7 +295,7 @@ protected override void OnLoad(EventArgs e) if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } if (! Page.IsPostBack) @@ -309,7 +309,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -323,7 +323,7 @@ private void cmdCreate_Click(object sender, EventArgs e) { if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } if (Page.IsValid) diff --git a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs index fb3b4edb93b..2be14921210 100644 --- a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs @@ -40,13 +40,13 @@ namespace DotNetNuke.Modules.RazorHost [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public partial class EditScript : ModuleUserControlBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; private string razorScriptFolder = "~/DesktopModules/RazorModules/RazorHost/Scripts/"; public EditScript() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -145,7 +145,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -170,7 +170,7 @@ private void cmdSaveClose_Click(object sender, EventArgs e) try { SaveScript(); - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { diff --git a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs index a9d8293e248..de070a8b49e 100644 --- a/Website/DesktopModules/Admin/Authentication/Login.ascx.cs +++ b/Website/DesktopModules/Admin/Authentication/Login.ascx.cs @@ -72,14 +72,14 @@ namespace DotNetNuke.Modules.Admin.Authentication public partial class Login : UserModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(Login)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private static readonly Regex UserLanguageRegex = new Regex("(.*)(&|\\?)(language=)([^&\\?]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); public Login() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -221,19 +221,19 @@ protected string RedirectURL && Convert.ToInt32(setting) != Null.NullInteger ) { - redirectURL = NavigationManager.NavigateURL(Convert.ToInt32(setting)); + redirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); } else { if (PortalSettings.LoginTabId != -1 && PortalSettings.HomeTabId != -1) { //redirect to portal home page specified - redirectURL = NavigationManager.NavigateURL(PortalSettings.HomeTabId); + redirectURL = _navigationManager.NavigateURL(PortalSettings.HomeTabId); } else { //redirect to current page - redirectURL = NavigationManager.NavigateURL(); + redirectURL = _navigationManager.NavigateURL(); } } @@ -547,7 +547,7 @@ private void BindRegister() //Verify that the current user has access to this page if (PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && Request.IsAuthenticated == false) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } lblRegisterHelp.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); switch (PortalSettings.UserRegistration) @@ -978,7 +978,7 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) // Use the reset password token to identify the user during the redirect UserController.ResetPasswordToken(objUser); objUser = UserController.GetUserById(objUser.PortalID, objUser.UserID); - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.DataConsentConsentRedirect, "", string.Format("token={0}", objUser.PasswordResetToken))); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.DataConsentConsentRedirect, "", string.Format("token={0}", objUser.PasswordResetToken))); } break; } @@ -1078,7 +1078,7 @@ protected override void OnLoad(EventArgs e) { parameters[2] = "verificationcode=" + HttpUtility.UrlEncode(Request.QueryString["verificationcode"]); } - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.LoginTabId, "", parameters)); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.LoginTabId, "", parameters)); } } if (Page.IsPostBack == false) @@ -1108,7 +1108,7 @@ protected override void OnLoad(EventArgs e) else //make module container invisible if user is not a page admin { var path = RedirectURL.Split('?')[0]; - if (NeedRedirectAfterLogin && path != NavigationManager.NavigateURL() && path != NavigationManager.NavigateURL(PortalSettings.HomeTabId)) + if (NeedRedirectAfterLogin && path != _navigationManager.NavigateURL() && path != _navigationManager.NavigateURL(PortalSettings.HomeTabId)) { Response.Redirect(RedirectURL, true); } @@ -1249,7 +1249,7 @@ protected void DataConsentCompleted(object sender, DataConsent.DataConsentEventA break; case DataConsent.DataConsentStatus.Cancelled: case DataConsent.DataConsentStatus.RemovedAccount: - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.HomeTabId), true); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.HomeTabId), true); break; case DataConsent.DataConsentStatus.FailedToRemoveAccount: AddModuleMessage("FailedToRemoveAccount", ModuleMessage.ModuleMessageType.RedError, true); diff --git a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs index d7795eb3e90..32999789140 100644 --- a/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs @@ -42,11 +42,11 @@ namespace DotNetNuke.Modules.Admin.EditExtension /// ----------------------------------------------------------------------------- public partial class AuthenticationEditor : PackageEditorBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public AuthenticationEditor() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Private Members" @@ -191,7 +191,7 @@ protected void cmdUpdate_Click(object sender, EventArgs e) var displayMode = DisplayMode; if (displayMode != "editor" && displayMode != "settings") - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } #endregion diff --git a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs index 42aeb28377b..ea903e93b75 100644 --- a/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs +++ b/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs @@ -54,13 +54,13 @@ namespace DotNetNuke.Modules.Admin.EditExtension /// public partial class EditExtension : ModuleUserControlBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private Control _control; private PackageInfo _package; public EditExtension() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool IsSuperTab @@ -282,7 +282,7 @@ protected override void OnLoad(EventArgs e) if (!IsPostBack) { - ReturnUrl = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : NavigationManager.NavigateURL(); + ReturnUrl = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : _navigationManager.NavigateURL(); switch (DisplayMode) { case "editor": diff --git a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs index 4fbd15f48b4..9f41a31fb4a 100644 --- a/Website/DesktopModules/Admin/Security/EditUser.ascx.cs +++ b/Website/DesktopModules/Admin/Security/EditUser.ascx.cs @@ -57,11 +57,11 @@ namespace DotNetNuke.Modules.Admin.Users public partial class EditUser : UserModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(EditUser)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public EditUser() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Protected Members @@ -110,12 +110,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = NavigationManager.NavigateURL(); + _RedirectURL = _navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = NavigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); + _RedirectURL = _navigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); } return _RedirectURL; } @@ -129,7 +129,7 @@ protected string ReturnUrl { get { - return NavigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); + return _navigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); } } @@ -321,7 +321,7 @@ private bool VerifyUserPermissions() if (!PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName)) { //Display current user's profile - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); } } else @@ -484,7 +484,7 @@ protected void cmdDelete_Click(object sender, EventArgs e) //DNN-26777 PortalSecurity.Instance.SignOut(); - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.HomeTabId)); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.HomeTabId)); } protected void cmdUpdate_Click(object sender, EventArgs e) diff --git a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs index a39b3b2caf6..84ec13b3992 100644 --- a/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs @@ -56,10 +56,10 @@ namespace DotNetNuke.Modules.Admin.Users /// public partial class ManageUsers : UserModuleBase, IActionable { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ManageUsers() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Protected Members @@ -108,12 +108,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = NavigationManager.NavigateURL(); + _RedirectURL = _navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = NavigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); + _RedirectURL = _navigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); } return _RedirectURL; } @@ -127,7 +127,7 @@ protected string ReturnUrl { get { - return NavigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); + return _navigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); } } @@ -351,7 +351,7 @@ private bool VerifyUserPermissions() if (HasManageUsersModulePermission() == false) { //Display current user's profile - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); } } } @@ -592,7 +592,7 @@ protected override void OnLoad(EventArgs e) protected void cmdCancel_Click(object sender, EventArgs e) { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } private bool HasManageUsersModulePermission() diff --git a/Website/DesktopModules/Admin/Security/Membership.ascx.cs b/Website/DesktopModules/Admin/Security/Membership.ascx.cs index 1314db20f34..e4161022376 100644 --- a/Website/DesktopModules/Admin/Security/Membership.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Membership.ascx.cs @@ -51,10 +51,10 @@ namespace DotNetNuke.Modules.Admin.Users /// ----------------------------------------------------------------------------- public partial class Membership : UserModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Membership() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region "Public Properties" @@ -112,7 +112,7 @@ public void OnMembershipPromoteToSuperuser(EventArgs e) if (MembershipPromoteToSuperuser != null) { MembershipPromoteToSuperuser(this, e); - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } @@ -130,7 +130,7 @@ public void OnMembershipDemoteFromSuperuser(EventArgs e) if (MembershipDemoteFromSuperuser != null) { MembershipDemoteFromSuperuser(this, e); - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } diff --git a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs index 74ba3c6014f..48db2f20047 100644 --- a/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs +++ b/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs @@ -52,10 +52,10 @@ namespace DotNetNuke.Modules.Admin.Users /// ----------------------------------------------------------------------------- public partial class ProfileDefinitions : PortalModuleBase, IActionable { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ProfileDefinitions() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Constants @@ -125,11 +125,11 @@ public string ReturnUrl } if (string.IsNullOrEmpty(Request.QueryString["filter"])) { - returnURL = NavigationManager.NavigateURL(TabId); + returnURL = _navigationManager.NavigateURL(TabId); } else { - returnURL = NavigationManager.NavigateURL(TabId, "", filterParams); + returnURL = _navigationManager.NavigateURL(TabId, "", filterParams); } return returnURL; } diff --git a/Website/DesktopModules/Admin/Security/Register.ascx.cs b/Website/DesktopModules/Admin/Security/Register.ascx.cs index f36e868bbda..54a36f8001e 100644 --- a/Website/DesktopModules/Admin/Security/Register.ascx.cs +++ b/Website/DesktopModules/Admin/Security/Register.ascx.cs @@ -67,11 +67,11 @@ public partial class Register : UserUserControlBase protected const string ConfirmPasswordTextBoxCssClass = "password-confirm"; private readonly List _loginControls = new List(); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Register() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -251,7 +251,7 @@ protected override void OnInit(EventArgs e) { try { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } catch (ThreadAbortException) { @@ -301,7 +301,7 @@ protected override void OnLoad(EventArgs e) if (Globals.IsAdminControl()) { //redirect to current page - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } else //make module container invisible if user is not a page admin { @@ -789,7 +789,7 @@ private string GetRedirectUrl(bool checkSetting = true) var redirectAfterRegistration = PortalSettings.Registration.RedirectAfterRegistration; if (checkSetting && redirectAfterRegistration > 0) //redirect to after registration page { - redirectUrl = NavigationManager.NavigateURL(redirectAfterRegistration); + redirectUrl = _navigationManager.NavigateURL(redirectAfterRegistration); } else { @@ -814,7 +814,7 @@ private string GetRedirectUrl(bool checkSetting = true) if (String.IsNullOrEmpty(redirectUrl)) { //redirect to current page - redirectUrl = NavigationManager.NavigateURL(); + redirectUrl = _navigationManager.NavigateURL(); } } diff --git a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs index 42e5d51eae3..59b824bf9de 100644 --- a/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs +++ b/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs @@ -61,7 +61,7 @@ namespace DotNetNuke.Modules.Admin.Security public partial class SecurityRoles : PortalModuleBase, IActionable { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (SecurityRoles)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; #region "Private Members" private int RoleId = Null.NullInteger; @@ -77,7 +77,7 @@ public partial class SecurityRoles : PortalModuleBase, IActionable public SecurityRoles() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region "Protected Members" @@ -107,11 +107,11 @@ protected string ReturnUrl } if (string.IsNullOrEmpty(Request.QueryString["filter"])) { - _ReturnURL = NavigationManager.NavigateURL(TabId); + _ReturnURL = _navigationManager.NavigateURL(TabId); } else { - _ReturnURL = NavigationManager.NavigateURL(TabId, "", FilterParams); + _ReturnURL = _navigationManager.NavigateURL(TabId, "", FilterParams); } return _ReturnURL; } @@ -444,7 +444,7 @@ public override void DataBind() { if (!ModulePermissionController.CanEditModuleContent(ModuleConfiguration)) { - Response.Redirect(NavigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); } base.DataBind(); diff --git a/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs b/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs index fe834f5ce03..45ba0e12484 100644 --- a/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs +++ b/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs @@ -21,11 +21,11 @@ public partial class ProviderSettings : ModuleUserControlBase private int _providerId; private IExtensionUrlProviderSettingsControl _providerSettingsControl; private string DisplayMode => (Request.QueryString["Display"] ?? "").ToLowerInvariant(); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ProviderSettings() { - NavigationManager = Globals.DependencyProvider.GetService(); + _navigationManager = Globals.DependencyProvider.GetService(); } protected override void OnInit(EventArgs e) @@ -74,7 +74,7 @@ protected override void OnLoad(EventArgs e) void cmdCancel_Click(object sender, EventArgs e) { - Response.Redirect(NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); + Response.Redirect(_navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); } void cmdUpdate_Click(object sender, EventArgs e) @@ -95,7 +95,7 @@ void cmdUpdate_Click(object sender, EventArgs e) if (DisplayMode != "editor" && DisplayMode != "settings") { - Response.Redirect(NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); + Response.Redirect(_navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); } } } diff --git a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs index 97613059938..30cdd438444 100644 --- a/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs +++ b/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs @@ -49,10 +49,10 @@ namespace DotNetNuke.Modules.Admin.ViewProfile /// public partial class ViewProfile : ProfileModuleUserControlBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ViewProfile() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } public override bool DisplayModule @@ -119,8 +119,8 @@ protected override void OnLoad(EventArgs e) { template = Localization.GetString("DefaultTemplate", LocalResourceFile); } - var editUrl = NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=1"); - var profileUrl = NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=2"); + var editUrl = _navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=1"); + var profileUrl = _navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=2"); if (template.Contains("[BUTTON:EDITPROFILE]")) { @@ -254,7 +254,7 @@ private string GetRedirectUrl() if (homeTabId > Null.NullInteger) { - redirectUrl = NavigationManager.NavigateURL(homeTabId); + redirectUrl = _navigationManager.NavigateURL(homeTabId); } else { diff --git a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs index f4190426d92..bdd17b2dc08 100644 --- a/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs +++ b/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs @@ -51,11 +51,11 @@ namespace DotNetNuke.Modules.Admin.Authentication.DNN public partial class Login : AuthenticationLoginBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (Login)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Login() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -114,7 +114,7 @@ protected override void OnLoad(EventArgs e) DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetSystemMessage(PortalSettings, "MESSAGE_USERNAME_CHANGED_INSTRUCTIONS"), ModuleMessage.ModuleMessageType.BlueInfo); } - var returnUrl = NavigationManager.NavigateURL(); + var returnUrl = _navigationManager.NavigateURL(); string url; if (PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { @@ -145,7 +145,7 @@ protected override void OnLoad(EventArgs e) // no need to show password link if feature is disabled, let's check this first if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { - url = NavigationManager.NavigateURL("SendPassword", "returnurl=" + returnUrl); + url = _navigationManager.NavigateURL("SendPassword", "returnurl=" + returnUrl); passwordLink.NavigateUrl = url; if (PortalSettings.EnablePopUps) { @@ -178,13 +178,13 @@ protected override void OnLoad(EventArgs e) if (Request.IsAuthenticated) { - Response.Redirect(NavigationManager.NavigateURL(redirectTabId > 0 ? redirectTabId : PortalSettings.HomeTabId, string.Empty, "VerificationSuccess=true"), true); + Response.Redirect(_navigationManager.NavigateURL(redirectTabId > 0 ? redirectTabId : PortalSettings.HomeTabId, string.Empty, "VerificationSuccess=true"), true); } else { if (redirectTabId > 0) { - var redirectUrl = NavigationManager.NavigateURL(redirectTabId, string.Empty, "VerificationSuccess=true"); + var redirectUrl = _navigationManager.NavigateURL(redirectTabId, string.Empty, "VerificationSuccess=true"); redirectUrl = redirectUrl.Replace(Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), string.Empty); Response.Cookies.Add(new HttpCookie("returnurl", redirectUrl) { Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }); } @@ -333,7 +333,7 @@ protected string GetRedirectUrl(bool checkSettings = true) var redirectAfterLogin = PortalSettings.Registration.RedirectAfterLogin; if (checkSettings && redirectAfterLogin > 0) //redirect to after registration page { - redirectUrl = NavigationManager.NavigateURL(redirectAfterLogin); + redirectUrl = _navigationManager.NavigateURL(redirectAfterLogin); } else { @@ -358,7 +358,7 @@ protected string GetRedirectUrl(bool checkSettings = true) if (String.IsNullOrEmpty(redirectUrl)) { //redirect to current page - redirectUrl = NavigationManager.NavigateURL(); + redirectUrl = _navigationManager.NavigateURL(); } } diff --git a/Website/admin/Modules/Export.ascx.cs b/Website/admin/Modules/Export.ascx.cs index dec606fe4e8..ea365f3b2d3 100644 --- a/Website/admin/Modules/Export.ascx.cs +++ b/Website/admin/Modules/Export.ascx.cs @@ -56,10 +56,10 @@ namespace DotNetNuke.Modules.Admin.Modules /// ----------------------------------------------------------------------------- public partial class Export : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Export() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -79,7 +79,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } diff --git a/Website/admin/Modules/Import.ascx.cs b/Website/admin/Modules/Import.ascx.cs index db78cf4e81f..7fb48e63d0c 100644 --- a/Website/admin/Modules/Import.ascx.cs +++ b/Website/admin/Modules/Import.ascx.cs @@ -50,10 +50,10 @@ namespace DotNetNuke.Modules.Admin.Modules { public partial class Import : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Import() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -73,7 +73,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } @@ -119,7 +119,7 @@ private string ImportModule() { ModuleController.DeserializeModule(xmlDoc.DocumentElement, Module, PortalId, TabId); } - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } else { diff --git a/Website/admin/Modules/ModulePermissions.ascx.cs b/Website/admin/Modules/ModulePermissions.ascx.cs index c1b9d335424..dbe114e76bf 100644 --- a/Website/admin/Modules/ModulePermissions.ascx.cs +++ b/Website/admin/Modules/ModulePermissions.ascx.cs @@ -48,10 +48,10 @@ namespace DotNetNuke.Modules.Admin.Modules /// public partial class ModulePermissions : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ModulePermissions() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -68,7 +68,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } diff --git a/Website/admin/Modules/Modulesettings.ascx.cs b/Website/admin/Modules/Modulesettings.ascx.cs index 0b8e10f1bec..47876a99da6 100644 --- a/Website/admin/Modules/Modulesettings.ascx.cs +++ b/Website/admin/Modules/Modulesettings.ascx.cs @@ -63,10 +63,10 @@ namespace DotNetNuke.Modules.Admin.Modules public partial class ModuleSettingsPage : PortalModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(ModuleSettingsPage)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ModuleSettingsPage() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -96,7 +96,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } @@ -267,7 +267,7 @@ protected string GetInstalledOnLink(object dataItem) PortalAlias = defaultAlias }; - var tabUrl = NavigationManager.NavigateURL(tab.TabID, portalSettings, string.Empty); + var tabUrl = _navigationManager.NavigateURL(tab.TabID, portalSettings, string.Empty); foreach (TabInfo t in tab.BreadCrumbs) { diff --git a/Website/admin/Modules/viewsource.ascx.cs b/Website/admin/Modules/viewsource.ascx.cs index 870b25143f3..bb62f001089 100644 --- a/Website/admin/Modules/viewsource.ascx.cs +++ b/Website/admin/Modules/viewsource.ascx.cs @@ -38,10 +38,10 @@ namespace DotNetNuke.Modules.Admin.Modules { public partial class ViewSource : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public ViewSource() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -71,7 +71,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? NavigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); } } diff --git a/Website/admin/Sales/Purchase.ascx.cs b/Website/admin/Sales/Purchase.ascx.cs index 1fc5abe952c..90045b808d4 100644 --- a/Website/admin/Sales/Purchase.ascx.cs +++ b/Website/admin/Sales/Purchase.ascx.cs @@ -45,12 +45,12 @@ namespace DotNetNuke.Modules.Admin.Sales public partial class Purchase : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private int RoleID = -1; public Purchase() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -121,7 +121,7 @@ protected override void OnLoad(EventArgs e) } else //security violation attempt to access item not related to this Module { - Response.Redirect(NavigationManager.NavigateURL(), true); + Response.Redirect(_navigationManager.NavigateURL(), true); } } diff --git a/Website/admin/Security/PasswordReset.ascx.cs b/Website/admin/Security/PasswordReset.ascx.cs index cd2cee47975..ea20af692f5 100644 --- a/Website/admin/Security/PasswordReset.ascx.cs +++ b/Website/admin/Security/PasswordReset.ascx.cs @@ -51,10 +51,10 @@ namespace DotNetNuke.Modules.Admin.Security public partial class PasswordReset : UserModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public PasswordReset() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -93,11 +93,11 @@ protected override void OnLoad(EventArgs e) if (PortalSettings.LoginTabId != -1 && PortalSettings.ActiveTab.TabID != PortalSettings.LoginTabId) { - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.LoginTabId) + Request.Url.Query); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.LoginTabId) + Request.Url.Query); } cmdChangePassword.Click +=cmdChangePassword_Click; - hlCancel.NavigateUrl = NavigationManager.NavigateURL(); + hlCancel.NavigateUrl = _navigationManager.NavigateURL(); if (Request.QueryString["resetToken"] != null) { @@ -272,7 +272,7 @@ private void cmdChangePassword_Click(object sender, EventArgs e) { LogSuccess(); ViewState.Add("PageNo", 3); - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Login")); + Response.Redirect(_navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Login")); } else { @@ -315,18 +315,18 @@ protected void RedirectAfterLogin() if (PortalSettings.RegisterTabId != -1 && PortalSettings.HomeTabId != -1) { //redirect to portal home page specified - redirectURL = NavigationManager.NavigateURL(PortalSettings.HomeTabId); + redirectURL = _navigationManager.NavigateURL(PortalSettings.HomeTabId); } else { //redirect to current page - redirectURL = NavigationManager.NavigateURL(); + redirectURL = _navigationManager.NavigateURL(); } } } else //redirect to after login page { - redirectURL = NavigationManager.NavigateURL(Convert.ToInt32(setting)); + redirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); } AddModuleMessage("ChangeSuccessful", ModuleMessage.ModuleMessageType.GreenSuccess, true); diff --git a/Website/admin/Security/SendPassword.ascx.cs b/Website/admin/Security/SendPassword.ascx.cs index 34640ce452a..e5136bdce1f 100644 --- a/Website/admin/Security/SendPassword.ascx.cs +++ b/Website/admin/Security/SendPassword.ascx.cs @@ -57,10 +57,10 @@ namespace DotNetNuke.Modules.Admin.Security public partial class SendPassword : UserModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (SendPassword)); - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public SendPassword() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } #region Private Members @@ -86,7 +86,7 @@ protected string RedirectURL if (Convert.ToInt32(setting) > 0) //redirect to after registration page { - _RedirectURL = NavigationManager.NavigateURL(Convert.ToInt32(setting)); + _RedirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); } else { @@ -114,12 +114,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = NavigationManager.NavigateURL(); + _RedirectURL = _navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = NavigationManager.NavigateURL(Convert.ToInt32(setting)); + _RedirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); } } @@ -230,7 +230,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); cmdSendPassword.Click += OnSendPasswordClick; - lnkCancel.NavigateUrl = NavigationManager.NavigateURL(); + lnkCancel.NavigateUrl = _navigationManager.NavigateURL(); _ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); diff --git a/Website/admin/Skins/BreadCrumb.ascx.cs b/Website/admin/Skins/BreadCrumb.ascx.cs index b24391202e3..05c5aff7a6d 100644 --- a/Website/admin/Skins/BreadCrumb.ascx.cs +++ b/Website/admin/Skins/BreadCrumb.ascx.cs @@ -48,10 +48,10 @@ public partial class BreadCrumb : SkinObjectBase private readonly StringBuilder _breadcrumb = new StringBuilder(""); private string _homeUrl = ""; private string _homeTabName = "Root"; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public BreadCrumb() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } // Separator between breadcrumb elements @@ -135,7 +135,7 @@ protected override void OnLoad(EventArgs e) // Make sure we have a home tab ID set if (PortalSettings.HomeTabId != -1) { - _homeUrl = NavigationManager.NavigateURL(PortalSettings.HomeTabId); + _homeUrl = _navigationManager.NavigateURL(PortalSettings.HomeTabId); var tc = new TabController(); var homeTab = tc.GetTab(PortalSettings.HomeTabId, PortalSettings.PortalId, false); @@ -184,13 +184,13 @@ protected override void OnLoad(EventArgs e) // if (ProfileUserId > -1) { - tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId); + tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId); } // if (GroupId > -1) { - tabUrl = NavigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId); + tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId); } // Begin breadcrumb diff --git a/Website/admin/Skins/Login.ascx.cs b/Website/admin/Skins/Login.ascx.cs index 02f056ade72..00537db1ebe 100644 --- a/Website/admin/Skins/Login.ascx.cs +++ b/Website/admin/Skins/Login.ascx.cs @@ -42,10 +42,10 @@ namespace DotNetNuke.UI.Skins.Controls /// ----------------------------------------------------------------------------- public partial class Login : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Login() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); LegacyMode = true; } @@ -127,7 +127,7 @@ protected override void OnLoad(EventArgs e) loginLink.ToolTip = loginLink.Text; enhancedLoginLink.ToolTip = loginLink.Text; } - loginLink.NavigateUrl = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); + loginLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); enhancedLoginLink.NavigateUrl = loginLink.NavigateUrl; } else diff --git a/Website/admin/Skins/Logo.ascx.cs b/Website/admin/Skins/Logo.ascx.cs index 81f8259583a..9e9cb98d8d3 100644 --- a/Website/admin/Skins/Logo.ascx.cs +++ b/Website/admin/Skins/Logo.ascx.cs @@ -42,13 +42,13 @@ namespace DotNetNuke.UI.Skins.Controls /// ----------------------------------------------------------------------------- public partial class Logo : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public string BorderWidth { get; set; } public string CssClass { get; set; } public Logo() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected override void OnLoad(EventArgs e) @@ -88,7 +88,7 @@ protected override void OnLoad(EventArgs e) } if (PortalSettings.HomeTabId != -1) { - hypLogo.NavigateUrl = NavigationManager.NavigateURL(PortalSettings.HomeTabId); + hypLogo.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.HomeTabId); } else { diff --git a/Website/admin/Skins/Privacy.ascx.cs b/Website/admin/Skins/Privacy.ascx.cs index 9968e44bc3b..7eeef29629b 100644 --- a/Website/admin/Skins/Privacy.ascx.cs +++ b/Website/admin/Skins/Privacy.ascx.cs @@ -39,7 +39,7 @@ namespace DotNetNuke.UI.Skins.Controls /// ----------------------------------------------------------------------------- public partial class Privacy : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private const string MyFileName = "Privacy.ascx"; public string Text { get; set; } @@ -47,7 +47,7 @@ public partial class Privacy : SkinObjectBase public Privacy() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -78,7 +78,7 @@ protected override void OnLoad(EventArgs e) { hypPrivacy.Text = Localization.GetString("Privacy", Localization.GetResourceFile(this, MyFileName)); } - hypPrivacy.NavigateUrl = PortalSettings.PrivacyTabId == Null.NullInteger ? NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Privacy") : NavigationManager.NavigateURL(PortalSettings.PrivacyTabId); + hypPrivacy.NavigateUrl = PortalSettings.PrivacyTabId == Null.NullInteger ? _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Privacy") : _navigationManager.NavigateURL(PortalSettings.PrivacyTabId); hypPrivacy.Attributes["rel"] = "nofollow"; } catch (Exception exc) diff --git a/Website/admin/Skins/Search.ascx.cs b/Website/admin/Skins/Search.ascx.cs index bd5ae741e26..160d059c04f 100644 --- a/Website/admin/Skins/Search.ascx.cs +++ b/Website/admin/Skins/Search.ascx.cs @@ -38,10 +38,10 @@ namespace DotNetNuke.UI.Skins.Controls public partial class Search : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Search() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Private Members @@ -430,11 +430,11 @@ protected void ExecuteSearch(string searchText, string searchType) { if (Host.UseFriendlyUrls) { - Response.Redirect(NavigationManager.NavigateURL(searchTabId) + "?Search=" + Server.UrlEncode(searchText)); + Response.Redirect(_navigationManager.NavigateURL(searchTabId) + "?Search=" + Server.UrlEncode(searchText)); } else { - Response.Redirect(NavigationManager.NavigateURL(searchTabId) + "&Search=" + Server.UrlEncode(searchText)); + Response.Redirect(_navigationManager.NavigateURL(searchTabId) + "&Search=" + Server.UrlEncode(searchText)); } } break; @@ -454,11 +454,11 @@ protected void ExecuteSearch(string searchText, string searchType) { if (Host.UseFriendlyUrls) { - Response.Redirect(NavigationManager.NavigateURL(searchTabId)); + Response.Redirect(_navigationManager.NavigateURL(searchTabId)); } else { - Response.Redirect(NavigationManager.NavigateURL(searchTabId)); + Response.Redirect(_navigationManager.NavigateURL(searchTabId)); } } } diff --git a/Website/admin/Skins/Terms.ascx.cs b/Website/admin/Skins/Terms.ascx.cs index 0fbb021fc9e..04059065e32 100644 --- a/Website/admin/Skins/Terms.ascx.cs +++ b/Website/admin/Skins/Terms.ascx.cs @@ -39,7 +39,7 @@ namespace DotNetNuke.UI.Skins.Controls /// ----------------------------------------------------------------------------- public partial class Terms : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private const string MyFileName = "Terms.ascx"; public string Text { get; set; } @@ -47,7 +47,7 @@ public partial class Terms : SkinObjectBase public Terms() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -78,7 +78,7 @@ protected override void OnLoad(EventArgs e) { hypTerms.Text = Localization.GetString("Terms", Localization.GetResourceFile(this, MyFileName)); } - hypTerms.NavigateUrl = PortalSettings.TermsTabId == Null.NullInteger ? NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Terms") : NavigationManager.NavigateURL(PortalSettings.TermsTabId); + hypTerms.NavigateUrl = PortalSettings.TermsTabId == Null.NullInteger ? _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Terms") : _navigationManager.NavigateURL(PortalSettings.TermsTabId); hypTerms.Attributes["rel"] = "nofollow"; } diff --git a/Website/admin/Skins/Toast.ascx.cs b/Website/admin/Skins/Toast.ascx.cs index 3b84effbb84..9abcd44a003 100644 --- a/Website/admin/Skins/Toast.ascx.cs +++ b/Website/admin/Skins/Toast.ascx.cs @@ -29,7 +29,7 @@ namespace DotNetNuke.UI.Skins.Controls { public partial class Toast : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(Toast)); private static readonly string ToastCacheKey = "DNN_Toast_Config"; @@ -41,7 +41,7 @@ public partial class Toast : SkinObjectBase public Toast() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } public bool IsOnline() @@ -57,7 +57,7 @@ public string GetNotificationLink() public string GetMessageLink() { - return NavigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); + return _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); } public string GetMessageLabel() diff --git a/Website/admin/Skins/User.ascx.cs b/Website/admin/Skins/User.ascx.cs index f0674f091da..a539cc2f7f2 100644 --- a/Website/admin/Skins/User.ascx.cs +++ b/Website/admin/Skins/User.ascx.cs @@ -53,11 +53,11 @@ namespace DotNetNuke.UI.Skins.Controls public partial class User : SkinObjectBase { private const string MyFileName = "User.ascx"; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public User() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); ShowUnreadMessages = true; ShowAvatar = true; LegacyMode = true; @@ -144,7 +144,7 @@ protected override void OnLoad(EventArgs e) registerLink.NavigateUrl = !String.IsNullOrEmpty(URL) ? URL - : Globals.RegisterURL(HttpUtility.UrlEncode(NavigationManager.NavigateURL()), Null.NullString); + : Globals.RegisterURL(HttpUtility.UrlEncode(_navigationManager.NavigateURL()), Null.NullString); enhancedRegisterLink.NavigateUrl = registerLink.NavigateUrl; if (PortalSettings.EnablePopUps && PortalSettings.RegisterTabId == Null.NullInteger @@ -183,8 +183,8 @@ protected override void OnLoad(EventArgs e) messageLink.Text = unreadMessages > 0 ? string.Format(Localization.GetString("Messages", Localization.GetResourceFile(this, MyFileName)), unreadMessages) : Localization.GetString("NoMessages", Localization.GetResourceFile(this, MyFileName)); notificationLink.Text = unreadAlerts > 0 ? string.Format(Localization.GetString("Notifications", Localization.GetResourceFile(this, MyFileName)), unreadAlerts) : Localization.GetString("NoNotifications", Localization.GetResourceFile(this, MyFileName)); - messageLink.NavigateUrl = NavigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID)); - notificationLink.NavigateUrl = NavigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID),"view=notifications","action=notifications"); + messageLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID)); + notificationLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID),"view=notifications","action=notifications"); notificationLink.ToolTip = Localization.GetString("CheckNotifications", Localization.GetResourceFile(this, MyFileName)); messageLink.ToolTip = Localization.GetString("CheckMessages", Localization.GetResourceFile(this, MyFileName)); messageGroup.Visible = true; diff --git a/Website/admin/Skins/UserAndLogin.ascx.cs b/Website/admin/Skins/UserAndLogin.ascx.cs index 356824efb93..fa2fdaf119d 100644 --- a/Website/admin/Skins/UserAndLogin.ascx.cs +++ b/Website/admin/Skins/UserAndLogin.ascx.cs @@ -45,13 +45,13 @@ namespace DotNetNuke.UI.Skins.Controls public partial class UserAndLogin : SkinObjectBase { private const string MyFileName = "UserAndLogin.ascx"; - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; protected string AvatarImageUrl => UserController.Instance.GetUserProfilePictureUrl(PortalSettings.UserId, 32, 32); public UserAndLogin() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool CanRegister @@ -123,7 +123,7 @@ protected string RegisterUrl { get { - return Globals.RegisterURL(HttpUtility.UrlEncode(NavigationManager.NavigateURL()), Null.NullString); + return Globals.RegisterURL(HttpUtility.UrlEncode(_navigationManager.NavigateURL()), Null.NullString); } } @@ -176,11 +176,11 @@ protected override void OnLoad(EventArgs e) { viewProfileLink.NavigateUrl = Globals.UserProfileURL(PortalSettings.UserId); viewProfileImageLink.NavigateUrl = Globals.UserProfileURL(PortalSettings.UserId); - logoffLink.NavigateUrl = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); - editProfileLink.NavigateUrl = NavigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=2"); - accountLink.NavigateUrl = NavigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=1"); - messagesLink.NavigateUrl = NavigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); - notificationsLink.NavigateUrl = NavigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId), "view=notifications", "action=notifications"); + logoffLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); + editProfileLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=2"); + accountLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=1"); + messagesLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); + notificationsLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId), "view=notifications", "action=notifications"); var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(PortalSettings.UserId, PortalSettings.PortalId); var unreadAlerts = NotificationsController.Instance.CountNotifications(PortalSettings.UserId, PortalSettings.PortalId); diff --git a/Website/admin/Skins/tags.ascx.cs b/Website/admin/Skins/tags.ascx.cs index c5385ac06fe..d764328f9d2 100644 --- a/Website/admin/Skins/tags.ascx.cs +++ b/Website/admin/Skins/tags.ascx.cs @@ -32,7 +32,7 @@ namespace DotNetNuke.UI.Skins.Controls { public partial class Tags : SkinObjectBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private const string MyFileName = "Tags.ascx"; private string _AddImageUrl = IconController.IconURL("Add"); private bool _AllowTagging = true; @@ -46,7 +46,7 @@ public partial class Tags : SkinObjectBase public Tags() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + _navigationManager = Globals.DependencyProvider.GetRequiredService(); } public string AddImageUrl @@ -179,7 +179,7 @@ protected override void OnLoad(EventArgs e) tagsControl.CssClass = CssClass; tagsControl.AllowTagging = AllowTagging && Request.IsAuthenticated; - tagsControl.NavigateUrlFormatString = NavigationManager.NavigateURL(PortalSettings.SearchTabId, "", "Tag={0}"); + tagsControl.NavigateUrlFormatString = _navigationManager.NavigateURL(PortalSettings.SearchTabId, "", "Tag={0}"); tagsControl.RepeatDirection = RepeatDirection; tagsControl.Separator = Separator; tagsControl.ShowCategories = ShowCategories; diff --git a/Website/admin/Tabs/Export.ascx.cs b/Website/admin/Tabs/Export.ascx.cs index 75c826eb0e2..5bac900ff7d 100644 --- a/Website/admin/Tabs/Export.ascx.cs +++ b/Website/admin/Tabs/Export.ascx.cs @@ -45,12 +45,12 @@ namespace DotNetNuke.Modules.Admin.Tabs public partial class Export : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; private TabInfo _tab; public Export() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } public TabInfo Tab @@ -100,7 +100,7 @@ protected override void OnLoad(EventArgs e) try { if (Page.IsPostBack) return; - cmdCancel.NavigateUrl = NavigationManager.NavigateURL(); + cmdCancel.NavigateUrl = _navigationManager.NavigateURL(); var folderPath = "Templates/"; var templateFolder = FolderManager.Instance.GetFolder(UserInfo.PortalID, folderPath); cboFolders.Services.Parameters.Add("permission", "ADD"); diff --git a/Website/admin/Tabs/Import.ascx.cs b/Website/admin/Tabs/Import.ascx.cs index 56966dc596f..733bbeda860 100644 --- a/Website/admin/Tabs/Import.ascx.cs +++ b/Website/admin/Tabs/Import.ascx.cs @@ -47,11 +47,11 @@ namespace DotNetNuke.Modules.Admin.Tabs public partial class Import : PortalModuleBase { - protected INavigationManager NavigationManager { get; } + private readonly INavigationManager _navigationManager; public Import() { - NavigationManager = DependencyProvider.GetRequiredService(); + _navigationManager = DependencyProvider.GetRequiredService(); } private TabInfo _tab; @@ -150,7 +150,7 @@ protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { - cmdCancel.NavigateUrl = NavigationManager.NavigateURL(); + cmdCancel.NavigateUrl = _navigationManager.NavigateURL(); cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); var folders = FolderManager.Instance.GetFolders(UserInfo, "BROWSE, ADD"); var templateFolder = folders.SingleOrDefault(f => f.FolderPath == "Templates/"); @@ -292,10 +292,10 @@ protected void OnImportClick(object sender, EventArgs e) switch (optRedirect.SelectedValue) { case "VIEW": - Response.Redirect(NavigationManager.NavigateURL(objTab.TabID), true); + Response.Redirect(_navigationManager.NavigateURL(objTab.TabID), true); break; default: - Response.Redirect(NavigationManager.NavigateURL(objTab.TabID, "Tab", "action=edit"), true); + Response.Redirect(_navigationManager.NavigateURL(objTab.TabID, "Tab", "action=edit"), true); break; } } From 1420e3e6f6b2814b5bedfe8b8a9d6f7c84632d91 Mon Sep 17 00:00:00 2001 From: Andrew Hoefling Date: Sun, 20 Oct 2019 17:44:06 -0400 Subject: [PATCH 44/44] Removed extra's added by visual studio to .csproj files --- .../Dnn.Modules.Console/Dnn.Modules.Console.csproj | 1 - .../Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj | 2 -- DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj | 1 - .../DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj | 1 - DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj | 1 - DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj | 1 - .../MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj | 1 - .../Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj | 1 - 8 files changed, 9 deletions(-) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj index 2dcc67178b6..945f6a17b04 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj @@ -20,7 +20,6 @@ - true diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj index a1f30e63c0b..9d22fa01297 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj @@ -19,8 +19,6 @@ - - true diff --git a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj index 98925809467..4b9df0a7ef9 100644 --- a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj +++ b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj @@ -13,7 +13,6 @@ - Debug diff --git a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj index fea1d9a177d..eab5609f596 100644 --- a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj +++ b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj @@ -23,7 +23,6 @@ ..\..\..\ true - true diff --git a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj index 71c522f66b9..241991b2144 100644 --- a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj +++ b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj @@ -28,7 +28,6 @@ - true diff --git a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj index 61ddf1b8768..3922bdfe195 100644 --- a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj +++ b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj @@ -26,7 +26,6 @@ ..\..\..\..\Evoq.Content\ true - true diff --git a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj index 6ab43a6f6b0..3af02580ee1 100644 --- a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj +++ b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj @@ -27,7 +27,6 @@ ..\..\..\..\Evoq.Content\ true - true diff --git a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj index d5e224f8955..7f61d63974f 100644 --- a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj +++ b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj @@ -27,7 +27,6 @@ - true