Merge remote-tracking branch 'origin/v9/dev' into v10/dev

# Conflicts:
#	.github/workflows/codeql-analysis.yml
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
This commit is contained in:
Bjarke Berg
2022-01-23 13:46:10 +01:00
184 changed files with 4162 additions and 690 deletions

View File

@@ -0,0 +1,12 @@
using System;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
public interface ITwoFactorLogin: IEntity, IRememberBeingDirty
{
string ProviderName { get; }
string Secret { get; }
Guid UserOrMemberKey { get; }
}
}

View File

@@ -68,12 +68,15 @@ namespace Umbraco.Extensions
switch (storageType)
{
case TagsStorageType.Csv:
property.SetValue(string.Join(delimiter.ToString(), currentTags.Union(trimmedTags)), culture); // csv string
property.SetValue(string.Join(delimiter.ToString(), currentTags.Union(trimmedTags)).NullOrWhiteSpaceAsNull(), culture); // csv string
break;
case TagsStorageType.Json:
var updatedTags = currentTags.Union(trimmedTags).ToArray();
var updatedValue = updatedTags.Length == 0 ? null : serializer.Serialize(updatedTags);
property.SetValue(updatedValue, culture); // json array
break;
property.SetValue(serializer.Serialize(currentTags.Union(trimmedTags).ToArray()), culture); // json array
break;
}
}
else
@@ -81,7 +84,7 @@ namespace Umbraco.Extensions
switch (storageType)
{
case TagsStorageType.Csv:
property.SetValue(string.Join(delimiter.ToString(), trimmedTags), culture); // csv string
property.SetValue(string.Join(delimiter.ToString(), trimmedTags).NullOrWhiteSpaceAsNull(), culture); // csv string
break;
case TagsStorageType.Json:
@@ -124,11 +127,13 @@ namespace Umbraco.Extensions
switch (storageType)
{
case TagsStorageType.Csv:
property.SetValue(string.Join(delimiter.ToString(), currentTags.Except(trimmedTags)), culture); // csv string
property.SetValue(string.Join(delimiter.ToString(), currentTags.Except(trimmedTags)).NullOrWhiteSpaceAsNull(), culture); // csv string
break;
case TagsStorageType.Json:
property.SetValue(serializer.Serialize(currentTags.Except(trimmedTags).ToArray()), culture); // json array
var updatedTags = currentTags.Except(trimmedTags).ToArray();
var updatedValue = updatedTags.Length == 0 ? null : serializer.Serialize(updatedTags);
property.SetValue(updatedValue, culture); // json array
break;
}
}
@@ -160,7 +165,7 @@ namespace Umbraco.Extensions
case TagsStorageType.Json:
try
{
return serializer.Deserialize<string[]>(value).Select(x => x.ToString().Trim());
return serializer.Deserialize<string[]>(value).Select(x => x.Trim());
}
catch (Exception)
{

View File

@@ -0,0 +1,13 @@
using System;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
public class TwoFactorLogin : EntityBase, ITwoFactorLogin
{
public string ProviderName { get; set; }
public string Secret { get; set; }
public Guid UserOrMemberKey { get; set; }
public bool Confirmed { get; set; }
}
}