2023-02-19 00:43:43 +01:00
|
|
|
|
using PrivaPub.ClientModels.Resources;
|
2023-02-18 08:52:17 +01:00
|
|
|
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
2023-02-19 00:43:43 +01:00
|
|
|
|
namespace PrivaPub.ClientModels.User
|
2023-02-18 08:52:17 +01:00
|
|
|
|
{
|
|
|
|
|
public class UserForm
|
|
|
|
|
{
|
|
|
|
|
[EmailAddress(ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
Display(Name = "Email", ResourceType = typeof(FieldsNameResource))]
|
|
|
|
|
public string Email { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UserPasswordForm
|
|
|
|
|
{
|
|
|
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
PasswordPropertyText(true),
|
|
|
|
|
Display(Name = "OldPassword", ResourceType = typeof(FieldsNameResource)),
|
|
|
|
|
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
|
|
|
public string OldPassword { get; set; }
|
|
|
|
|
|
|
|
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
PasswordPropertyText(true),
|
|
|
|
|
Display(Name = "NewPassword", ResourceType = typeof(FieldsNameResource)),
|
|
|
|
|
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
|
|
|
public string NewPassword { get; set; }
|
|
|
|
|
|
|
|
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
PasswordPropertyText(true),
|
|
|
|
|
Compare(nameof(NewPassword), ErrorMessageResourceName = "ComparePasswords", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
|
|
|
Display(Name = "NewPasswordConfirmation", ResourceType = typeof(FieldsNameResource))]
|
|
|
|
|
public string RepeatedPassword { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|