Re-fabrication
This commit is contained in:
parent
f155a47073
commit
cb6309abdb
499 changed files with 7574 additions and 12530 deletions
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Account {
|
||||
public class ChangePasswordBindingModel {
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string NewPassword { get; set; }
|
||||
}
|
||||
public class SetPasswordBindingModel {
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class ExternalLoginConfirmationViewModel
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
12
Yavsc.Server/ViewModels/Account/ForgotPasswordViewModel.cs
Normal file
12
Yavsc.Server/ViewModels/Account/ForgotPasswordViewModel.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class ForgotPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[StringLength(512)]
|
||||
public string LoginOrEmail { get; set; }
|
||||
}
|
||||
}
|
||||
54
Yavsc.Server/ViewModels/Account/LoginViewModel.cs
Executable file
54
Yavsc.Server/ViewModels/Account/LoginViewModel.cs
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNet.Http.Authentication;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class SignInViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Local user's name.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Local user's password .
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When true, asks for a two-factor identification
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Display(Name = "Se souvenir de moi?")]
|
||||
public bool RememberMe { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the authentication provider'name chosen to authenticate,
|
||||
/// contains "LOCAL" to choose the local application identity
|
||||
/// and user password credentials.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Provider { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This value does NOT indicate the OAuth client method recieving the code,
|
||||
/// but the one called once authorized.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Lists external identity provider descriptions.
|
||||
/// </summary>
|
||||
/// <returns>an enumeration of the descriptions.</returns>
|
||||
public IEnumerable<AuthenticationDescription> ExternalProviders { get; set; }
|
||||
}
|
||||
}
|
||||
39
Yavsc.Server/ViewModels/Account/Me.cs
Normal file
39
Yavsc.Server/ViewModels/Account/Me.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public class Me : IApplicationUser {
|
||||
public Me(ApplicationUser user)
|
||||
{
|
||||
Id = user.Id;
|
||||
UserName = user.UserName;
|
||||
EMail = user.Email;
|
||||
Avatar = user.Avatar;
|
||||
PostalAddress = user.PostalAddress;
|
||||
DedicatedGoogleCalendar = user.DedicatedGoogleCalendar;
|
||||
}
|
||||
public string Id { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string[] Roles { get; set; }
|
||||
/// <summary>
|
||||
/// Known as profile, could point to an avatar
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Avatar { get; set; }
|
||||
|
||||
public IAccountBalance AccountBalance
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string DedicatedGoogleCalendar
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ILocation PostalAddress
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
36
Yavsc.Server/ViewModels/Account/RegisterViewModel.cs
Normal file
36
Yavsc.Server/ViewModels/Account/RegisterViewModel.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class RegisterViewModel
|
||||
{
|
||||
// ErrorMessage = "",
|
||||
|
||||
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "UserName")]
|
||||
[StringLength(102)]
|
||||
[YaRegularExpression(@"[a-zA-Z0-9 .'_-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation))]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[YaRequired()]
|
||||
// [EmailAddress]
|
||||
[Display(Name = "Email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[StringLength(100, MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
|
||||
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
|
||||
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "Password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "PasswordConfirm")]
|
||||
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation) )]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
public string GoogleRegId { get; set; }
|
||||
}
|
||||
}
|
||||
23
Yavsc.Server/ViewModels/Account/ResetPasswordViewModel.cs
Normal file
23
Yavsc.Server/ViewModels/Account/ResetPasswordViewModel.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class ResetPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "Le {0} doit être long d'au moins {2} caractères.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Confirmer le mot de passe")]
|
||||
[Compare("Password", ErrorMessage = "Le mot de passe et sa confirmation ne sont pas les mêmes.")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
}
|
||||
}
|
||||
16
Yavsc.Server/ViewModels/Account/SendCodeViewModel.cs
Normal file
16
Yavsc.Server/ViewModels/Account/SendCodeViewModel.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class SendCodeViewModel
|
||||
{
|
||||
public string SelectedProvider { get; set; }
|
||||
|
||||
public ICollection<SelectListItem> Providers { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
}
|
||||
11
Yavsc.Server/ViewModels/Account/ShortUserInfo.cs
Normal file
11
Yavsc.Server/ViewModels/Account/ShortUserInfo.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class ShortUserInfo
|
||||
{
|
||||
public string Avatar { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
}
|
||||
8
Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs
Normal file
8
Yavsc.Server/ViewModels/Account/UnregisterViewModel.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class UnregisterViewModel
|
||||
{
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
21
Yavsc.Server/ViewModels/Account/VerifyCodeViewModel.cs
Normal file
21
Yavsc.Server/ViewModels/Account/VerifyCodeViewModel.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class VerifyCodeViewModel
|
||||
{
|
||||
[Required]
|
||||
public string Provider { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Code { get; set; }
|
||||
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
[Display(Name = "Se souvenir de ce navigateur?")]
|
||||
public bool RememberBrowser { get; set; }
|
||||
|
||||
[Display(Name = "Se souvenir de moi?")]
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue