Added user dates

pull/702/head
LukePulverenti Luke Pulverenti luke pulverenti 12 years ago
parent 75b015c864
commit 82be5ff50d

@ -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
};
}
}

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

@ -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
{

@ -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 = "Test User 2";
user.Name = "Scottisafool";
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);

@ -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; }
}
}

@ -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; }
}
}

Loading…
Cancel
Save