files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 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; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class ForgotPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[StringLength(512)]
|
||||
public string LoginOrEmail { get; set; }
|
||||
}
|
||||
}
|
||||
60
src/Yavsc.Server/ViewModels/Account/LoginViewModel.cs
Executable file
60
src/Yavsc.Server/ViewModels/Account/LoginViewModel.cs
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
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<YaAuthenticationDescription> ExternalProviders { get; set; }
|
||||
}
|
||||
|
||||
public class YaAuthenticationDescription {
|
||||
public string DisplayName { get; set; }
|
||||
public string AuthenticationScheme { get; set; }
|
||||
|
||||
public IDictionary<string,object> Items { get; set; }
|
||||
}
|
||||
}
|
||||
41
src/Yavsc.Server/ViewModels/Account/Me.cs
Normal file
41
src/Yavsc.Server/ViewModels/Account/Me.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using Yavsc.Abstract.Identity;
|
||||
|
||||
namespace Yavsc.Models.Auth
|
||||
{
|
||||
public class Me : IApplicationUser {
|
||||
public Me(string userId, string userName, string email, string avatar, ILocation address, string gCalId)
|
||||
{
|
||||
Id = userId;
|
||||
UserName = userName;
|
||||
EMail = email;
|
||||
Avatar = avatar;
|
||||
PostalAddress = address;
|
||||
DedicatedGoogleCalendar = gCalId;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
32
src/Yavsc.Server/ViewModels/Account/RegisterViewModel.cs
Normal file
32
src/Yavsc.Server/ViewModels/Account/RegisterViewModel.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
using Yavsc;
|
||||
public class RegisterViewModel
|
||||
{
|
||||
|
||||
[StringLength(102)]
|
||||
[YaRegularExpression(Constants.UserNameRegExp)]
|
||||
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.")]
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
[DataType(DataType.Password)]
|
||||
[Compare("Password")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
11
src/Yavsc.Server/ViewModels/Account/ShortUserInfo.cs
Normal file
11
src/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; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
namespace Yavsc.ViewModels.Account
|
||||
{
|
||||
public class UnregisterViewModel
|
||||
{
|
||||
public string ReturnUrl { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
21
src/Yavsc.Server/ViewModels/Account/VerifyCodeViewModel.cs
Normal file
21
src/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