Skip to content

Commit

Permalink
Merge branch 'develop' into release/9.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
valadas committed Sep 27, 2022
2 parents 3585273 + fe799a4 commit 1d1b9bc
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 35 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/open-merged-pr-to-future-9.11.0.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Build/Tasks/CopyWebConfigToDevSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public sealed class CopyWebConfigToDevSite : FrostingTask<Context>
/// <inheritdoc/>
public override void Run(Context context)
{
if (string.IsNullOrWhiteSpace(context.Settings.DnnConnectionString))
{
throw new InvalidOperationException("DnnConnectionString was blank and must have a value when the CopyWebConfigToDevSite task is run");
}

var conf = context.FileReadText("./Website/web.config");
var transFile = "./Build/Tasks/webconfig-transform.local.xsl";
if (!context.FileExists(transFile))
Expand Down
7 changes: 6 additions & 1 deletion Build/Tasks/ResetDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace DotNetNuke.Build.Tasks
{
using System;
using System.Data.SqlClient;
using System.IO;
using System.Linq;

using Cake.Common.Diagnostics;
Expand Down Expand Up @@ -46,8 +47,12 @@ private static string LoadScript(ICakeContext context, string scriptName)

private static string ReplaceScriptVariables(Context context, string script)
{
var dbPath = context.FileSystem.GetDirectory(context.Settings.DatabasePath);
dbPath.Create();
var fullDbPath = Path.GetFullPath(dbPath.Path.FullPath);

return script.Replace("{DBName}", context.Settings.DnnDatabaseName)
.Replace("{DBPath}", context.Settings.DatabasePath)
.Replace("{DBPath}", fullDbPath)
.Replace("{DBLogin}", context.Settings.DnnSqlUsername);
}

Expand Down
1 change: 1 addition & 0 deletions DNN Platform/Library/DotNetNuke.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
<Compile Include="Entities\Portals\PortalAliasExtensions.cs" />
<Compile Include="Entities\Portals\PortalSettingUpdatedEventArgs.cs" />
<Compile Include="Entities\Portals\PortalTemplateEventArgs.cs" />
<Compile Include="Entities\Users\Exceptions\InvalidPasswordException.cs" />
<Compile Include="Entities\Users\Exceptions\InvalidUserRegisterException.cs" />
<Compile Include="Entities\Users\UpdateUserEventArgs.cs" />
<Compile Include="Entities\Content\ContentTypeMemberNameFixer.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DotNetNuke.Entities.Users
{
using System;

/// <summary>
/// An exception class which should be used to throw exceptions when password validations fail.
/// </summary>
[Serializable]
public class InvalidPasswordException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="InvalidPasswordException"/> class.
/// </summary>
public InvalidPasswordException()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="InvalidPasswordException"/> class with a message.
/// </summary>
/// <param name="message">Exception message.</param>
public InvalidPasswordException(string message)
: base(message)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="InvalidPasswordException"/> class with a message and an inner exception.
/// </summary>
/// <param name="message">Exception message.</param>
/// <param name="innerException">Inner exception to wrap.</param>
public InvalidPasswordException(
string message,
Exception innerException)
: base(message, innerException)
{
}
}
}
2 changes: 1 addition & 1 deletion DNN Platform/Library/Entities/Users/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static bool ChangePassword(UserInfo user, string oldPassword, string newP
}
else
{
throw new Exception("Invalid Password");
throw new InvalidPasswordException("Invalid Password");
}

return passwordChanged;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeleteExtension extends Component {
render() {
const {props} = this;
const { extensionBeingDeleted } = props;
const version = extensionBeingDeleted.version.value ? extensionBeingDeleted.version.value.split(".") : [0, 0, 0];
const version = extensionBeingDeleted.version ? extensionBeingDeleted.version.split(".") : [0, 0, 0];
return (
<GridCell className={styles.DeleteExtension}>
<PersonaBarPageHeader title={Localization.get("DeleteExtension.Action").replace("{0}", extensionBeingDeleted.friendlyName)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ public bool ChangePassword(int portalId, int userId, string newPassword)
catch (ThreadAbortException)
{
return true;
}
catch (InvalidPasswordException exc)
{
// Password validation has failed
Logger.Error(exc);
throw new InvalidPasswordException(
Localization.GetString("PasswordResetFailed", Constants.LocalResourcesFile),
exc);
}
catch (Exception exc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ public HttpResponseMessage ChangePassword(ChangePasswordDto changePasswordDto)

return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true });
}
catch (InvalidPasswordException exc)
{
Logger.Error(exc);
return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, exc.Message);
}
catch (Exception ex)
{
Logger.Error(ex);
Expand Down
30 changes: 30 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,26 @@ __metadata:
languageName: node
linkType: hard

"@babel/generator@npm:^7.18.13, @babel/generator@npm:^7.7.2":
version: 7.18.13
resolution: "@babel/generator@npm:7.18.13"
dependencies:
languageName: node
linkType: hard

"@babel/generator@npm:^7.1.6, @babel/generator@npm:^7.2.2, @babel/generator@npm:^7.4.0, @babel/generator@npm:^7.4.4":
version: 7.4.4
resolution: "@babel/generator@npm:7.4.4"
dependencies:
"@babel/types": ^7.4.4
jsesc: ^2.5.1
lodash: ^4.17.11
source-map: ^0.5.0
trim-right: ^1.0.1
checksum: 0b9efad8573167c04920f9cff2d0494a8e93a652249740210d7861f8dc8b99eb101b4634d8f2465e8b08f376149214169f68dbed4a5013ae8dca87f1784ea2fd
languageName: node
linkType: hard

"@babel/generator@npm:^7.18.13, @babel/generator@npm:^7.7.2":
version: 7.18.13
resolution: "@babel/generator@npm:7.18.13"
Expand Down Expand Up @@ -20679,6 +20699,16 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"reactjs-popup@npm:^1.3.2":
version: 1.3.2
resolution: "reactjs-popup@npm:1.3.2"
peerDependencies:
react: ^16.0.0
react-dom: ^16.0.0
checksum: 14d4190a6aaa9f331f7699a3bbf7bd78008e7457c1d8fb1b136dc2cf7346ab0c6564955a36e1e26129f89123fe14544c2e9bc639f81fbc268522c230d98ff060
languageName: node
linkType: hard

"read-cmd-shim@npm:^3.0.0":
version: 3.0.1
resolution: "read-cmd-shim@npm:3.0.1"
Expand Down

0 comments on commit 1d1b9bc

Please sign in to comment.