Avoid spaces in user names
[TODO] fix identity config
This commit is contained in:
@ -7,11 +7,14 @@ namespace Yavsc.Attributes.Validation
|
|||||||
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
|
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
|
||||||
public YaRegularExpression(string pattern): base (pattern)
|
public YaRegularExpression(string pattern): base (pattern)
|
||||||
{
|
{
|
||||||
this.ErrorMessage = pattern;
|
this.ErrorMessage = "RegularExpression: "+ pattern;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string FormatErrorMessage(string name)
|
public override string FormatErrorMessage(string name)
|
||||||
{
|
{
|
||||||
|
if (ErrorMessageResourceType==null || string.IsNullOrEmpty(ErrorMessageResourceName))
|
||||||
|
return ErrorMessage;
|
||||||
var prop = this.ErrorMessageResourceType.GetProperty(ErrorMessageResourceName);
|
var prop = this.ErrorMessageResourceType.GetProperty(ErrorMessageResourceName);
|
||||||
return (string) prop.GetValue(null, BindingFlags.Static, null, null, System.Globalization.CultureInfo.CurrentUICulture);
|
return (string) prop.GetValue(null, BindingFlags.Static, null, null, System.Globalization.CultureInfo.CurrentUICulture);
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ namespace Yavsc.Attributes.Validation
|
|||||||
}
|
}
|
||||||
public override string FormatErrorMessage(string name)
|
public override string FormatErrorMessage(string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
var temp = base.FormatErrorMessage(name);
|
var temp = base.FormatErrorMessage(name);
|
||||||
return string.Format(temp, MinimumLength, maxLen);
|
return string.Format(temp, MinimumLength, maxLen);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,9 @@ namespace Yavsc.Attributes.Validation
|
|||||||
public override string FormatErrorMessage(string name)
|
public override string FormatErrorMessage(string name)
|
||||||
{
|
{
|
||||||
if (ErrorMessageResourceType == null) // failed :/
|
if (ErrorMessageResourceType == null) // failed :/
|
||||||
|
{
|
||||||
return base.FormatErrorMessage(name);
|
return base.FormatErrorMessage(name);
|
||||||
|
}
|
||||||
if (ErrorMessageResourceName == null) // re failed :/
|
if (ErrorMessageResourceName == null) // re failed :/
|
||||||
return base.FormatErrorMessage(name);
|
return base.FormatErrorMessage(name);
|
||||||
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Yavsc.Attributes.Validation;
|
||||||
|
|
||||||
namespace Yavsc.ViewModels.Account
|
namespace Yavsc.ViewModels.Account
|
||||||
{
|
{
|
||||||
public class ExternalLoginConfirmationViewModel
|
public class ExternalLoginConfirmationViewModel
|
||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
|
[YaStringLength(2,Constants.MaxUserNameLength)]
|
||||||
|
[YaRegularExpression(Constants.UserNameRegExp)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
@ -504,7 +504,10 @@ namespace Yavsc.Controllers
|
|||||||
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
|
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
|
||||||
// Send an email with this link
|
// Send an email with this link
|
||||||
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||||
var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: "https");
|
var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code },
|
||||||
|
protocol: "https", host: Startup.Authority);
|
||||||
|
|
||||||
|
|
||||||
await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"],
|
await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"],
|
||||||
_localizer["Please reset your password by following this link:"] + " <" + callbackUrl + ">");
|
_localizer["Please reset your password by following this link:"] + " <" + callbackUrl + ">");
|
||||||
return View("ForgotPasswordConfirmation");
|
return View("ForgotPasswordConfirmation");
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
DESTDIR=/srv/www/yavscpre
|
DESTDIR=/var/www/yavscpre
|
||||||
PRODDESTDIR=/srv/www/yavsc
|
PRODDESTDIR=/var/www/yavsc
|
||||||
HOSTING=localhost
|
HOSTING=localhost
|
||||||
HOSTADMIN=root
|
|
||||||
ASPNET_LOG_LEVEL=debug
|
ASPNET_LOG_LEVEL=debug
|
||||||
SOURCE_DIR=$(HOME)/workspace/yavsc
|
SOURCE_DIR=$(HOME)/workspace/yavsc
|
||||||
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
|
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
|
||||||
@ -22,6 +21,13 @@ MINCSS=wwwroot/css/coiffure.min.css wwwroot/css/dev.min.css wwwroot/c
|
|||||||
web: project.lock.json
|
web: project.lock.json
|
||||||
ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) ASPNET_ENV=$(ASPNET_ENV) dnx web --configuration=$(CONFIGURATION)
|
ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) ASPNET_ENV=$(ASPNET_ENV) dnx web --configuration=$(CONFIGURATION)
|
||||||
|
|
||||||
|
showConfig:
|
||||||
|
@echo HOSTING: $(USER)@$(HOSTING)
|
||||||
|
@echo ENV: $(ASPNET_ENV)
|
||||||
|
@echo CONFIGURATION: $(CONFIGURATION)
|
||||||
|
@echo DESTDIR: $(DESTDIR)
|
||||||
|
@echo PRODDESTDIR: $(PRODDESTDIR)
|
||||||
|
|
||||||
status:
|
status:
|
||||||
ifeq ($(git_status),0)
|
ifeq ($(git_status),0)
|
||||||
@echo Nothing to be done.
|
@echo Nothing to be done.
|
||||||
@ -38,19 +44,19 @@ deploy-pkg: publish
|
|||||||
deploy: pushInPre pushInProd
|
deploy: pushInPre pushInProd
|
||||||
|
|
||||||
pushInPre: cleanoutput bin/output/wwwroot/version
|
pushInPre: cleanoutput bin/output/wwwroot/version
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo service kestrel-pre stop
|
ssh $(USER)@$(HOSTING) sudo service kestrel-pre stop
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo rm -rf $(DESTDIR)/approot
|
ssh $(USER)@$(HOSTING) sudo rm -rf $(DESTDIR)/approot
|
||||||
(cd bin/output && rsync -ravu ./ $(HOSTADMIN)@$(HOSTING):$(DESTDIR) >/dev/null)
|
(cd bin/output && rsync -ravu ./ $(USER)@$(HOSTING):$(DESTDIR) >/dev/null)
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo sync
|
ssh $(USER)@$(HOSTING) sudo sync
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo service kestrel-pre start
|
ssh $(USER)@$(HOSTING) sudo service kestrel-pre start
|
||||||
|
|
||||||
pushInProd: cleanoutput bin/output/wwwroot/version
|
pushInProd: cleanoutput bin/output/wwwroot/version
|
||||||
ifeq ($(git_status),0)
|
ifeq ($(git_status),0)
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo service kestrel stop
|
ssh $(USER)@$(HOSTING) sudo service kestrel stop
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo rm -rf $(PRODDESTDIR)/approot
|
ssh $(USER)@$(HOSTING) sudo rm -rf $(PRODDESTDIR)/approot
|
||||||
(cd bin/output && rsync -ravu ./ $(HOSTADMIN)@$(HOSTING):$(PRODDESTDIR) >/dev/null)
|
(cd bin/output && rsync -ravu ./ $(USER)@$(HOSTING):$(PRODDESTDIR) >/dev/null)
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo sync
|
ssh $(USER)@$(HOSTING) sudo sync
|
||||||
ssh $(HOSTADMIN)@$(HOSTING) sudo service kestrel start
|
ssh $(USER)@$(HOSTING) sudo service kestrel start
|
||||||
else
|
else
|
||||||
$(error EPRODANDGITSTATUS! Refus de pousser en production: des changements doivent être validés auprès du contrôle de versions.)
|
$(error EPRODANDGITSTATUS! Refus de pousser en production: des changements doivent être validés auprès du contrôle de versions.)
|
||||||
git status
|
git status
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<h2>@ViewData["Title"].</h2>
|
<h2>@ViewData["Title"].</h2>
|
||||||
<h3>Assoiciez votre compte @ViewData["LoginProvider"].</h3>
|
<h3>Associez votre compte @ViewData["LoginProvider"].</h3>
|
||||||
|
|
||||||
<form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
|
<form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
|
||||||
<h4>Formulaire d'Association</h4>
|
<h4>Formulaire d'Association</h4>
|
||||||
|
Reference in New Issue
Block a user