Port 7.7 - WIP

This commit is contained in:
Stephan
2017-09-19 15:51:47 +02:00
parent d54658009c
commit 9ed6576908
126 changed files with 3447 additions and 596 deletions

View File

@@ -1,15 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Runtime.Serialization;
using System.Web.Http;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Validation;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -57,6 +49,8 @@ namespace Umbraco.Web.Models.ContentEditing
/// </remarks>
[DataMember(Name = "allowedActions")]
public IEnumerable<string> AllowedActions { get; set; }
[DataMember(Name = "isBlueprint")]
public bool IsBlueprint { get; set; }
}
}

View File

@@ -1,20 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// Represents a section (application) in the back office
/// </summary>
[DataContract(Name = "section", Namespace = "")]
public class Section
{
[DataMember(Name = "name")]
public string Name { get; set; }
@@ -24,5 +17,11 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "alias")]
public string Alias { get; set; }
/// <summary>
/// In some cases a custom route path can be specified so that when clicking on a section it goes to this
/// path instead of the normal dashboard path
/// </summary>
[DataMember(Name = "routePath")]
public string RoutePath { get; set; }
}
}

View File

@@ -27,10 +27,14 @@ namespace Umbraco.Web.Models.ContentEditing
public string EmailHash { get; set; }
[Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ReadOnly(true)]
[DataMember(Name = "userType")]
public string UserType { get; set; }
public string UserType { get; set; }
[ReadOnly(true)]
[DataMember(Name = "userGroups")]
public string[] UserGroups { get; set; }
/// <summary>
/// Gets/sets the number of seconds for the user's auth ticket to expire

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
@@ -38,6 +39,40 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "resetPasswordValue")]
[ReadOnly(true)]
public string ResetPasswordValue { get; set; }
/// <summary>
/// A readonly value showing the user's current calculated start content ids
/// </summary>
[DataMember(Name = "calculatedStartContentIds")]
[ReadOnly(true)]
public IEnumerable<EntityBasic> CalculatedStartContentIds { get; set; }
/// <summary>
/// A readonly value showing the user's current calculated start media ids
/// </summary>
[DataMember(Name = "calculatedStartMediaIds")]
[ReadOnly(true)]
public IEnumerable<EntityBasic> CalculatedStartMediaIds { get; set; }
[DataMember(Name = "failedPasswordAttempts")]
[ReadOnly(true)]
public int FailedPasswordAttempts { get; set; }
[DataMember(Name = "lastLockoutDate")]
[ReadOnly(true)]
public DateTime LastLockoutDate { get; set; }
[DataMember(Name = "lastPasswordChangeDate")]
[ReadOnly(true)]
public DateTime LastPasswordChangeDate { get; set; }
[DataMember(Name = "createDate")]
[ReadOnly(true)]
public DateTime CreateDate { get; set; }
[DataMember(Name = "updateDate")]
[ReadOnly(true)]
public DateTime UpdateDate { get; set; }
}
}

View File

@@ -2,6 +2,8 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Configuration;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -18,7 +20,10 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "email", IsRequired = true)]
[Required]
[EmailAddress]
public string Email { get; set; }
public string Email { get; set; }
[DataMember(Name = "username")]
public string Username { get; set; }
[DataMember(Name = "message")]
public string Message { get; set; }
@@ -26,7 +31,10 @@ namespace Umbraco.Web.Models.ContentEditing
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (UserGroups.Any() == false)
yield return new ValidationResult("A user must be assigned to at least one group", new[] { "UserGroups" });
yield return new ValidationResult("A user must be assigned to at least one group", new[] { "UserGroups" });
if (UmbracoConfig.For.UmbracoSettings().Security.UsernameIsEmail == false && Username.IsNullOrWhiteSpace())
yield return new ValidationResult("A username cannot be empty", new[] { "Username" });
}
}
}