restored templates
This commit is contained in:
@ -28,6 +28,7 @@ using System.Security.Cryptography;
|
|||||||
using System.Text.Unicode;
|
using System.Text.Unicode;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Yavsc.Server.Helpers;
|
using Yavsc.Server.Helpers;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Yavsc.Controllers
|
namespace Yavsc.Controllers
|
||||||
{
|
{
|
||||||
@ -45,6 +46,7 @@ namespace Yavsc.Controllers
|
|||||||
readonly TwilioSettings _twilioSettings;
|
readonly TwilioSettings _twilioSettings;
|
||||||
|
|
||||||
readonly IStringLocalizer _localizer;
|
readonly IStringLocalizer _localizer;
|
||||||
|
private readonly IStringLocalizer _localizer2;
|
||||||
|
|
||||||
// TwilioSettings _twilioSettings;
|
// TwilioSettings _twilioSettings;
|
||||||
|
|
||||||
@ -66,7 +68,7 @@ namespace Yavsc.Controllers
|
|||||||
ITrueEmailSender emailSender,
|
ITrueEmailSender emailSender,
|
||||||
IOptions<SiteSettings> siteSettings,
|
IOptions<SiteSettings> siteSettings,
|
||||||
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings,
|
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings,
|
||||||
IStringLocalizer<Yavsc.YavscLocalization> localizer,
|
IStringLocalizerFactory localizerFactory,
|
||||||
ApplicationDbContext dbContext)
|
ApplicationDbContext dbContext)
|
||||||
{
|
{
|
||||||
_interaction = interaction;
|
_interaction = interaction;
|
||||||
@ -81,8 +83,13 @@ namespace Yavsc.Controllers
|
|||||||
_siteSettings = siteSettings.Value;
|
_siteSettings = siteSettings.Value;
|
||||||
_twilioSettings = twilioSettings.Value;
|
_twilioSettings = twilioSettings.Value;
|
||||||
_logger = loggerFactory.CreateLogger<AccountController>();
|
_logger = loggerFactory.CreateLogger<AccountController>();
|
||||||
_localizer = localizer;
|
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
|
var type = typeof(Yavsc.YavscLocalization);
|
||||||
|
var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);
|
||||||
|
_localizer = localizerFactory.Create(type);
|
||||||
|
_localizer2 = localizerFactory.Create("SharedResource", assemblyName.Name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,33 +406,42 @@ public static class HostingExtensions
|
|||||||
|
|
||||||
var context = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
|
var context = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
|
||||||
|
|
||||||
context.Database.Migrate();
|
try
|
||||||
|
|
||||||
if (!context.Clients.Any())
|
|
||||||
{
|
{
|
||||||
foreach (var client in Config.Clients)
|
|
||||||
{
|
|
||||||
context.Clients.Add(client.ToEntity());
|
|
||||||
}
|
|
||||||
context.SaveChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!context.IdentityResources.Any())
|
|
||||||
{
|
|
||||||
foreach (var resource in Config.IdentityResources)
|
|
||||||
{
|
|
||||||
context.IdentityResources.Add(resource.ToEntity());
|
|
||||||
}
|
|
||||||
context.SaveChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!context.ApiScopes.Any())
|
context.Database.Migrate();
|
||||||
{
|
|
||||||
foreach (var resource in Config.ApiScopes)
|
if (!context.Clients.Any())
|
||||||
{
|
{
|
||||||
context.ApiScopes.Add(resource.ToEntity());
|
foreach (var client in Config.Clients)
|
||||||
|
{
|
||||||
|
context.Clients.Add(client.ToEntity());
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
context.SaveChanges();
|
|
||||||
|
if (!context.IdentityResources.Any())
|
||||||
|
{
|
||||||
|
foreach (var resource in Config.IdentityResources)
|
||||||
|
{
|
||||||
|
context.IdentityResources.Add(resource.ToEntity());
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context.ApiScopes.Any())
|
||||||
|
{
|
||||||
|
foreach (var resource in Config.ApiScopes)
|
||||||
|
{
|
||||||
|
context.ApiScopes.Add(resource.ToEntity());
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException ex)
|
||||||
|
{
|
||||||
|
app.Properties["DegradedDBContext"] = ex.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
src/Yavsc/Views/Account/AccountCreated.cshtml
Normal file
10
src/Yavsc/Views/Account/AccountCreated.cshtml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Account creation success";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1>@ViewData["Title"]</h1>
|
||||||
|
|
||||||
|
Your account has successfully been created.
|
||||||
|
|
||||||
|
<a asp-action="Index" asp-controller="Home">Return to home</a>
|
12
src/Yavsc/Views/Account/AdminSendConfirationEmail.cshtml
Executable file
12
src/Yavsc/Views/Account/AdminSendConfirationEmail.cshtml
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
@model Yavsc.Abstract.Manage.EmailSentViewModel
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "S'il vous plait, veuillez confirmer votre adresse e-mail";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>@ViewData["Title"].</h2>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Un message vient d'être envoyé à l'adresse e-mail ( @Model.EMail , id:@Model.MessageId ).
|
||||||
|
</p>
|
||||||
|
</div>
|
Reference in New Issue
Block a user