using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Oqtane.Models
{
///
/// Describes a User in Oqtane.
///
public class User : ModelBase, IDeletable
{
///
/// ID of this User.
///
public int UserId { get; set; }
///
/// Username used for login.
///
public string Username { get; set; }
///
/// Name shown in menus / dialogs etc.
///
public string DisplayName { get; set; }
///
/// User E-Mail address.
///
public string Email { get; set; }
///
/// Reference to a containing the users photo.
///
public int? PhotoFileId { get; set; }
///
/// Timestamp of last login.
///
public DateTime? LastLoginOn { get; set; }
///
/// IP address when the user last logged in to this site.
///
public string LastIPAddress { get; set; }
///
/// Indicates if the user requires 2 factor authentication to sign in
///
public bool TwoFactorRequired { get; set; }
///
/// Stores the 2 factor verification code
///
public string TwoFactorCode { get; set; }
///
/// The expiry date/time for the 2 factor verification code
///
public DateTime? TwoFactorExpiry { get; set; }
///
/// A token indicating if a user's security properties have been modified
///
[NotMapped]
public string SecurityStamp { get; set; }
///
/// Reference to the this user belongs to.
///
[NotMapped]
public int SiteId { get; set; }
///
/// Semi-colon delimited list of role names for the user
///
[NotMapped]
public string Roles { get; set; }
#region IDeletable Properties
public string DeletedBy { get; set; }
public DateTime? DeletedOn { get; set; }
public bool IsDeleted { get; set; }
#endregion
///
/// The users password. Note that this is not plaintext, so you can probably never really work with this.
///
[NotMapped]
public string Password { get; set; }
///
/// Information if this user is authenticated. Anonymous users are not authenticated.
///
[NotMapped]
public bool IsAuthenticated { get; set; }
///
/// The path name of the user's personal folder
///
[NotMapped]
public string FolderPath
{
get => "Users/" + UserId.ToString() + "/";
}
///
/// Information if this user's email address is confirmed (set during user creation)
///
[NotMapped]
public bool EmailConfirmed { get; set; }
///
/// Indicates if new user should be notified by email (set during user creation)
///
[NotMapped]
public bool SuppressNotification { get; set; }
///
/// Public User Settings
///
[NotMapped]
public Dictionary Settings { get; set; }
}
}