Added user dates

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-09-06 16:29:33 -04:00
parent 75b015c864
commit 82be5ff50d
6 changed files with 26 additions and 11 deletions

View File

@ -293,7 +293,9 @@ namespace MediaBrowser.Api
Id = user.Id,
Name = user.Name,
HasImage = !string.IsNullOrEmpty(user.PrimaryImagePath),
HasPassword = !string.IsNullOrEmpty(user.Password)
HasPassword = !string.IsNullOrEmpty(user.Password),
LastActivityDate = user.LastActivityDate,
LastLoginDate = user.LastLoginDate
};
}
}

View File

@ -19,7 +19,7 @@ namespace MediaBrowser.Api.HttpHandlers
return new AuthenticationResult()
{
Success = true
Success = Kernel.GetMD5(password).Equals(user.Password)
};
}
}

View File

@ -2,12 +2,12 @@
using System.IO;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Weather;
using System.Text;
namespace MediaBrowser.ApiInteraction
{

View File

@ -240,17 +240,20 @@ namespace MediaBrowser.Controller
list.Add(user);
user = new User();
user.Name = "Test User 1";
user.Name = "Abobader";
user.Id = Guid.NewGuid();
user.LastLoginDate = DateTime.Now.AddDays(-1);
user.LastActivityDate = DateTime.Now.AddHours(-3);
user.Password = GetMD5("1234").ToString();
list.Add(user);
user = new User();
user.Name = "Scottisafool";
user.Id = Guid.NewGuid();
list.Add(user);
user = new User();
user.Name = "Test User 2";
user.Id = Guid.NewGuid();
list.Add(user);
user = new User();
user.Name = "Test User 3";
user.Name = "Redshirt";
user.Id = Guid.NewGuid();
list.Add(user);

View File

@ -17,5 +17,11 @@ namespace MediaBrowser.Model.DTO
[ProtoMember(4)]
public bool HasPassword { get; set; }
[ProtoMember(5)]
public DateTime? LastLoginDate { get; set; }
[ProtoMember(6)]
public DateTime? LastActivityDate { get; set; }
}
}

View File

@ -1,4 +1,5 @@

using System;
namespace MediaBrowser.Model.Entities
{
public class User : BaseEntity
@ -13,5 +14,8 @@ namespace MediaBrowser.Model.Entities
{
RecentItemDays = 14;
}
public DateTime? LastLoginDate { get; set; }
public DateTime? LastActivityDate { get; set; }
}
}