traductions
This commit is contained in:
@ -15,6 +15,7 @@ using Yavsc.Models;
|
||||
using Yavsc.Services;
|
||||
using Yavsc.ViewModels.Account;
|
||||
using Yavsc.Helpers;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
@ -30,6 +31,8 @@ namespace Yavsc.Controllers
|
||||
SmtpSettings _smtpSettings;
|
||||
TwilioSettings _twilioSettings;
|
||||
|
||||
IStringLocalizer _localizer;
|
||||
|
||||
// TwilioSettings _twilioSettings;
|
||||
|
||||
public AccountController(
|
||||
@ -38,7 +41,8 @@ namespace Yavsc.Controllers
|
||||
IEmailSender emailSender,
|
||||
IOptions<SiteSettings> siteSettings,
|
||||
IOptions<SmtpSettings> smtpSettings,
|
||||
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings)
|
||||
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings,
|
||||
IStringLocalizer localizer)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
@ -49,6 +53,7 @@ namespace Yavsc.Controllers
|
||||
_smtpSettings = smtpSettings.Value;
|
||||
_twilioSettings = twilioSettings.Value;
|
||||
_logger = loggerFactory.CreateLogger<AccountController>();
|
||||
_localizer = localizer;
|
||||
|
||||
}
|
||||
|
||||
@ -335,10 +340,14 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = await _userManager.FindByNameAsync(model.Email);
|
||||
var user = await _userManager.FindByEmailAsync(model.Email);
|
||||
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
|
||||
{
|
||||
// Don't reveal that the user does not exist or is not confirmed
|
||||
if (user == null)
|
||||
_logger.LogWarning($"ForgotPassword: Email {model.Email} not found");
|
||||
else
|
||||
_logger.LogWarning($"ForgotPassword: Email {model.Email} not confirmed");
|
||||
return View("ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
@ -346,8 +355,8 @@ namespace Yavsc.Controllers
|
||||
// Send an email with this link
|
||||
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||
var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
|
||||
await _emailSender.SendEmailAsync(_siteSettings,_smtpSettings,model.Email, "Reset Password",
|
||||
"Please reset your password by clicking here: <a href=\"" + callbackUrl + "\">link</a>");
|
||||
await _emailSender.SendEmailAsync(_siteSettings,_smtpSettings,model.Email, _localizer["Reset Password"],
|
||||
_localizer["Please reset your password by followin this link:"] + callbackUrl );
|
||||
return View("ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
@ -366,7 +375,7 @@ namespace Yavsc.Controllers
|
||||
//
|
||||
// GET: /Account/ResetPassword
|
||||
[HttpGet]
|
||||
public IActionResult ResetPassword(string code = null)
|
||||
public IActionResult ResetPassword(string UserId, string code = null)
|
||||
{
|
||||
return code == null ? View("Error") : View();
|
||||
}
|
||||
@ -381,7 +390,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
var user = await _userManager.FindByNameAsync(model.Email);
|
||||
var user = await _userManager.FindByEmailAsync(model.Email);
|
||||
if (user == null)
|
||||
{
|
||||
// Don't reveal that the user does not exist
|
||||
|
@ -251,9 +251,11 @@
|
||||
<data name="Person"><value>Person</value></data>
|
||||
<data name="Photo"><value>Photo</value></data>
|
||||
<data name="PhotoUpdated"><value>Photo updated</value></data>
|
||||
<data name="PleaseCheckYourEmail"><value>Please check your email to reset your password.</value></data>
|
||||
<data name="PleaseConfirmYourNewPassword"><value>Please confirm your new password</value></data>
|
||||
<data name="PleaseFillInABody"><value>Please fill in a body</value></data>
|
||||
<data name="PleaseFillInAReason"><value>Please, fill in a reason</value></data>
|
||||
|
||||
<data name="Posted"><value>Posted</value></data>
|
||||
<data name="PreferedDate"><value>Prefered date</value></data>
|
||||
<data name="prestation"><value>prestation</value></data>
|
||||
|
@ -194,6 +194,7 @@
|
||||
<data name="EndDate"><value>Date de fin</value></data>
|
||||
<data name="EndHour"><value>Heure de fin</value></data>
|
||||
<data name="email"><value>e-mail</value></data>
|
||||
<data name="Enter your email."><value>Saisissez votre email.</value></data>
|
||||
<data name="entries"><value>entrées</value></data>
|
||||
<data name="Estimate"><value>Estimer</value></data>
|
||||
<data name="Estimate_not_found"><value>Devis non trouvé</value></data>
|
||||
@ -205,8 +206,8 @@
|
||||
<data name="FillInAFutureDate"><value>Veuillez, s'il vous plait, utiliser une date future.</value></data>
|
||||
<data name="Fill in your book query"><value>Saisissez votre demande de rendez-vous</value></data>
|
||||
<data name="Forbidden"><value>Contenu à accès restreint</value></data>
|
||||
|
||||
<data name="Forgot your password"><value>Mot de passe oublié</value></data>
|
||||
<data name="Forgot your password?"><value>Mot de passe perdu?</value></data>
|
||||
<data name="Forgot Password Confirmation."><value>Confirmation mot de passe perdu.</value></data>
|
||||
<data name="from"><value>provenant de</value></data>
|
||||
<data name="GCM Notification sending failed"><value>L'envoi du message push a échoué</value></data>
|
||||
<data name="GCM Notifications sent"><value>Message push envoyé</value></data>
|
||||
@ -273,9 +274,11 @@
|
||||
<data name="Person"><value>Personne</value></data>
|
||||
<data name="Photo"><value>Photo</value></data>
|
||||
<data name="PhotoUpdated"><value>Photo mise à jour</value></data>
|
||||
<data name="PleaseCheckYourEmail"><value>S'il vous plait, veuillez verifier votre boite au lettres, pour pouvoir ré-initialiser votre mot de passe.</value></data>
|
||||
<data name="PleaseConfirmYourNewPassword"><value>S'il vous plait, veuillez confirmer votre nouveau mot de passe.</value></data>
|
||||
<data name="PleaseFillInABody"><value>S'il vous plait, saisissez un corps de message</value></data>
|
||||
<data name="PleaseFillInAReason"><value>S'il vous plait, saisissez une réson, un sujet pour votre message</value></data>
|
||||
<data name="Please reset your password by following this link:"><value>Veuillez s'il vous plait utiliser le lien suivant pour ré-initialiser votre mot de passe:</value></data>
|
||||
<data name="Posted"><value>Posté</value></data>
|
||||
<data name="PreferedDate"><value>Date souhaitée</value></data>
|
||||
<data name="PresationLocation"><value>Lieu de la présation: {0}.\n</value></data>
|
||||
@ -297,7 +300,7 @@
|
||||
<data name="Remove"><value>Supprimer</value></data>
|
||||
<data name="Remove my professional profile"><value>Supprimer mon profile professionnel</value></data>
|
||||
<data name="Role"><value>Rôle</value></data>
|
||||
<data name="ResetPassword"><value>Ré-initialiser votre mot de passe</value></data>
|
||||
<data name="Reset Password"><value>Ré-initialiser votre mot de passe</value></data>
|
||||
<data name="role created"><value>Rôle créé</value></data>
|
||||
<data name="RoleName"><value>Nom du rôle </value></data>
|
||||
<data name="Save these settings"><value>Save these settings</value></data>
|
||||
@ -357,5 +360,4 @@
|
||||
<data name="YourPosts"><value>Vos publications</value></data>
|
||||
<data name="YourProfile"><value>Votre profile</value></data>
|
||||
<data name="YourMessageHasBeenSent"><value>Votre messge a été envoyé</value></data>
|
||||
|
||||
</root>
|
||||
|
@ -1,12 +1,12 @@
|
||||
@model ForgotPasswordViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Forgot your password?";
|
||||
ViewData["Title"] = SR["Forgot your password?"];
|
||||
}
|
||||
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
|
||||
<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal" role="form">
|
||||
<h4>Enter your email.</h4>
|
||||
<h4>@SR["Enter your email."]</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<button type="submit" class="btn btn-default">Submit</button>
|
||||
<button type="submit" class="btn btn-default">@SR["Submit"]</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,8 +1,8 @@
|
||||
@{
|
||||
ViewData["Title"] = "Forgot Password Confirmation";
|
||||
ViewData["Title"] = @SR["Forgot Password Confirmation."];
|
||||
}
|
||||
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<p>
|
||||
Please check your email to reset your password.
|
||||
@SR["PleaseCheckYourEmail"]
|
||||
</p>
|
||||
|
@ -45,7 +45,7 @@
|
||||
<a asp-action="Register" asp-controller="Account">@SR["Register as a new user"]?</a>
|
||||
</p>
|
||||
<p>
|
||||
<a asp-action="ForgotPassword" asp-controller="Account">@SR["Forgot your password"]?</a>
|
||||
<a asp-action="ForgotPassword" asp-controller="Account">@SR["Forgot your password?"]</a>
|
||||
</p>
|
||||
<input type="hidden" name="Provider" value="LOCAL" />
|
||||
<input type="hidden" name="ReturnUrl" value="@Model.ReturnUrl" />
|
||||
|
Reference in New Issue
Block a user