maps avatars in log
This commit is contained in:
@@ -23,33 +23,9 @@ namespace Umbraco.Core.Models
|
||||
EnableChangeTracking();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for creating an item that is returned from the database
|
||||
/// </summary>
|
||||
/// <param name="objectId"></param>
|
||||
/// <param name="comment"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="userAvatar"></param>
|
||||
public AuditItem(int objectId, string comment, AuditType type, int userId, string userName, string userAvatar)
|
||||
{
|
||||
DisableChangeTracking();
|
||||
|
||||
Id = objectId;
|
||||
Comment = comment;
|
||||
AuditType = type;
|
||||
UserId = userId;
|
||||
UserName = userName;
|
||||
UserAvatar = userAvatar;
|
||||
|
||||
EnableChangeTracking();
|
||||
}
|
||||
|
||||
public string Comment { get; private set; }
|
||||
public AuditType AuditType { get; private set; }
|
||||
public int UserId { get; private set; }
|
||||
public string UserName { get; private set; }
|
||||
public string UserAvatar { get; private set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,5 @@ namespace Umbraco.Core.Models
|
||||
string Comment { get; }
|
||||
AuditType AuditType { get; }
|
||||
int UserId { get; }
|
||||
string UserName { get; }
|
||||
string UserAvatar { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseAnnotations;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
|
||||
namespace Umbraco.Core.Models.Rdbms
|
||||
{
|
||||
/// <summary>
|
||||
/// object used for returning data from the umbracoLog table
|
||||
/// </summary>
|
||||
[TableName("umbracoLog")]
|
||||
[PrimaryKey("id")]
|
||||
[ExplicitColumns]
|
||||
internal class ReadOnlyLogDto
|
||||
{
|
||||
[Column("id")]
|
||||
[PrimaryKeyColumn]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("userId")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
[Column("NodeId")]
|
||||
public int NodeId { get; set; }
|
||||
|
||||
[Column("Datestamp")]
|
||||
public DateTime Datestamp { get; set; }
|
||||
|
||||
[Column("logHeader")]
|
||||
public string Header { get; set; }
|
||||
|
||||
[Column("logComment")]
|
||||
public string Comment { get; set; }
|
||||
|
||||
[ResultColumn("userName")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[ResultColumn("userAvatar")]
|
||||
public string UserAvatar { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -24,12 +24,11 @@ namespace Umbraco.Core.Models
|
||||
/// Tries to lookup the user's gravatar to see if the endpoint can be reached, if so it returns the valid URL
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="userService"></param>
|
||||
/// <param name="staticCache"></param>
|
||||
/// <returns>
|
||||
/// A list of 5 different sized avatar URLs
|
||||
/// </returns>
|
||||
internal static string[] GetCurrentUserAvatarUrls(this IUser user, IUserService userService, ICacheProvider staticCache)
|
||||
internal static string[] GetUserAvatarUrls(this IUser user, ICacheProvider staticCache)
|
||||
{
|
||||
//check if the user has explicitly removed all avatars including a gravatar, this will be possible and the value will be "none"
|
||||
if (user.Avatar == "none")
|
||||
|
||||
Reference in New Issue
Block a user