From c5f31b1cf514709db21d5e55e3385a23ed895ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20T=C3=A9tard?= <62659880+stetard@users.noreply.github.com> Date: Sun, 4 Aug 2024 19:42:18 +0200 Subject: [PATCH 1/2] Upgrade solution with DNN 9.11 (minimal security requirement) #37 --- Deploy/Deploy.csproj | 2 +- R7.Documents.Dnn/R7.Documents.Dnn.csproj | 181 +++++++++++++------ R7.Documents.Dnn/packages.config | 24 ++- R7.Documents.Dnn/web.Debug.config | 30 +++ R7.Documents.Dnn/web.Release.config | 31 ++++ R7.Documents.Dnn/web.config | 35 ++++ R7.Documents.Tests/R7.Documents.Tests.csproj | 3 +- 7 files changed, 240 insertions(+), 66 deletions(-) create mode 100644 R7.Documents.Dnn/web.Debug.config create mode 100644 R7.Documents.Dnn/web.Release.config create mode 100644 R7.Documents.Dnn/web.config diff --git a/Deploy/Deploy.csproj b/Deploy/Deploy.csproj index 2bceedd..a4575e0 100644 --- a/Deploy/Deploy.csproj +++ b/Deploy/Deploy.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.2 + netcoreapp3.1 Deploy2 diff --git a/R7.Documents.Dnn/R7.Documents.Dnn.csproj b/R7.Documents.Dnn/R7.Documents.Dnn.csproj index 36f6c8e..f17c0fb 100644 --- a/R7.Documents.Dnn/R7.Documents.Dnn.csproj +++ b/R7.Documents.Dnn/R7.Documents.Dnn.csproj @@ -1,5 +1,6 @@ - + + Debug AnyCPU @@ -9,6 +10,18 @@ R7.Documents R7.Documents.Dnn v4.7.2 + + + + + 4.0 + true + + + + + + true @@ -29,8 +42,77 @@ false + + ..\packages\DotNetNuke.Core.9.13.3\lib\net45\DotNetNuke.dll + False + + + ..\packages\DotNetNuke.DependencyInjection.9.13.3\lib\netstandard2.0\DotNetNuke.DependencyInjection.dll + False + + + ..\packages\DotNetNuke.Instrumentation.9.13.3\lib\net45\DotNetNuke.Instrumentation.dll + False + + + ..\packages\DotNetNuke.Instrumentation.9.13.3\lib\net45\DotNetNuke.Log4Net.dll + False + + + ..\packages\DotNetNuke.Web.9.13.3\lib\net45\DotNetNuke.Web.dll + False + + + ..\packages\DotNetNuke.Web.Client.9.13.3\lib\net45\DotNetNuke.Web.Client.dll + False + + + ..\packages\DotNetNuke.Web.Mvc.9.13.3\lib\net45\DotNetNuke.Web.Mvc.dll + False + + + ..\packages\DotNetNuke.Web.9.13.3\lib\net45\DotNetNuke.WebUtility.dll + False + + + ..\packages\DotNetNuke.Core.9.13.3\lib\net45\Microsoft.ApplicationBlocks.Data.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.13.0.3\lib\net45\Newtonsoft.Json.dll + False + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.9\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.Helpers.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.9\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.Mvc.5.2.9\lib\net45\System.Web.Mvc.dll + + + ..\packages\Microsoft.AspNet.Razor.3.2.9\lib\net45\System.Web.Razor.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Deployment.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Razor.dll + @@ -39,60 +121,18 @@ - - ..\packages\DotNetNuke.Core.8.0.4.226\lib\net40\DotNetNuke.dll - - - ..\packages\DotNetNuke.Core.8.0.4.226\lib\net40\Microsoft.ApplicationBlocks.Data.dll - - - ..\packages\DotNetNuke.Web.8.0.4.226\lib\net40\DotNetNuke.Web.dll - ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\DotNetNuke.Web.Deprecated.dll - - ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\DotNetNuke.WebUtility.dll - - - ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\Telerik.Web.UI.dll - - - ..\packages\DotNetNuke.Web.Mvc.8.0.4.226\lib\net45\DotNetNuke.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll - - - ..\packages\Microsoft.AspNet.Mvc.5.1.1\lib\net45\System.Web.Mvc.dll - ..\packages\NGettext.0.6.3\lib\net45\NGettext.dll - - ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\Telerik.Web.UI.dll ..\packages\YamlDotNet.5.3.0\lib\net45\YamlDotNet.dll @@ -101,14 +141,7 @@ ..\packages\R7.Dnn.Extensions.0.13.0\lib\net45\R7.Dnn.Extensions.dll - - - - - - - - + @@ -147,40 +180,57 @@ + + + web.config + + + web.config + ViewDocuments.ascx + ASPXCodeBehind ViewDocuments.ascx + ASPXCodeBehind SettingsDocuments.ascx + ASPXCodeBehind SettingsDocuments.ascx + ASPXCodeBehind EditDocuments.ascx + ASPXCodeBehind EditDocuments.ascx + ASPXCodeBehind ChangeFolder.ascx + ASPXCodeBehind ChangeFolder.ascx + ASPXCodeBehind ImportDocuments.ascx + ASPXCodeBehind ImportDocuments.ascx + ASPXCodeBehind @@ -204,13 +254,34 @@ R7.Documents + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + - + + + + + + True + True + 0 + / + http://localhost:56446/ + False + False + + + False + + + - + \ No newline at end of file diff --git a/R7.Documents.Dnn/packages.config b/R7.Documents.Dnn/packages.config index a61e283..f34ec6d 100644 --- a/R7.Documents.Dnn/packages.config +++ b/R7.Documents.Dnn/packages.config @@ -1,16 +1,22 @@  - - + + + + + - - - - - - + + + + + + + + + - + diff --git a/R7.Documents.Dnn/web.Debug.config b/R7.Documents.Dnn/web.Debug.config new file mode 100644 index 0000000..fae9cfe --- /dev/null +++ b/R7.Documents.Dnn/web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/R7.Documents.Dnn/web.Release.config b/R7.Documents.Dnn/web.Release.config new file mode 100644 index 0000000..da6e960 --- /dev/null +++ b/R7.Documents.Dnn/web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/R7.Documents.Dnn/web.config b/R7.Documents.Dnn/web.config new file mode 100644 index 0000000..c6d23f9 --- /dev/null +++ b/R7.Documents.Dnn/web.config @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/R7.Documents.Tests/R7.Documents.Tests.csproj b/R7.Documents.Tests/R7.Documents.Tests.csproj index 377ffe2..529428e 100644 --- a/R7.Documents.Tests/R7.Documents.Tests.csproj +++ b/R7.Documents.Tests/R7.Documents.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 false @@ -13,6 +13,7 @@ + runtime; build; native; contentfiles; analyzers; buildtransitive From 9ffcc1b1377a4fd352417d0e1a7a2e8ed6dd043d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20T=C3=A9tard?= <62659880+stetard@users.noreply.github.com> Date: Mon, 5 Aug 2024 09:52:58 +0200 Subject: [PATCH 2/2] Replace DnnDateTimePicker with html DateTime inputs for Telerik removal. #37 --- R7.Documents.Dnn/EditDocuments.ascx | 11 +++-- .../EditDocuments.ascx.controls.cs | 10 ++--- R7.Documents.Dnn/EditDocuments.ascx.cs | 42 +++++++++++++------ R7.Documents.Dnn/R7.Documents.Dnn.csproj | 27 ++++-------- R7.Documents.Dnn/packages.config | 6 +-- R7.Documents/Properties/SolutionInfo.cs | 4 +- 6 files changed, 53 insertions(+), 47 deletions(-) diff --git a/R7.Documents.Dnn/EditDocuments.ascx b/R7.Documents.Dnn/EditDocuments.ascx index 4aaa1ad..1fbc5f8 100644 --- a/R7.Documents.Dnn/EditDocuments.ascx +++ b/R7.Documents.Dnn/EditDocuments.ascx @@ -1,9 +1,8 @@ -<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="EditDocuments.ascx.cs" Inherits="R7.Documents.EditDocuments" %> +<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="EditDocuments.ascx.cs" Inherits="R7.Documents.EditDocuments" %> <%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/DnnUrlControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="Tracking" Src="~/controls/URLTrackingControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> -<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %> <%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %> @@ -42,11 +41,11 @@
- +
- +
@@ -63,11 +62,11 @@
- +
- +
diff --git a/R7.Documents.Dnn/EditDocuments.ascx.controls.cs b/R7.Documents.Dnn/EditDocuments.ascx.controls.cs index 8fb46cf..fb2fe52 100644 --- a/R7.Documents.Dnn/EditDocuments.ascx.controls.cs +++ b/R7.Documents.Dnn/EditDocuments.ascx.controls.cs @@ -1,4 +1,4 @@ -using System.Web.UI.WebControls; +using System.Web.UI.WebControls; using DotNetNuke.UI.UserControls; using DotNetNuke.Web.UI.WebControls; @@ -27,10 +27,10 @@ public partial class EditDocuments protected RangeValidator valSortIndex; protected LinkButton btnChangeOwner; protected URLTrackingControl ctlUrlTracking; - protected DnnDateTimePicker dtCreatedDate; - protected DnnDateTimePicker dtLastModifiedDate; - protected DnnDateTimePicker dtStartDate; - protected DnnDateTimePicker dtEndDate; + protected TextBox dtCreatedDate; + protected TextBox dtLastModifiedDate; + protected TextBox dtStartDate; + protected TextBox dtEndDate; protected MultiView mvEditDocument; protected LinkButton btnEdit; protected HyperLink lnkClose; diff --git a/R7.Documents.Dnn/EditDocuments.ascx.cs b/R7.Documents.Dnn/EditDocuments.ascx.cs index 8498d5e..1bf1283 100644 --- a/R7.Documents.Dnn/EditDocuments.ascx.cs +++ b/R7.Documents.Dnn/EditDocuments.ascx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.IO; using System.Linq; @@ -26,6 +26,9 @@ using R7.Dnn.Extensions.Text; using R7.Dnn.Extensions.FileSystem; using R7.University.Components; +using System.Globalization; +using System.Text.RegularExpressions; +using System.Web.Services.Description; namespace R7.Documents { @@ -305,12 +308,12 @@ void LoadExistingDocument (IDocument document) txtTitle.Text = document.Title; txtDescription.Text = document.Description; chkForceDownload.Checked = document.ForceDownload; - dtStartDate.SelectedDate = document.StartDate; - dtEndDate.SelectedDate = document.EndDate; + dtStartDate.Text = document.StartDate?.ToString("yyyy-MM-ddTHH:mm"); + dtEndDate.Text = document.EndDate?.ToString("yyyy-MM-ddTHH:mm"); txtLinkAttributes.Text = document.LinkAttributes; chkIsFeatured.Checked = document.IsFeatured; - dtCreatedDate.SelectedDate = document.CreatedDate; - dtLastModifiedDate.SelectedDate = document.ModifiedDate; + dtCreatedDate.Text = document.CreatedDate.ToString("yyyy-MM-ddTHH:mm"); + dtLastModifiedDate.Text = document.ModifiedDate.ToString("yyyy-MM-ddTHH:mm"); txtSortIndex.Text = document.SortOrderIndex.ToString (); if (!string.IsNullOrEmpty (document.Url)) { @@ -644,19 +647,34 @@ void UpdateDateTime (DocumentInfo document, DocumentInfo oldDocument) { var now = DateTime.Now; - document.StartDate = dtStartDate.SelectedDate; - document.EndDate = dtEndDate.SelectedDate; + DateTime dateResult; + if (DateTime.TryParse(dtStartDate.Text.Replace("-", "/"), CultureInfo.CurrentCulture, DateTimeStyles.AssumeLocal, out dateResult)) + { + document.StartDate = dateResult; + } + else + { + document.StartDate = null; + } + if (DateTime.TryParse(dtEndDate.Text.Replace("-", "/"), CultureInfo.CurrentCulture, DateTimeStyles.AssumeLocal, out dateResult)) + { + document.EndDate = dateResult; + } + else + { + document.EndDate = null; + } - if (dtCreatedDate.SelectedDate == null) { - document.CreatedDate = now; + if (DateTime.TryParse(dtCreatedDate.Text.Replace("-", "/"), CultureInfo.CurrentCulture, DateTimeStyles.AssumeLocal, out dateResult)) { + document.CreatedDate = dateResult; } else { - document.CreatedDate = dtCreatedDate.SelectedDate.Value; + document.CreatedDate = now; } - if (dtLastModifiedDate.SelectedDate == null || oldDocument.Url != ctlUrl.Url) { + if (!DateTime.TryParse(dtLastModifiedDate.Text.Replace("-", "/"), CultureInfo.CurrentCulture, DateTimeStyles.AssumeLocal, out dateResult) || oldDocument.Url != ctlUrl.Url) { document.ModifiedDate = now; } else { - document.ModifiedDate = dtLastModifiedDate.SelectedDate.Value; + document.ModifiedDate = dateResult; } } diff --git a/R7.Documents.Dnn/R7.Documents.Dnn.csproj b/R7.Documents.Dnn/R7.Documents.Dnn.csproj index f17c0fb..3ff1d52 100644 --- a/R7.Documents.Dnn/R7.Documents.Dnn.csproj +++ b/R7.Documents.Dnn/R7.Documents.Dnn.csproj @@ -70,10 +70,6 @@ ..\packages\DotNetNuke.Web.Mvc.9.13.3\lib\net45\DotNetNuke.Web.Mvc.dll False - - ..\packages\DotNetNuke.Web.9.13.3\lib\net45\DotNetNuke.WebUtility.dll - False - ..\packages\DotNetNuke.Core.9.13.3\lib\net45\Microsoft.ApplicationBlocks.Data.dll @@ -87,6 +83,13 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll False + + ..\packages\NGettext.0.6.5\lib\net46\NGettext.dll + + + False + ..\..\R7.Dnn.Extensions\R7.Dnn.Extensions\bin\Debug\R7.Dnn.Extensions.dll + @@ -121,24 +124,12 @@ - - ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\DotNetNuke.Web.Deprecated.dll - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\NGettext.0.6.3\lib\net45\NGettext.dll - - - ..\packages\DotNetNuke.Web.Deprecated.8.0.4.226\lib\net40\Telerik.Web.UI.dll - - - ..\packages\YamlDotNet.5.3.0\lib\net45\YamlDotNet.dll - - - ..\packages\R7.Dnn.Extensions.0.13.0\lib\net45\R7.Dnn.Extensions.dll + + ..\packages\YamlDotNet.8.1.0\lib\net45\YamlDotNet.dll diff --git a/R7.Documents.Dnn/packages.config b/R7.Documents.Dnn/packages.config index f34ec6d..bafc352 100644 --- a/R7.Documents.Dnn/packages.config +++ b/R7.Documents.Dnn/packages.config @@ -5,7 +5,6 @@ - @@ -17,7 +16,6 @@ - - - + + \ No newline at end of file diff --git a/R7.Documents/Properties/SolutionInfo.cs b/R7.Documents/Properties/SolutionInfo.cs index 6d7c4a7..9b33fd0 100644 --- a/R7.Documents/Properties/SolutionInfo.cs +++ b/R7.Documents/Properties/SolutionInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyProduct ("R7.Documents")] [assembly: AssemblyCopyright ("Roman M. Yagodin")] [assembly: AssemblyTrademark ("")] -[assembly: AssemblyVersion ("1.13.1")] -[assembly: AssemblyInformationalVersion ("1.13.1")] +[assembly: AssemblyVersion ("1.14.0")] +[assembly: AssemblyInformationalVersion ("1.14.0")]