say mieux
This commit is contained in:
parent
88a32783ab
commit
970d6ed295
8 changed files with 55 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
[Authorize(),Route("~/api/account"),Obsolete]
|
[Authorize(),Route("~/api/account")]
|
||||||
public class ApiAccountController : Controller
|
public class ApiAccountController : Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,15 @@ namespace Yavsc.Controllers
|
||||||
return View(model);
|
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
|
// POST: /Account/LogOff
|
||||||
[HttpPost(Constants.LogoutPath)]
|
[HttpPost(Constants.LogoutPath)]
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,9 @@ namespace Yavsc.Controllers
|
||||||
BankInfo = user.BankInfo,
|
BankInfo = user.BankInfo,
|
||||||
DiskUsage = user.DiskUsage,
|
DiskUsage = user.DiskUsage,
|
||||||
DiskQuota = user.DiskQuota,
|
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);
|
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
||||||
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == 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 long DiskUsage { get; set; }
|
||||||
|
|
||||||
public string DedicatedCalendarId { 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>
|
<h2>@ViewData["Title"].</h2>
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<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>
|
</p>
|
||||||
</div>
|
</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>]
|
asp-action="CHUN">@SR["Change"]</a>]
|
||||||
</dd>
|
</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) {
|
@if (Model.Roles.Count()>0) {
|
||||||
<dt>@SR["Roles"]:</dt>
|
<dt>@SR["Roles"]:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
<li><a asp-controller="CommandForms" asp-action="Index">Formulaires</a></li>
|
<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="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="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>
|
</ul>
|
||||||
</li>}
|
</li>}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue