-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to #5558
- Loading branch information
Showing
11 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/OrchardCore.Modules/OrchardCore.Users/Deployment/LoginSettingsDeploymentSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json.Linq; | ||
using OrchardCore.Deployment; | ||
using OrchardCore.Settings; | ||
using OrchardCore.Users.Services; | ||
|
||
namespace OrchardCore.Users.Deployment | ||
{ | ||
public class LoginSettingsDeploymentSource : IDeploymentSource | ||
{ | ||
private readonly IMembershipService _membershipService; | ||
private readonly ISiteService _siteService; | ||
|
||
public LoginSettingsDeploymentSource(IMembershipService membershipService, ISiteService siteService) | ||
{ | ||
_membershipService = membershipService; | ||
_siteService = siteService; | ||
} | ||
|
||
public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result) | ||
{ | ||
var loginSettingsStep = step as LoginSettingsDeploymentStep; | ||
|
||
if (loginSettingsStep == null) | ||
{ | ||
return; | ||
} | ||
|
||
var loginSettings = await _membershipService.GetLoginSettingsAsync(); | ||
|
||
// Adding Login settings | ||
result.Steps.Add(new JObject( | ||
new JProperty("name", "Settings"), | ||
new JProperty("LoginSettings", JObject.FromObject(loginSettings)) | ||
)); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/OrchardCore.Modules/OrchardCore.Users/Deployment/LoginSettingsDeploymentStep.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using OrchardCore.Deployment; | ||
|
||
namespace OrchardCore.Users.Deployment | ||
{ | ||
/// <summary> | ||
/// Adds layers to a <see cref="DeploymentPlanResult"/>. | ||
/// </summary> | ||
public class LoginSettingsDeploymentStep : DeploymentStep | ||
{ | ||
public LoginSettingsDeploymentStep() | ||
{ | ||
Name = "LoginSettings"; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/OrchardCore.Modules/OrchardCore.Users/Deployment/LoginSettingsDeploymentStepDriver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using OrchardCore.Deployment; | ||
using OrchardCore.DisplayManagement.Handlers; | ||
using OrchardCore.DisplayManagement.Views; | ||
|
||
namespace OrchardCore.Users.Deployment | ||
{ | ||
public class LoginSettingsDeploymentStepDriver : DisplayDriver<DeploymentStep, LoginSettingsDeploymentStep> | ||
{ | ||
public override IDisplayResult Display(LoginSettingsDeploymentStep step) | ||
{ | ||
return | ||
Combine( | ||
View("LoginSettingsDeploymentStep_Fields_Summary", step).Location("Summary", "Content"), | ||
View("LoginSettingsDeploymentStep_Fields_Thumbnail", step).Location("Thumbnail", "Content") | ||
); | ||
} | ||
|
||
public override IDisplayResult Edit(LoginSettingsDeploymentStep step) | ||
{ | ||
return View("LoginSettingsDeploymentStep_Fields_Edit", step).Location("Content"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...Core.Modules/OrchardCore.Users/Views/Items/LoginSettingsDeploymentStep.Fields.Edit.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@model dynamic | ||
|
||
<h5>@T["Login Settings"]</h5> |
5 changes: 5 additions & 0 deletions
5
...e.Modules/OrchardCore.Users/Views/Items/LoginSettingsDeploymentStep.Fields.Summary.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@model dynamic | ||
|
||
<h5>@T["Login Settings"]</h5> | ||
|
||
<span class="hint">@T["Adds login settings to the plan."]</span> |
4 changes: 4 additions & 0 deletions
4
...Modules/OrchardCore.Users/Views/Items/LoginSettingsDeploymentStep.Fields.Thumbnail.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@model dynamic | ||
|
||
<h4 class="card-title">@T["Login Settings"]</h4> | ||
<p>@T["Exports login settings."]</p> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters