Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 858156bab2 | |||
| cf5dac0ddd | |||
| fa68f7fafe | |||
| 2ae96f3810 | |||
| f6045a49b5 | |||
| 1f66ebff1f | |||
| c4850199f7 | |||
| 02c609747d | |||
| 413e70db7d | |||
| c2cbac7ef9 | |||
| a4a079cd1b | |||
| 22fc9c617c | |||
| 0bcdfc8820 | |||
| b868c06e79 | |||
| fcfb9afc22 | |||
| 05818f6262 | |||
| 1788682af9 | |||
| a5f689385a | |||
| a551881ce2 | |||
| 1607e51270 | |||
| 2f31175db5 | |||
| 044b43f6e1 | |||
| c2722d8120 | |||
| 76725aa0d8 | |||
| 9178e7afcf | |||
| b18945e630 | |||
| 4640cf56d1 | |||
| eae1ce7012 | |||
| e900711180 | |||
| 040e45ca70 | |||
| bd3d626147 | |||
| 47d08e69a4 | |||
| df182674b4 | |||
| 6ec9a2ae45 | |||
| bf00f7a663 | |||
| 74d8341620 | |||
| 70207e5374 | |||
| 93f4d65227 | |||
| a4c0342bda | |||
| 095633ba27 | |||
| c63156fcd8 | |||
| 1f22191bbc | |||
| 25088042a9 | |||
| 1e8bdc8f0c | |||
| 5678be0db9 | |||
| 464a227af1 |
+2
-2
@@ -11,5 +11,5 @@ using System.Resources;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyFileVersion("7.7.11")]
|
||||
[assembly: AssemblyInformationalVersion("7.7.11")]
|
||||
[assembly: AssemblyFileVersion("7.7.13")]
|
||||
[assembly: AssemblyInformationalVersion("7.7.13")]
|
||||
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml.Linq;
|
||||
using ClientDependency.Core.CompositeFiles.Providers;
|
||||
using ClientDependency.Core.Config;
|
||||
using Semver;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
@@ -24,10 +28,74 @@ namespace Umbraco.Core.Configuration
|
||||
_logger = logger;
|
||||
_fileName = IOHelper.MapPath(string.Format("{0}/ClientDependency.config", SystemDirectories.Config));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the version number in ClientDependency.config to a hashed value for the version and the DateTime.Day
|
||||
/// </summary>
|
||||
/// <param name="version">The <see cref="SemVersion">version</see> of Umbraco we're upgrading to</param>
|
||||
/// <param name="date">A <see cref="DateTime">date</see> value to use in the hash to prevent this method from updating the version on each startup</param>
|
||||
/// <param name="dateFormat">Allows the developer to specify the <see cref="string">date precision</see> for the hash (i.e. "yyyyMMdd" would be a precision for the day)</param>
|
||||
/// <returns>Boolean to indicate succesful update of the ClientDependency.config file</returns>
|
||||
public bool UpdateVersionNumber(SemVersion version, DateTime date, string dateFormat)
|
||||
{
|
||||
var byteContents = Encoding.Unicode.GetBytes(version + date.ToString(dateFormat));
|
||||
|
||||
//This is a way to convert a string to a long
|
||||
//see https://www.codeproject.com/Articles/34309/Convert-String-to-bit-Integer
|
||||
//We could much more easily use MD5 which would create us an INT but since that is not compliant with
|
||||
//hashing standards we have to use SHA
|
||||
int intHash;
|
||||
using (var hash = SHA256.Create())
|
||||
{
|
||||
var bytes = hash.ComputeHash(byteContents);
|
||||
|
||||
var longResult = new[] { 0, 8, 16, 24 }
|
||||
.Select(i => BitConverter.ToInt64(bytes, i))
|
||||
.Aggregate((x, y) => x ^ y);
|
||||
|
||||
//CDF requires an INT, and although this isn't fail safe, it will work for our purposes. We are not hashing for crypto purposes
|
||||
//so there could be some collisions with this conversion but it's not a problem for our purposes
|
||||
//It's also important to note that the long.GetHashCode() implementation in .NET is this: return (int) this ^ (int) (this >> 32);
|
||||
//which means that this value will not change per appdomain like some GetHashCode implementations.
|
||||
intHash = longResult.GetHashCode();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var clientDependencyConfigXml = XDocument.Load(_fileName, LoadOptions.PreserveWhitespace);
|
||||
if (clientDependencyConfigXml.Root != null)
|
||||
{
|
||||
|
||||
var versionAttribute = clientDependencyConfigXml.Root.Attribute("version");
|
||||
|
||||
//Set the new version to the hashcode of now
|
||||
var oldVersion = versionAttribute.Value;
|
||||
var newVersion = Math.Abs(intHash).ToString();
|
||||
|
||||
//don't update if it's the same version
|
||||
if (oldVersion == newVersion)
|
||||
return false;
|
||||
|
||||
versionAttribute.SetValue(newVersion);
|
||||
clientDependencyConfigXml.Save(_fileName, SaveOptions.DisableFormatting);
|
||||
|
||||
_logger.Info<ClientDependencyConfiguration>(string.Format("Updated version number from {0} to {1}", oldVersion, newVersion));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error<ClientDependencyConfiguration>("Couldn't update ClientDependency version number", ex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the version number in ClientDependency.config to a random value to avoid stale caches
|
||||
/// </summary>
|
||||
/// <seealso cref="UpdateVersionNumber(SemVersion, DateTime, string)" />
|
||||
[Obsolete("Use the UpdateVersionNumber method specifying the version, date and dateFormat instead")]
|
||||
public bool IncreaseVersionNumber()
|
||||
{
|
||||
try
|
||||
@@ -107,4 +175,4 @@ namespace Umbraco.Core.Configuration
|
||||
return success;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.7.11");
|
||||
private static readonly Version Version = new Version("7.7.13");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -34,6 +34,15 @@ namespace Umbraco.Core.Models.Identity
|
||||
.ForMember(user => user.CalculatedContentStartNodeIds, expression => expression.MapFrom(user => user.CalculateContentStartNodeIds(applicationContext.Services.EntityService)))
|
||||
.ForMember(user => user.CalculatedMediaStartNodeIds, expression => expression.MapFrom(user => user.CalculateMediaStartNodeIds(applicationContext.Services.EntityService)))
|
||||
.ForMember(user => user.AllowedSections, expression => expression.MapFrom(user => user.AllowedSections.ToArray()))
|
||||
|
||||
.ForMember(user => user.LockoutEnabled, expression => expression.Ignore())
|
||||
.ForMember(user => user.Logins, expression => expression.Ignore())
|
||||
.ForMember(user => user.Roles, expression => expression.Ignore())
|
||||
.ForMember(user => user.PhoneNumber, expression => expression.Ignore())
|
||||
.ForMember(user => user.PhoneNumberConfirmed, expression => expression.Ignore())
|
||||
.ForMember(user => user.TwoFactorEnabled, expression => expression.Ignore())
|
||||
.ForMember(user => user.Claims, expression => expression.Ignore())
|
||||
|
||||
.AfterMap((user, identityUser) =>
|
||||
{
|
||||
identityUser.ResetDirtyProperties(true);
|
||||
@@ -60,4 +69,4 @@ namespace Umbraco.Core.Models.Identity
|
||||
return storedPass.StartsWith(Constants.Security.EmptyPasswordPrefix) ? null : storedPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias;
|
||||
|
||||
if (constructors.ContainsKey(typeName))
|
||||
throw new InvalidOperationException(string.Format("More that one type want to be a model for content type {0}.", typeName));
|
||||
throw new InvalidOperationException(string.Format("More than one type wants to be a model for content type {0}.", typeName));
|
||||
|
||||
// should work everywhere, but slow
|
||||
//_constructors[typeName] = constructor;
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace Umbraco.Tests
|
||||
[Test]
|
||||
public void ConvertToDateTimeTest()
|
||||
{
|
||||
var conv = "2016-06-07".TryConvertTo<DateTime?>();
|
||||
var conv = "2016-06-07".TryConvertTo<DateTime>();
|
||||
Assert.IsTrue(conv);
|
||||
Assert.AreEqual(new DateTime(2016, 6, 7), conv.Result);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ namespace Umbraco.Tests
|
||||
[Test]
|
||||
public void ConvertToNullableDateTimeTest()
|
||||
{
|
||||
var conv = "2016-06-07".TryConvertTo<DateTime>();
|
||||
var conv = "2016-06-07".TryConvertTo<DateTime?>();
|
||||
Assert.IsTrue(conv);
|
||||
Assert.AreEqual(new DateTime(2016, 6, 7), conv.Result);
|
||||
}
|
||||
|
||||
@@ -108,8 +108,9 @@ namespace Umbraco.Tests.TestHelpers
|
||||
var mappers = PluginManager.Current.FindAndCreateInstances<IMapperConfiguration>(
|
||||
specificAssemblies: new[]
|
||||
{
|
||||
typeof(ContentModelMapper).Assembly,
|
||||
typeof(ApplicationRegistrar).Assembly
|
||||
typeof(ApplicationContext).Assembly, //Umbraco.Core
|
||||
typeof(ContentModelMapper).Assembly, //Umbraco.Web
|
||||
typeof(ApplicationRegistrar).Assembly //umbraco.businesslogic
|
||||
});
|
||||
foreach (var mapper in mappers)
|
||||
{
|
||||
@@ -218,4 +219,4 @@ namespace Umbraco.Tests.TestHelpers
|
||||
|
||||
protected CacheHelper CacheHelper { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* @methodOf umbraco.resources.mediaResource
|
||||
*
|
||||
* @description
|
||||
* Empties the media recycle bin
|
||||
* Paginated search for media items starting on the supplied nodeId
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
@@ -506,7 +506,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* @param {string} query The search query
|
||||
* @param {int} pageNumber The page number
|
||||
* @param {int} pageSize The number of media items on a page
|
||||
* @param {int} searchFrom Id to search from
|
||||
* @param {int} searchFrom NodeId to search from (-1 for root)
|
||||
* @returns {Promise} resourcePromise object.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -243,7 +243,7 @@ ul.color-picker li a {
|
||||
|
||||
.umb-mediapicker .umb-sortable-thumbnails li {
|
||||
flex-direction: column;
|
||||
margin: 0 5px 0 0;
|
||||
margin: 0 5px 5px 0;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
@@ -282,8 +282,8 @@ ul.color-picker li a {
|
||||
}
|
||||
|
||||
.umb-sortable-thumbnails .umb-sortable-thumbnails__wrapper {
|
||||
width: 120px;
|
||||
height: 114px;
|
||||
width: 124px;
|
||||
height: 124px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -298,6 +298,12 @@ ul.color-picker li a {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.umb-sortable-thumbnails.ui-sortable:not(.ui-sortable-disabled) {
|
||||
> li:not(.unsortable) {
|
||||
cursor: move;
|
||||
}
|
||||
}
|
||||
|
||||
.umb-sortable-thumbnails li:hover .umb-sortable-thumbnails__actions {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
<div class="row form-search">
|
||||
<div class="span8 input-append">
|
||||
<input type="text" class="search-query" ng-model="searcher.searchText" no-dirty-check />
|
||||
<button type="button" class="btn btn-info" ng-click="search(searcher)" ng-disabled="searcher.isProcessing">Search</button>
|
||||
<button type="submit" class="btn btn-info" ng-click="search(searcher)" ng-disabled="searcher.isProcessing">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
+5
-2
@@ -136,10 +136,13 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl
|
||||
};
|
||||
|
||||
$scope.sortableOptions = {
|
||||
disabled: !$scope.isMultiPicker,
|
||||
items: "li:not(.add-wrapper)",
|
||||
cancel: ".unsortable",
|
||||
update: function(e, ui) {
|
||||
var r = [];
|
||||
//TODO: Instead of doing this with a half second delay would be better to use a watch like we do in the
|
||||
// content picker. THen we don't have to worry about setting ids, render models, models, we just set one and let the
|
||||
// TODO: Instead of doing this with a half second delay would be better to use a watch like we do in the
|
||||
// content picker. Then we don't have to worry about setting ids, render models, models, we just set one and let the
|
||||
// watch do all the rest.
|
||||
$timeout(function(){
|
||||
angular.forEach($scope.images, function(value, key) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<p ng-if="(images|filter:{trashed:true}).length == 1"><localize key="mediaPicker_pickedTrashedItem"></localize></p>
|
||||
<p ng-if="(images|filter:{trashed:true}).length > 1"><localize key="mediaPicker_pickedTrashedItems"></localize></p>
|
||||
|
||||
<div class="flex error">
|
||||
<div class="flex flex-wrap error">
|
||||
<ul ui-sortable="sortableOptions" ng-model="images" class="umb-sortable-thumbnails">
|
||||
<li class="umb-sortable-thumbnails__wrapper" ng-repeat="image in images track by $index">
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li style="border: none;">
|
||||
<a href="#" class="add-link" ng-click="add()" ng-class="{'add-link-square': (images.length === 0 || isMultiPicker)}" ng-if="showAdd()" prevent-default>
|
||||
<li class="add-wrapper unsortable" ng-if="showAdd()">
|
||||
<a href="#" class="add-link" ng-click="add()" ng-class="{'add-link-square': (images.length === 0 || isMultiPicker)}" prevent-default>
|
||||
<i class="icon icon-add large"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -973,7 +973,6 @@
|
||||
<Content Include="Umbraco\Masterpages\default.Master" />
|
||||
<Content Include="Umbraco\Webservices\TreeDataService.ashx" />
|
||||
<Content Include="Umbraco\Webservices\TagsAutoCompleteHandler.ashx" />
|
||||
<Content Include="Umbraco\Webservices\MediaUploader.ashx" />
|
||||
<None Include="web.Template.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -1023,9 +1022,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>7711</DevelopmentServerPort>
|
||||
<DevelopmentServerPort>7713</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:7711</IISUrl>
|
||||
<IISUrl>http://localhost:7713</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="MediaUploader.ashx.cs" Class="umbraco.presentation.umbraco.webservices.MediaUploader" %>
|
||||
@@ -45,8 +45,9 @@ namespace Umbraco.Web.Install.Controllers
|
||||
if (ApplicationContext.Current.IsUpgrading)
|
||||
{
|
||||
// Update ClientDependency version
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(ApplicationContext.Current.ProfilingLogger.Logger);
|
||||
var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber();
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration(_umbracoContext.Application.ProfilingLogger.Logger);
|
||||
var clientDependencyUpdated = clientDependencyConfig.UpdateVersionNumber(
|
||||
UmbracoVersion.GetSemanticVersion(), DateTime.UtcNow, "yyyyMMdd");
|
||||
// Delete ClientDependency temp directories to make sure we get fresh caches
|
||||
var clientDependencyTempFilesDeleted = clientDependencyConfig.ClearTempFiles(HttpContext);
|
||||
|
||||
|
||||
@@ -69,12 +69,12 @@ namespace Umbraco.Web.Mvc
|
||||
{
|
||||
if (UmbracoContext == null)
|
||||
{
|
||||
throw new NullReferenceException("There is not current UmbracoContext, it must be initialized before the RenderRouteHandler executes");
|
||||
throw new NullReferenceException("There is no current UmbracoContext, it must be initialized before the RenderRouteHandler executes");
|
||||
}
|
||||
var docRequest = UmbracoContext.PublishedContentRequest;
|
||||
if (docRequest == null)
|
||||
{
|
||||
throw new NullReferenceException("There is not current PublishedContentRequest, it must be initialized before the RenderRouteHandler executes");
|
||||
throw new NullReferenceException("There is no current PublishedContentRequest, it must be initialized before the RenderRouteHandler executes");
|
||||
}
|
||||
|
||||
SetupRouteDataForRequest(
|
||||
@@ -177,9 +177,9 @@ namespace Umbraco.Web.Mvc
|
||||
if (decodedParts.All(x => x.Key != ReservedAdditionalKeys.Area))
|
||||
return null;
|
||||
|
||||
foreach (var item in decodedParts.Where(x => new[] {
|
||||
ReservedAdditionalKeys.Controller,
|
||||
ReservedAdditionalKeys.Action,
|
||||
foreach (var item in decodedParts.Where(x => new[] {
|
||||
ReservedAdditionalKeys.Controller,
|
||||
ReservedAdditionalKeys.Action,
|
||||
ReservedAdditionalKeys.Area }.Contains(x.Key) == false))
|
||||
{
|
||||
// Populate route with additional values which aren't reserved values so they eventually to action parameters
|
||||
@@ -360,9 +360,9 @@ namespace Umbraco.Web.Mvc
|
||||
return new PublishedContentNotFoundHandler("In addition, no template exists to render the custom 404.");
|
||||
|
||||
// so we have a template, so we should have a rendering engine
|
||||
if (pcr.RenderingEngine == RenderingEngine.WebForms) // back to webforms ?
|
||||
if (pcr.RenderingEngine == RenderingEngine.WebForms) // back to webforms ?
|
||||
return GetWebFormsHandler();
|
||||
|
||||
|
||||
if (pcr.RenderingEngine != RenderingEngine.Mvc) // else ?
|
||||
return new PublishedContentNotFoundHandler("In addition, no rendering engine exists to render the custom 404.");
|
||||
|
||||
@@ -389,8 +389,8 @@ namespace Umbraco.Web.Mvc
|
||||
}
|
||||
|
||||
//Now we can check if we are supposed to render WebForms when the route has not been hijacked
|
||||
if (publishedContentRequest.RenderingEngine == RenderingEngine.WebForms
|
||||
&& publishedContentRequest.HasTemplate
|
||||
if (publishedContentRequest.RenderingEngine == RenderingEngine.WebForms
|
||||
&& publishedContentRequest.HasTemplate
|
||||
&& routeDef.HasHijackedRoute == false)
|
||||
{
|
||||
return GetWebFormsHandler();
|
||||
@@ -410,7 +410,7 @@ namespace Umbraco.Web.Mvc
|
||||
var handler = GetHandlerOnMissingTemplate(publishedContentRequest);
|
||||
|
||||
// if it's not null it can be either the PublishedContentNotFoundHandler (no document was
|
||||
// found to handle 404, or document with no template was found) or the WebForms handler
|
||||
// found to handle 404, or document with no template was found) or the WebForms handler
|
||||
// (a document was found and its template is WebForms)
|
||||
|
||||
// if it's null it means that a document was found and its template is Mvc
|
||||
@@ -460,6 +460,6 @@ namespace Umbraco.Web.Mvc
|
||||
return _controllerFactory.GetControllerSessionBehavior(requestContext, controllerName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -146,11 +146,11 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
switch (GetPublishedContentType(propertyType.DataTypeId))
|
||||
{
|
||||
case PublishedItemType.Media:
|
||||
contentFetcher = umbHelper.TypedMember;
|
||||
contentFetcher = umbHelper.TypedMedia;
|
||||
break;
|
||||
|
||||
case PublishedItemType.Member:
|
||||
contentFetcher = umbHelper.TypedMedia;
|
||||
contentFetcher = umbHelper.TypedMember;
|
||||
break;
|
||||
|
||||
case PublishedItemType.Content:
|
||||
|
||||
@@ -537,8 +537,16 @@ namespace Umbraco.Web
|
||||
|
||||
public IPublishedContent TypedMember(object id)
|
||||
{
|
||||
var asInt = id.TryConvertTo<int>();
|
||||
return asInt ? MembershipHelper.GetById(asInt.Result) : MembershipHelper.GetByProviderKey(id);
|
||||
int intId;
|
||||
if (ConvertIdObjectToInt(id, out intId))
|
||||
return MembershipHelper.GetById(intId);
|
||||
Guid guidId;
|
||||
if (ConvertIdObjectToGuid(id, out guidId))
|
||||
return TypedMember(guidId);
|
||||
Udi udiId;
|
||||
if (ConvertIdObjectToUdi(id, out udiId))
|
||||
return TypedMember(udiId);
|
||||
return null;
|
||||
}
|
||||
|
||||
public IPublishedContent TypedMember(int id)
|
||||
|
||||
Reference in New Issue
Block a user