Skip to content

Commit

Permalink
Merge branch 'main' into UpdateDocsTaxonomy
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytes1027 committed Dec 17, 2024
2 parents f50380d + 6aca8d1 commit d455e84
Show file tree
Hide file tree
Showing 64 changed files with 625 additions and 597 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3258,6 +3258,15 @@
"contributions": [
"code"
]
},
{
"login": "sparkie79",
"name": "sparkie79",
"avatar_url": "https://avatars.githubusercontent.com/u/4757890?v=4",
"profile": "https://github.com/sparkie79",
"contributions": [
"code"
]
}
],
"skipCi": true,
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/patch_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ assignees: ''
### Create Pull Request:

- [ ] From the release branch (e.g., `release/2.1`), create a new temporary branch for your release (e.g., `release-notes/2.1.1`).
- [ ] Update version references in the documentation. Refer to [this PR](https://github.com/OrchardCMS/OrchardCore/pull/17065/files) for an example.
- [ ] **Version Updates Checklist**:
- [ ] Update version references in the documentation. Refer to [this PR](https://github.com/OrchardCMS/OrchardCore/pull/17065/files) for an example. Version Updates Checklist:
- **Update `OrchardCore.Commons.props`**: Set `<VersionSuffix></VersionSuffix>` to the new version you're preparing for release.
- **Update Module Versions**: Modify `src/OrchardCore/OrchardCore.Abstractions/Modules/Manifest/ManifestConstants.cs` to reflect the new version.
- **Release Notes**: Finalize the release notes in the documentation, including:
Expand All @@ -33,6 +32,8 @@ assignees: ''
- [Status in the root README](https://docs.orchardcore.net/en/latest/#status)
- CLI templates and commands.
- Relevant guides, such as the [Creating a new decoupled CMS Website](https://docs.orchardcore.net/en/latest/guides/decoupled-cms/) guide.
- [ ] Create a **Documentation PR** titled "Release with the new version number" (e.g., `Release 2.1.1`) from the documentation branch (e.g., `release-notes/2.1.1`) into the release branch (e.g., `release/2.1`)
- [ ] Merge the Documentation PR.
- [ ] In GitHub, manually run the `Preview - CI` workflow on your branch (NOT `main`). This will release a new preview version on CloudSmith for testing.

## Step 3: Validation
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageVersion Include="AngleSharp" Version="1.1.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.410.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.410.6" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.301" />
<PackageVersion Include="Azure.Communication.Email" Version="1.0.1" />
<PackageVersion Include="Azure.Communication.Sms" Version="1.0.1" />
Expand All @@ -34,7 +34,7 @@
<PackageVersion Include="JsonPath.Net" Version="2.0.0" />
<PackageVersion Include="HtmlSanitizer" Version="8.2.871-beta" />
<PackageVersion Include="Irony" Version="1.5.3" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.51" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.52" />
<PackageVersion Include="Lorem.Universal.NET" Version="4.0.80" />
<PackageVersion Include="Lucene.Net" Version="4.8.0-beta00017" />
<PackageVersion Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00017" />
Expand All @@ -51,7 +51,7 @@
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.5.4" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="NJsonSchema" Version="11.0.2" />
<PackageVersion Include="NJsonSchema" Version="11.1.0" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.3.15" />
<PackageVersion Include="NodaTime" Version="3.2.0" />
<PackageVersion Include="OpenIddict.Core" Version="5.8.0" />
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ nav:
- Feeds: reference/modules/Feeds/README.md
- Commerce: https://commerce.orchardcore.net/en/latest
- Core Modules:
- Display Management: reference/modules/DisplayManagement/README.md
- Audit Trail: reference/modules/AuditTrail/README.md
- Auto Setup: reference/modules/AutoSetup/README.md
- Features: reference/modules/Features/README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
{
if (Model.Value.Type == "checkbox")
{
isChecked = fieldEntry.AttemptedValue == fieldValue;
// Unlike other input controls, a checkbox's value is only included in the
// submitted data if the checkbox is currently checked. If it is, then the
// value of the checkbox's value attribute is reported as the input's value,
// or 'on' if no value is set.
// c.f. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#additional_attributes
isChecked = fieldEntry.AttemptedValue == (fieldValue ?? "on");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override async Task<IDisplayResult> UpdateAsync(MediaField field, UpdateF
{
var extension = Path.GetExtension(field.Paths[i]);

if (!settings.AllowedExtensions.Contains(extension))
if (!settings.AllowedExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
{
context.Updater.ModelState.AddModelError(Prefix, nameof(model.Paths), S["Media extension is not allowed. Only media with '{0}' extensions are allowed.", string.Join(", ", settings.AllowedExtensions)]);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Globalization;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.ReCaptcha.Configuration;
Expand All @@ -19,11 +20,14 @@ public override async Task<IDisplayResult> EditAsync(ForgotPasswordForm model, B
{
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();

if (!settings.IsValid())
if (!settings.ConfigurationExists())
{
return null;
}

return View("FormReCaptcha", model).Location("Content:after");
return Dynamic("ReCaptcha", (m) =>
{
m.language = CultureInfo.CurrentUICulture.Name;
}).Location("Content:after");
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Globalization;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.ReCaptcha.Configuration;
using OrchardCore.ReCaptcha.Services;
using OrchardCore.Settings;
using OrchardCore.Users.Models;

Expand All @@ -10,25 +10,24 @@ namespace OrchardCore.ReCaptcha.Drivers;
public sealed class ReCaptchaLoginFormDisplayDriver : DisplayDriver<LoginForm>
{
private readonly ISiteService _siteService;
private readonly ReCaptchaService _reCaptchaService;

public ReCaptchaLoginFormDisplayDriver(
ISiteService siteService,
ReCaptchaService reCaptchaService)
public ReCaptchaLoginFormDisplayDriver(ISiteService siteService)
{
_siteService = siteService;
_reCaptchaService = reCaptchaService;
}

public override async Task<IDisplayResult> EditAsync(LoginForm model, BuildEditorContext context)
{
var _reCaptchaSettings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();

if (!_reCaptchaSettings.IsValid() || !_reCaptchaService.IsThisARobot())
if (!settings.ConfigurationExists())
{
return null;
}

return View("FormReCaptcha", model).Location("Content:after");
return Dynamic("ReCaptcha", (m) =>
{
m.language = CultureInfo.CurrentUICulture.Name;
}).Location("Content:after");
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Globalization;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.ReCaptcha.Configuration;
Expand All @@ -19,11 +20,14 @@ public override async Task<IDisplayResult> EditAsync(ResetPasswordForm model, Bu
{
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();

if (!settings.IsValid())
if (!settings.ConfigurationExists())
{
return null;
}

return View("FormReCaptcha", model).Location("Content:after");
return Dynamic("ReCaptcha", (m) =>
{
m.language = CultureInfo.CurrentUICulture.Name;
}).Location("Content:after");
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Globalization;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.ReCaptcha.Configuration;
Expand All @@ -19,11 +20,14 @@ public override async Task<IDisplayResult> EditAsync(RegisterUserForm model, Bui
{
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();

if (!settings.IsValid())
if (!settings.ConfigurationExists())
{
return null;
}

return View("FormReCaptcha", model).Location("Content:after");
return Dynamic("ReCaptcha", (m) =>
{
m.language = CultureInfo.CurrentUICulture.Name;
}).Location("Content:after");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override IDisplayResult Display(ReCaptchaPart part, BuildPartDisplayConte
return Initialize<ReCaptchaPartViewModel>("ReCaptchaPart", async model =>
{
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();
model.SettingsAreConfigured = settings.IsValid();
model.SettingsAreConfigured = settings.ConfigurationExists();
}).Location("Detail", "Content");
}

Expand All @@ -29,7 +29,7 @@ public override IDisplayResult Edit(ReCaptchaPart part, BuildPartEditorContext c
return Initialize<ReCaptchaPartViewModel>("ReCaptchaPart_Fields_Edit", async model =>
{
var settings = await _siteService.GetSettingsAsync<ReCaptchaSettings>();
model.SettingsAreConfigured = settings.IsValid();
model.SettingsAreConfigured = settings.ConfigurationExists();
});
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using OrchardCore.ReCaptcha.Services;
using OrchardCore.Users;
using OrchardCore.Users.Events;

namespace OrchardCore.ReCaptcha.Users.Handlers;

public class LoginFormEventEventHandler : LoginFormEventBase
public sealed class LoginFormEventEventHandler : LoginFormEventBase
{
private readonly ReCaptchaService _reCaptchaService;

Expand All @@ -13,34 +12,6 @@ public LoginFormEventEventHandler(ReCaptchaService reCaptchaService)
_reCaptchaService = reCaptchaService;
}

public override Task LoggedInAsync(IUser user)
{
_reCaptchaService.ThisIsAHuman();

return Task.CompletedTask;
}

public override Task LoggingInAsync(string userName, Action<string, string> reportError)
{
if (_reCaptchaService.IsThisARobot())
{
return _reCaptchaService.ValidateCaptchaAsync(reportError);
}

return Task.CompletedTask;
}

public override Task LoggingInFailedAsync(string userName)
{
_reCaptchaService.MaybeThisIsARobot();

return Task.CompletedTask;
}

public override Task LoggingInFailedAsync(IUser user)
{
_reCaptchaService.MaybeThisIsARobot();

return Task.CompletedTask;
}
=> _reCaptchaService.ValidateCaptchaAsync(reportError);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,18 @@

namespace OrchardCore.ReCaptcha.Users.Handlers;

public class PasswordRecoveryFormEventEventHandler : IPasswordRecoveryFormEvents
public sealed class PasswordRecoveryFormEventEventHandler : PasswordRecoveryFormEvents
{
private readonly ReCaptchaService _recaptchaService;
private readonly ReCaptchaService _reCaptchaService;

public PasswordRecoveryFormEventEventHandler(ReCaptchaService recaptchaService)
public PasswordRecoveryFormEventEventHandler(ReCaptchaService reCaptchaService)
{
_recaptchaService = recaptchaService;
_reCaptchaService = reCaptchaService;
}

public Task RecoveringPasswordAsync(Action<string, string> reportError)
{
return _recaptchaService.ValidateCaptchaAsync(reportError);
}

public Task PasswordResetAsync(PasswordRecoveryContext context)
{
return Task.CompletedTask;
}
public override Task RecoveringPasswordAsync(Action<string, string> reportError)
=> _reCaptchaService.ValidateCaptchaAsync(reportError);

public Task ResettingPasswordAsync(Action<string, string> reportError)
{
return _recaptchaService.ValidateCaptchaAsync(reportError);
}

public Task PasswordRecoveredAsync(PasswordRecoveryContext context)
{
return Task.CompletedTask;
}
public override Task ResettingPasswordAsync(Action<string, string> reportError)
=> _reCaptchaService.ValidateCaptchaAsync(reportError);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

namespace OrchardCore.ReCaptcha.Users.Handlers;

public class RegistrationFormEventHandler : RegistrationFormEventsBase
public sealed class RegistrationFormEventHandler : RegistrationFormEventsBase
{
private readonly ReCaptchaService _reCaptchaService;

public RegistrationFormEventHandler(ReCaptchaService recaptchaService)
public RegistrationFormEventHandler(ReCaptchaService reCaptchaService)
{
_reCaptchaService = recaptchaService;
_reCaptchaService = reCaptchaService;
}

public override Task RegistrationValidationAsync(Action<string, string> reportError)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="mb-3">
<captcha mode="AlwaysShow" language="@Orchard.CultureName()" />
<captcha language="@Orchard.CultureName()" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ namespace OrchardCore.Tenants.Services;
public class FeatureProfilesSchemaService : IFeatureProfilesSchemaService
{
private readonly FeatureProfilesRuleOptions _featureProfilesRuleOptions;
private readonly IHostEnvironment _hostEnvironment;

public FeatureProfilesSchemaService(
IOptions<FeatureProfilesRuleOptions> options,
IHostEnvironment hostEnvironment)
public FeatureProfilesSchemaService(IOptions<FeatureProfilesRuleOptions> options)
{
_hostEnvironment = hostEnvironment;
_featureProfilesRuleOptions = options.Value;
}

Expand Down Expand Up @@ -46,11 +42,6 @@ public string GetJsonSchema()
rule.Reference = ruleProperty;
}

if (_hostEnvironment.IsDevelopment())
{
return schema.ToJson();
}

return schema.ToJson();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

namespace OrchardCore.Users.AuditTrail.ResetPassword;

public class UserResetPasswordEventHandler : IPasswordRecoveryFormEvents
public sealed class UserResetPasswordEventHandler : PasswordRecoveryFormEvents
{
private readonly IAuditTrailManager _auditTrailManager;
private readonly IServiceProvider _serviceProvider;

private UserManager<IUser> _userManager;

public UserResetPasswordEventHandler(
Expand All @@ -22,19 +23,12 @@ public UserResetPasswordEventHandler(
_serviceProvider = serviceProvider;
}

public Task PasswordRecoveredAsync(PasswordRecoveryContext context)
public override Task PasswordRecoveredAsync(PasswordRecoveryContext context)
=> RecordAuditTrailEventAsync(UserResetPasswordAuditTrailEventConfiguration.PasswordRecovered, context.User);

public Task PasswordResetAsync(PasswordRecoveryContext context)
public override Task PasswordResetAsync(PasswordRecoveryContext context)
=> RecordAuditTrailEventAsync(UserResetPasswordAuditTrailEventConfiguration.PasswordReset, context.User);

#region Unused events

public Task RecoveringPasswordAsync(Action<string, string> reportError) => Task.CompletedTask;

public Task ResettingPasswordAsync(Action<string, string> reportError) => Task.CompletedTask;

#endregion
private async Task RecordAuditTrailEventAsync(string name, IUser user)
{
var userName = user.UserName;
Expand Down
Loading

0 comments on commit d455e84

Please sign in to comment.