say mieux
This commit is contained in:
@ -15,7 +15,7 @@ namespace Yavsc.WebApi.Controllers
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
[Authorize(),Route("~/api/account"),Obsolete]
|
||||
[Authorize(),Route("~/api/account")]
|
||||
public class ApiAccountController : Controller
|
||||
{
|
||||
|
||||
|
@ -216,6 +216,15 @@ namespace Yavsc.Controllers
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[Authorize,HttpPost,ValidateAntiForgeryToken]
|
||||
public async Task <IActionResult> SendEMailForConfirm () {
|
||||
var user = await _userManager.FindByIdAsync( User.GetUserId() );
|
||||
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
||||
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
||||
await _emailSender.SendEmailAsync(_siteSettings, _smtpSettings, user.Email, "Confirm your account",
|
||||
"Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>");
|
||||
return View("ConfirmEmailSent");
|
||||
}
|
||||
//
|
||||
// POST: /Account/LogOff
|
||||
[HttpPost(Constants.LogoutPath)]
|
||||
|
@ -117,7 +117,9 @@ namespace Yavsc.Controllers
|
||||
BankInfo = user.BankInfo,
|
||||
DiskUsage = user.DiskUsage,
|
||||
DiskQuota = user.DiskQuota,
|
||||
DedicatedCalendarId = user.DedicatedGoogleCalendar
|
||||
DedicatedCalendarId = user.DedicatedGoogleCalendar,
|
||||
EMail = user.Email,
|
||||
EmailConfirmed = await _userManager.IsEmailConfirmedAsync(user)
|
||||
};
|
||||
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
||||
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == user.Id);
|
||||
|
@ -46,5 +46,9 @@ namespace Yavsc.ViewModels.Manage
|
||||
public long DiskUsage { get; set; }
|
||||
|
||||
public string DedicatedCalendarId { get; set; }
|
||||
|
||||
public string EMail { get; set; }
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,15 @@
|
||||
@{
|
||||
ViewData["Title"] = "Confirm Email";
|
||||
ViewData["Title"] = "Confirmation de votre adresse e-mail";
|
||||
}
|
||||
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<div>
|
||||
<p>
|
||||
Thank you for confirming your email. Please <a asp-controller="Account" asp-action="Login">Click here to Log in</a>.
|
||||
Merci d'avoir confirmé votre e-mail.
|
||||
@if (User.GetUserId()==null) {
|
||||
<text>S'il vous plait,
|
||||
<a asp-controller="Account" asp-action="Login">Cliquez ici pour vous connecter</a>.
|
||||
</text>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
13
Yavsc/Views/Account/ConfirmEmailSent.cshtml
Executable file
13
Yavsc/Views/Account/ConfirmEmailSent.cshtml
Executable file
@ -0,0 +1,13 @@
|
||||
@model string
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "S'il vous plait, veuillez confirmer votre adresse e-mail";
|
||||
}
|
||||
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<div>
|
||||
<p>
|
||||
Un message vient de vous être envoyé, à l'adresse e-mail @Model,
|
||||
Veuillez s-il vous plait confirmer cette adresse de courrier en utilisant le lien hyper-texte qui s'y trouve.
|
||||
</p>
|
||||
</div>
|
@ -18,6 +18,23 @@
|
||||
asp-action="CHUN">@SR["Change"]</a>]
|
||||
</dd>
|
||||
|
||||
<dt>@SR["EMail"]:</dt>
|
||||
|
||||
<dd>
|
||||
@Model.EMail
|
||||
|
||||
@if (Model.EmailConfirmed) {
|
||||
<text>(@SR["Adresse E-mail confirmée"])</text>
|
||||
}else {
|
||||
<text>
|
||||
<i> (@SR["Adresse non confirmée."])</i>
|
||||
<form asp-action="SendEMailForConfirm" asp-controller="Account" enctype="multipart/form-data">
|
||||
<input type="submit" value="@SR["Confirmer cette adresse"]"/>
|
||||
</form>
|
||||
</text>
|
||||
}
|
||||
</dd>
|
||||
|
||||
@if (Model.Roles.Count()>0) {
|
||||
<dt>@SR["Roles"]:</dt>
|
||||
<dd>
|
||||
|
@ -20,6 +20,7 @@
|
||||
<li><a asp-controller="CommandForms" asp-action="Index">Formulaires</a></li>
|
||||
<li><a asp-controller="Notifications" asp-action="Index">Notifications</a></li>
|
||||
<li><a asp-controller="SIRENExceptions" asp-action="Index">Excéptions au numéro de SIREN</a></li>
|
||||
<li><a asp-controller="Client" asp-action="Index">Accès API</a></li>
|
||||
</ul>
|
||||
</li>}
|
||||
|
||||
|
Reference in New Issue
Block a user