Compare commits
226 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c4403f892 | |||
| fd66f08520 | |||
| 8e50f4968f | |||
| 9acbe09449 | |||
| 4baaafd006 | |||
| 3f7293304d | |||
| f62581bd38 | |||
| 9782e3711e | |||
| 1f4ba9cfdc | |||
| ba4f0cc6a4 | |||
| fc84821e8b | |||
| 0fcf0b505a | |||
| d300146cf6 | |||
| c8482b9f59 | |||
| b7795e19ef | |||
| c97617f5b5 | |||
| 14265fc964 | |||
| 18c3345e47 | |||
| 924a016ffe | |||
| a02b41e9d2 | |||
| 068c4a0b16 | |||
| f7d28d769a | |||
| 9a07e206d8 | |||
| 0edb71f4aa | |||
| b376207ef6 | |||
| 6d0aa824ad | |||
| 89afacf161 | |||
| 0fa6940bb6 | |||
| 1353b0a592 | |||
| 617fec171f | |||
| 2c63866cb3 | |||
| 18d3aa9ee2 | |||
| f83c966e55 | |||
| de41a1f1ca | |||
| c9f57c6ce3 | |||
| 54ab26e2ed | |||
| 31dc1b2cdb | |||
| d4b9a711c6 | |||
| 9521742254 | |||
| 9fee3f5873 | |||
| cb10578e19 | |||
| cdc4435f2d | |||
| a885840b9f | |||
| 62173cef58 | |||
| e5b0a4d98c | |||
| 9479d63cba | |||
| 4c544acb42 | |||
| c7c5f481f1 | |||
| 5e8e62cbf7 | |||
| 555b520a0c | |||
| 8053db32b6 | |||
| 3e2d59e526 | |||
| 9d3e967c2a | |||
| 71ec09486d | |||
| 8dadc92aa8 | |||
| f472f5d950 | |||
| 775a6f80ea | |||
| 5bf8b8ecba | |||
| 397ef32665 | |||
| 2634e33f51 | |||
| 6e27caa547 | |||
| 9c027dcdbc | |||
| f3876b86dc | |||
| 58c3dfac1c | |||
| dcf59d2b17 | |||
| 71099514cb | |||
| 887111318f | |||
| bf9755b27c | |||
| aca181b32e | |||
| 886347e763 | |||
| 9fa606e065 | |||
| e40ac44afd | |||
| 48603fb840 | |||
| f824439180 | |||
| b3616c9f8c | |||
| 48383f2e7a | |||
| cb98385242 | |||
| 916bad82df | |||
| 29ec8cb2d3 | |||
| 04900337c7 | |||
| 1433685160 | |||
| c5994ed54a | |||
| 9fd80d791a | |||
| f5f9cb676c | |||
| 04e2d2370a | |||
| 8d00d931b0 | |||
| 2998ad8cea | |||
| 46c15ef28f | |||
| 2b369a57d8 | |||
| c37a6bb928 | |||
| 6e53291877 | |||
| bb78f756c7 | |||
| ffb0de4050 | |||
| 0fecad9867 | |||
| 3045068d68 | |||
| 37a6668313 | |||
| 36814d746f | |||
| a72f6edb6b | |||
| e01cbcd405 | |||
| 012ed6cf16 | |||
| eb3ff12916 | |||
| 1ebff69358 | |||
| 5435c44ea9 | |||
| 76fa477c35 | |||
| 1f6f36d8c8 | |||
| c46ac11125 | |||
| 73d5a3f993 | |||
| 5a99a6903d | |||
| 775639da41 | |||
| 2375ede161 | |||
| fcd00599da | |||
| d3f5090150 | |||
| 6a7faf457b | |||
| ec247d2b27 | |||
| f32479bb10 | |||
| 371269436f | |||
| ef13e4112f | |||
| ce5b6861bb | |||
| eaf64d1814 | |||
| 6bf1ecdb11 | |||
| fdd0ff2c23 | |||
| bade8e42ba | |||
| cfdf2768e6 | |||
| c3ca006f14 | |||
| 6c47c8f792 | |||
| 63160e2e2d | |||
| edc58fe8a5 | |||
| 23632dc0c3 | |||
| d739b9fb31 | |||
| 2ae4ede258 | |||
| cacd08b57c | |||
| 4eddfb4cf5 | |||
| f2b3d7c041 | |||
| 5d97a94dcb | |||
| de6e7dd28d | |||
| 420c029bf7 | |||
| 61441dd436 | |||
| 5c24867925 | |||
| 0409cbe613 | |||
| bbbea99ced | |||
| 3d213342bf | |||
| 48fdb75d96 | |||
| a97094458d | |||
| f81353af0b | |||
| f0e1460550 | |||
| d15c09ad2a | |||
| 5813202892 | |||
| 82f6b6a66d | |||
| eec6ee79aa | |||
| 5ed4f262cd | |||
| e5d7f6fd04 | |||
| a9ad0ae8eb | |||
| 9cd64a9061 | |||
| 839c0d011b | |||
| 15c9aadcdc | |||
| 36a1c0a9e0 | |||
| 30f0c96052 | |||
| cfab30a1ef | |||
| 1dd0086eb5 | |||
| a7f06ebc56 | |||
| 9498bc4bfd | |||
| 38b13bf6ce | |||
| c8cb5b26b0 | |||
| 5749f80a7f | |||
| 5d9a935621 | |||
| 1ff4fe26dd | |||
| bd69820028 | |||
| 3c9953979a | |||
| 2f6189ae24 | |||
| 5ff329778d | |||
| befb2b4d2f | |||
| f4ae45d8f2 | |||
| 7b73ed1796 | |||
| 0eacbcb7cb | |||
| f871de61d5 | |||
| e02693e46b | |||
| db62d14b1a | |||
| c096ab9e54 | |||
| ada5a031b4 | |||
| 9c8b9f8bb4 | |||
| a4bd3abfbe | |||
| a8a768a50f | |||
| 62b99ffc59 | |||
| 6b0c94948e | |||
| 25f049e167 | |||
| f7979fa19d | |||
| 6fd1784337 | |||
| a7bb8e0d00 | |||
| ed4a9f84f0 | |||
| 4796827f02 | |||
| c6f7ece764 | |||
| e86aaefaaf | |||
| 97e9cd4be0 | |||
| 63af822bad | |||
| b65f653c91 | |||
| 3b404a2f76 | |||
| e9567e7adc | |||
| 697daab4d7 | |||
| 6c29ad854c | |||
| 93d89535aa | |||
| eb093ca4a6 | |||
| 1040f234dc | |||
| 3f835fe19c | |||
| bf43ce3281 | |||
| c37ba0dc8a | |||
| 7b5ad9a5c6 | |||
| f0afa701bc | |||
| 71dc1110d8 | |||
| 4de4eb9cc8 | |||
| 308d5ba344 | |||
| 74dac71e8a | |||
| 64518774c6 | |||
| f65b0df3e2 | |||
| 5cfe9e85f8 | |||
| 61044b6018 | |||
| 00fc5a5bb2 | |||
| 3f23865e0a | |||
| aac208c0e8 | |||
| f8e101ec13 | |||
| 23fcc1ac55 | |||
| 6356531207 | |||
| e9ef9b9d75 | |||
| dba7bcf60a | |||
| 1584530615 | |||
| 100ca5caa6 | |||
| 0288d6ec89 |
@@ -131,3 +131,4 @@ src/*.boltdata/
|
||||
src/umbraco.sln.ide/*
|
||||
build/UmbracoCms.*/
|
||||
src/.vs/
|
||||
src/Umbraco.Web.UI/umbraco/js/install.loader.js
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency id="HtmlAgilityPack" version="[1.4.9, 2.0.0)" />
|
||||
<dependency id="Lucene.Net" version="[2.9.4.1, 3.0.0.0)" />
|
||||
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.9.7, 7.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.9.8, 7.0.0)" />
|
||||
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.8.4, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc5" version="[1.8.0, 2.0.0)" />
|
||||
|
||||
@@ -62,13 +62,6 @@
|
||||
views/dashboard/default/startupdashboardintro.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Change password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Change Password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Change Password" xdt:Transform="Insert">
|
||||
<control showOnce="false" addPanel="false" panelCaption="">
|
||||
views/dashboard/ChangePassword.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Last Edits" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
</section>
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
<system.web xdt:Transform="InsertIfMissing" />
|
||||
<system.web>
|
||||
<siteMap xdt:Transform="Remove" />
|
||||
<siteMap xdt:Transform="Insert">
|
||||
<providers xdt:Transform="Insert">
|
||||
<remove name="MySqlSiteMapProvider" xdt:Transform="Insert" />
|
||||
<siteMap xdt:Transform="InsertIfMissing">
|
||||
<providers xdt:Transform="InsertIfMissing">
|
||||
<remove name="MySqlSiteMapProvider" xdt:Transform="InsertIfMissing" />
|
||||
</providers>
|
||||
</siteMap>
|
||||
<httpRuntime xdt:Transform="InsertIfMissing" />
|
||||
@@ -81,6 +81,10 @@
|
||||
</compilation>
|
||||
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
</assemblies>
|
||||
<assemblies>
|
||||
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
|
||||
@@ -63,6 +63,7 @@ if ($project) {
|
||||
if(Test-Path $umbracoBinFolder\MiniProfiler.dll) { Remove-Item $umbracoBinFolder\MiniProfiler.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\MySql.Data.dll) { Remove-Item $umbracoBinFolder\MySql.Data.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Newtonsoft.Json.dll) { Remove-Item $umbracoBinFolder\Newtonsoft.Json.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Web.Helpers.dll) { Remove-Item $umbracoBinFolder\System.Web.Helpers.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Net.Http.Formatting.dll) { Remove-Item $umbracoBinFolder\System.Net.Http.Formatting.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Web.Http.dll) { Remove-Item $umbracoBinFolder\System.Web.Http.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Web.Http.WebHost.dll) { Remove-Item $umbracoBinFolder\System.Web.Http.WebHost.dll -Force -Confirm:$false }
|
||||
|
||||
@@ -45,9 +45,6 @@ del ..\src\Umbraco.Web.UI\UserControls\*.*
|
||||
echo Removing masterpage files
|
||||
del ..\src\Umbraco.Web.UI\masterpages\*.*
|
||||
|
||||
echo Removing view files
|
||||
del ..\src\Umbraco.Web.UI\Views\*.*
|
||||
|
||||
echo Removing razor files
|
||||
del ..\src\Umbraco.Web.UI\macroScripts\*.*
|
||||
|
||||
@@ -104,7 +101,9 @@ echo Removing user control files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\usercontrols\*.*) DO DEL %%A
|
||||
|
||||
echo Removing view files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\*.*) DO DEL %%A
|
||||
ATTRIB +H ..\src\Umbraco.Web.UI\Views\Partials\Grid\*.cshtml /S
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\) DO DEL /Q /S *.cshtml -H
|
||||
ATTRIB -H ..\src\Umbraco.Web.UI\Views\Partials\Grid\*.cshtml /S
|
||||
|
||||
echo Removing razor files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\macroScripts\*.*) DO DEL %%A
|
||||
|
||||
@@ -54,9 +54,6 @@ del ..\src\Umbraco.Web.UI\UserControls\*.*
|
||||
echo Removing masterpage files
|
||||
del ..\src\Umbraco.Web.UI\masterpages\*.*
|
||||
|
||||
echo Removing view files
|
||||
del ..\src\Umbraco.Web.UI\Views\*.*
|
||||
|
||||
echo Removing razor files
|
||||
del ..\src\Umbraco.Web.UI\macroScripts\*.*
|
||||
|
||||
@@ -122,7 +119,9 @@ echo Removing user control files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\usercontrols\*.*) DO DEL %%A
|
||||
|
||||
echo Removing view files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\*.*) DO DEL %%A
|
||||
ATTRIB +H ..\src\Umbraco.Web.UI\Views\Partials\Grid\*.cshtml /S
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\) DO DEL /Q /S *.cshtml -H
|
||||
ATTRIB -H ..\src\Umbraco.Web.UI\Views\Partials\Grid\*.cshtml /S
|
||||
|
||||
echo Removing razor files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\macroScripts\*.*) DO DEL %%A
|
||||
@@ -151,6 +150,9 @@ rmdir "..\src\Umbraco.Web.UI\usercontrols\umbracoContour\" /S /Q
|
||||
echo Start with a clean web.config
|
||||
copy ..\src\Umbraco.Web.UI\web.Template.config ..\src\Umbraco.Web.UI\web.config /Y
|
||||
|
||||
echo Start with a clean web.config
|
||||
copy ..\src\Umbraco.Web.UI\web.Template.config ..\src\Umbraco.Web.UI\web.config /Y
|
||||
|
||||
echo "Umbraco install reverted to clean install"
|
||||
pause
|
||||
exit
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.3.1
|
||||
7.3.2
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Core
|
||||
/// <summary>
|
||||
/// A resolver to return all IAction objects
|
||||
/// </summary>
|
||||
internal sealed class ActionsResolver : LazyManyObjectsResolverBase<ActionsResolver, IAction>
|
||||
public sealed class ActionsResolver : LazyManyObjectsResolverBase<ActionsResolver, IAction>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
|
||||
@@ -283,7 +283,12 @@ namespace Umbraco.Core
|
||||
{
|
||||
var configStatus = ConfigurationStatus;
|
||||
var currentVersion = UmbracoVersion.GetSemanticVersion();
|
||||
var ok = configStatus == currentVersion;
|
||||
|
||||
var ok =
|
||||
//we are not configured if this is null
|
||||
string.IsNullOrWhiteSpace(configStatus) == false
|
||||
//they must match
|
||||
&& configStatus == currentVersion;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
@@ -308,8 +313,9 @@ namespace Umbraco.Core
|
||||
|
||||
return ok;
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<ApplicationContext>("Error determining if application is configured, returning false", ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -117,38 +118,55 @@ namespace Umbraco.Core
|
||||
private class NamedSemaphoreReleaser : CriticalFinalizerObject, IDisposable
|
||||
{
|
||||
private readonly Semaphore _semaphore;
|
||||
private GCHandle _handle;
|
||||
|
||||
internal NamedSemaphoreReleaser(Semaphore semaphore)
|
||||
{
|
||||
_semaphore = semaphore;
|
||||
_handle = GCHandle.Alloc(_semaphore);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
GC.SuppressFinalize(this); // finalize will not run
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
// critical
|
||||
_handle.Free();
|
||||
_semaphore.Release();
|
||||
_semaphore.Dispose();
|
||||
}
|
||||
|
||||
// we WANT to release the semaphore because it's a system object
|
||||
// ie a critical non-managed resource - so we inherit from CriticalFinalizerObject
|
||||
// which means that the finalizer "should" run in all situations
|
||||
// we WANT to release the semaphore because it's a system object, ie a critical
|
||||
// non-managed resource - and if it is not released then noone else can acquire
|
||||
// the lock - so we inherit from CriticalFinalizerObject which means that the
|
||||
// finalizer "should" run in all situations - there is always a chance that it
|
||||
// does not run and the semaphore remains "acquired" but then chances are the
|
||||
// whole process (w3wp.exe...) is going down, at which point the semaphore will
|
||||
// be destroyed by Windows.
|
||||
|
||||
// however... that can fail with System.ObjectDisposedException because the
|
||||
// underlying handle was closed... because we cannot guarantee that the semaphore
|
||||
// is not gone already... unless we get a GCHandle = GCHandle.Alloc(_semaphore);
|
||||
// which should keep it around and then we free the handle?
|
||||
// however, the semaphore is a managed object, and so when the finalizer runs it
|
||||
// might have been finalized already, and then we get a, ObjectDisposedException
|
||||
// in the finalizer - which is bad.
|
||||
|
||||
// so... I'm not sure this is safe really...
|
||||
// in order to prevent this we do two things
|
||||
// - use a GCHandler to ensure the semaphore is still there when the finalizer
|
||||
// runs, so we can actually release it
|
||||
// - wrap the finalizer code in a try...catch to make sure it never throws
|
||||
|
||||
~NamedSemaphoreReleaser()
|
||||
{
|
||||
Dispose(false);
|
||||
try
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// we do NOT want the finalizer to throw - never ever
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.3.1");
|
||||
private static readonly Version Version = new Version("7.3.2");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
public const string Users = "users";
|
||||
|
||||
/// <summary>
|
||||
/// Application alias for the users section.
|
||||
/// Application alias for the forms section.
|
||||
/// </summary>
|
||||
public const string Forms = "forms";
|
||||
}
|
||||
|
||||
@@ -310,13 +310,13 @@ namespace Umbraco.Core
|
||||
public const string TextboxAlias = "Umbraco.Textbox";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Textbox multiple datatype.
|
||||
/// Guid for the Textarea datatype.
|
||||
/// </summary>
|
||||
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
|
||||
public const string TextboxMultiple = "67DB8357-EF57-493E-91AC-936D305E0F2A";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the Textbox multiple datatype.
|
||||
/// Alias for the Textarea datatype.
|
||||
/// </summary>
|
||||
public const string TextboxMultipleAlias = "Umbraco.TextboxMultiple";
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace Umbraco.Core
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
@@ -15,6 +18,8 @@
|
||||
/// <summary>
|
||||
/// The auth cookie name
|
||||
/// </summary>
|
||||
[Obsolete("DO NOT USE THIS, USE ISecuritySection.AuthCookieName, this will be removed in future versions")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string AuthCookieName = "UMB_UCONTEXT";
|
||||
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Umbraco.Core.IO
|
||||
{
|
||||
get
|
||||
{
|
||||
return IOHelper.ReturnPath("umbracoWebservicesPath", "~/umbraco/webservices");
|
||||
return IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -533,6 +533,18 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="propertyGroupName">Name of the <see cref="PropertyGroup"/> to remove</param>
|
||||
public void RemovePropertyGroup(string propertyGroupName)
|
||||
{
|
||||
// if no group exists with that name, do nothing
|
||||
var group = PropertyGroups[propertyGroupName];
|
||||
if (group == null) return;
|
||||
|
||||
// re-assign the group's properties to no group
|
||||
foreach (var property in group.PropertyTypes)
|
||||
{
|
||||
property.PropertyGroupId = new Lazy<int>(() => 0);
|
||||
_propertyTypes.Add(property);
|
||||
}
|
||||
|
||||
// actually remove the group
|
||||
PropertyGroups.RemoveItem(propertyGroupName);
|
||||
OnPropertyChanged(PropertyGroupCollectionSelector);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using AutoMapper;
|
||||
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Security;
|
||||
|
||||
namespace Umbraco.Core.Models.Identity
|
||||
{
|
||||
@@ -24,6 +25,18 @@ namespace Umbraco.Core.Models.Identity
|
||||
.ForMember(user => user.UserTypeAlias, expression => expression.MapFrom(user => user.UserType.Alias))
|
||||
.ForMember(user => user.AccessFailedCount, expression => expression.MapFrom(user => user.FailedPasswordAttempts))
|
||||
.ForMember(user => user.AllowedSections, expression => expression.MapFrom(user => user.AllowedSections.ToArray()));
|
||||
|
||||
config.CreateMap<BackOfficeIdentityUser, UserData>()
|
||||
.ConstructUsing((BackOfficeIdentityUser user) => new UserData(Guid.NewGuid().ToString("N"))) //this is the 'session id'
|
||||
.ForMember(detail => detail.Id, opt => opt.MapFrom(user => user.Id))
|
||||
.ForMember(detail => detail.AllowedApplications, opt => opt.MapFrom(user => user.AllowedSections))
|
||||
.ForMember(detail => detail.RealName, opt => opt.MapFrom(user => user.Name))
|
||||
.ForMember(detail => detail.Roles, opt => opt.MapFrom(user => new[] { user.UserTypeAlias }))
|
||||
.ForMember(detail => detail.StartContentNode, opt => opt.MapFrom(user => user.StartContentId))
|
||||
.ForMember(detail => detail.StartMediaNode, opt => opt.MapFrom(user => user.StartMediaId))
|
||||
.ForMember(detail => detail.Username, opt => opt.MapFrom(user => user.UserName))
|
||||
.ForMember(detail => detail.Culture, opt => opt.MapFrom(user => user.Culture))
|
||||
.ForMember(detail => detail.SessionId, opt => opt.MapFrom(user => user.SecurityStamp.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString("N") : user.SecurityStamp));
|
||||
}
|
||||
|
||||
private string GetPasswordHash(string storedPass)
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Umbraco.Core.Models
|
||||
[IgnoreDataMember]
|
||||
public CultureInfo CultureInfo
|
||||
{
|
||||
get { return CultureInfo.CreateSpecificCulture(IsoCode); }
|
||||
get { return CultureInfo.GetCultureInfo(IsoCode); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Models.Rdbms
|
||||
internal class MigrationDto
|
||||
{
|
||||
[Column("id")]
|
||||
[PrimaryKeyColumn(AutoIncrement = true)]
|
||||
[PrimaryKeyColumn(AutoIncrement = true, IdentitySeed = 100)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Umbraco.Core.Models.Identity;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Concurrent;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Mappers
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a <see cref="TaskType"/> to DTO mapper used to translate the properties of the public api
|
||||
/// implementation to that of the database's DTO as sql: [tableName].[columnName].
|
||||
/// </summary>
|
||||
[MapperFor(typeof(TaskType))]
|
||||
public sealed class TaskTypeMapper : BaseMapper
|
||||
{
|
||||
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance = new ConcurrentDictionary<string, DtoMapModel>();
|
||||
|
||||
//NOTE: its an internal class but the ctor must be public since we're using Activator.CreateInstance to create it
|
||||
// otherwise that would fail because there is no public constructor.
|
||||
public TaskTypeMapper()
|
||||
{
|
||||
BuildMap();
|
||||
}
|
||||
|
||||
#region Overrides of BaseMapper
|
||||
|
||||
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache
|
||||
{
|
||||
get { return PropertyInfoCacheInstance; }
|
||||
}
|
||||
|
||||
internal override void BuildMap()
|
||||
{
|
||||
CacheMap<TaskType, TaskTypeDto>(src => src.Id, dto => dto.Id);
|
||||
CacheMap<TaskType, TaskTypeDto>(src => src.Alias, dto => dto.Alias);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -21, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,-21", SortOrder = 0, UniqueId = new Guid("BF7C7CBC-952F-4518-97A2-69E9C7B33842"), Text = "Recycle Bin", NodeObjectType = new Guid(Constants.ObjectTypes.MediaRecycleBin), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -92, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-92", SortOrder = 35, UniqueId = new Guid("f0bc4bfb-b499-40d6-ba86-058885a5178c"), Text = "Label", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -90, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-90", SortOrder = 34, UniqueId = new Guid("84c6b441-31df-4ffe-b67e-67d5bc3ae65a"), Text = "Upload", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -89, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-89", SortOrder = 33, UniqueId = new Guid("c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3"), Text = "Textbox multiple", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -89, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-89", SortOrder = 33, UniqueId = new Guid("c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3"), Text = "Textarea", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -88, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-88", SortOrder = 32, UniqueId = new Guid("0cc0eba1-9960-42c9-bf9b-60e150b429ae"), Text = "Textstring", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -87, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-87", SortOrder = 4, UniqueId = new Guid("ca90c950-0aff-4e72-b976-a30b1ac57dad"), Text = "Richtext editor", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -51, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-51", SortOrder = 2, UniqueId = new Guid("2e6d3631-066e-44b8-aec4-96f09099b2b5"), Text = "Numeric", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeTwo
|
||||
{
|
||||
/// <summary>
|
||||
/// This reinserts all migrations in the migrations table to account for initial rows inserted
|
||||
/// on creation without identity enabled.
|
||||
/// </summary>
|
||||
[Migration("7.3.2", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
public class EnsureMigrationsTableIdentityIsCorrect : MigrationBase
|
||||
{
|
||||
public EnsureMigrationsTableIdentityIsCorrect(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
// Due to the delayed execution of migrations, we have to wrap this code in Execute.Code to ensure the previous
|
||||
// migration steps (esp. creating the migrations table) have completed before trying to fetch migrations from
|
||||
// this table.
|
||||
List<MigrationDto> migrations = null;
|
||||
Execute.Code(db =>
|
||||
{
|
||||
migrations = Context.Database.Fetch<MigrationDto>(new Sql().Select("*").From<MigrationDto>(SqlSyntax));
|
||||
return string.Empty;
|
||||
});
|
||||
Delete.FromTable("umbracoMigration").AllRows();
|
||||
Execute.Code(database =>
|
||||
{
|
||||
if (migrations != null)
|
||||
{
|
||||
foreach (var migration in migrations)
|
||||
{
|
||||
database.Insert("umbracoMigration", "id", true,
|
||||
new {name = migration.Name, createDate = migration.CreateDate, version = migration.Version});
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
});
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,12 +20,10 @@ using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Data.Common;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading;
|
||||
|
||||
namespace Umbraco.Core.Persistence
|
||||
{
|
||||
@@ -1804,53 +1802,8 @@ namespace Umbraco.Core.Persistence
|
||||
return ObjectCache;
|
||||
}
|
||||
|
||||
//static readonly ObjectCache ObjectCache = new MemoryCache("NPoco");
|
||||
private static readonly ObjectCache ObjectCache;
|
||||
|
||||
// this should probably happen somewhere else...f
|
||||
private static void FixCurrentCulture()
|
||||
{
|
||||
// get the current culture
|
||||
var currentCulture = CultureInfo.CurrentCulture;
|
||||
|
||||
// at the top of any culture should be the invariant culture - find it
|
||||
var invariantCulture = currentCulture;
|
||||
while (invariantCulture.Equals(CultureInfo.InvariantCulture) == false)
|
||||
invariantCulture = invariantCulture.Parent;
|
||||
|
||||
// now that invariant culture should be the same object as CultureInfo.InvariantCulture
|
||||
// yet for some weird reason, sometimes it is not - and this breaks eg MemoryCache,
|
||||
// because it ends up in PerformanceCounterLib.IsCustomCategory which does:
|
||||
//
|
||||
// CultureInfo culture = CultureInfo.CurrentCulture;
|
||||
// while (culture != CultureInfo.InvariantCulture)
|
||||
// {
|
||||
// library = GetPerformanceCounterLib(machine, culture);
|
||||
// if (library.IsCustomCategory(category))
|
||||
// return true;
|
||||
// culture = culture.Parent;
|
||||
// }
|
||||
//
|
||||
// ie a reference comparisons = enters an endless loop and hangs everything.
|
||||
|
||||
if (ReferenceEquals(invariantCulture, CultureInfo.InvariantCulture))
|
||||
return;
|
||||
|
||||
// so if it is not the same object, replace the culture by the "fixed" version of
|
||||
// itself - this prevents MemoryCache from dying - but it is an ugly workaround and
|
||||
// does not explain why we would have different CultureInfo objects
|
||||
|
||||
var fixedCulture = CultureInfo.GetCultureInfo(currentCulture.Name);
|
||||
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = fixedCulture;
|
||||
}
|
||||
|
||||
static ManagedCache()
|
||||
{
|
||||
FixCurrentCulture();
|
||||
ObjectCache = new MemoryCache("NPoco");
|
||||
}
|
||||
|
||||
|
||||
static readonly ObjectCache ObjectCache = new MemoryCache("NPoco");
|
||||
|
||||
}
|
||||
|
||||
public class PocoData
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
//If there's a GetAll zero count cache, ensure it is cleared
|
||||
RuntimeCache.ClearCacheItem(GetCacheTypeKey<TEntity>());
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if an exception is thrown we need to remove the entry from cache, this is ONLY a work around because of the way
|
||||
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
|
||||
|
||||
@@ -682,14 +682,16 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
public RenderingEngine DetermineTemplateRenderingEngine(ITemplate template)
|
||||
{
|
||||
var engine = _templateConfig.DefaultRenderingEngine;
|
||||
|
||||
if (template.Content.IsNullOrWhiteSpace() == false && MasterPageHelper.IsMasterPageSyntax(template.Content))
|
||||
var viewHelper = new ViewHelper(_viewsFileSystem);
|
||||
if (!viewHelper.ViewExists(template))
|
||||
{
|
||||
//there is a design but its definitely a webforms design
|
||||
return RenderingEngine.WebForms;
|
||||
if (template.Content.IsNullOrWhiteSpace() == false && MasterPageHelper.IsMasterPageSyntax(template.Content))
|
||||
{
|
||||
//there is a design but its definitely a webforms design and we haven't got a MVC view already for it
|
||||
return RenderingEngine.WebForms;
|
||||
}
|
||||
}
|
||||
|
||||
var viewHelper = new ViewHelper(_viewsFileSystem);
|
||||
var masterPageHelper = new MasterPageHelper(_masterpagesFileSystem);
|
||||
|
||||
switch (engine)
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Umbraco.Core.Persistence
|
||||
|
||||
public override void OnException(Exception x)
|
||||
{
|
||||
_logger.Info<UmbracoDatabase>(x.StackTrace);
|
||||
_logger.Error<UmbracoDatabase>("Database exception occurred", x);
|
||||
base.OnException(x);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
@@ -15,7 +16,6 @@ using Microsoft.Owin;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Microsoft.Owin;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Umbraco.Core.Security
|
||||
@@ -157,9 +157,6 @@ namespace Umbraco.Core.Security
|
||||
return new HttpContextWrapper(http).GetCurrentIdentity(authenticateRequestIfNotFound);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This clears the forms authentication cookie
|
||||
/// </summary>
|
||||
public static void UmbracoLogout(this HttpContextBase http)
|
||||
{
|
||||
if (http == null) throw new ArgumentNullException("http");
|
||||
@@ -170,6 +167,8 @@ namespace Umbraco.Core.Security
|
||||
/// This clears the forms authentication cookie for webapi since cookies are handled differently
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
[Obsolete("Use OWIN IAuthenticationManager.SignOut instead")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static void UmbracoLogoutWebApi(this HttpResponseMessage response)
|
||||
{
|
||||
if (response == null) throw new ArgumentNullException("response");
|
||||
@@ -195,11 +194,8 @@ namespace Umbraco.Core.Security
|
||||
response.Headers.AddCookies(new[] { authCookie, prevCookie, extLoginCookie });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This adds the forms authentication cookie for webapi since cookies are handled differently
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="user"></param>
|
||||
[Obsolete("Use WebSecurity.SetPrincipalForRequest")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static FormsAuthenticationTicket UmbracoLoginWebApi(this HttpResponseMessage response, IUser user)
|
||||
{
|
||||
if (response == null) throw new ArgumentNullException("response");
|
||||
@@ -250,26 +246,29 @@ namespace Umbraco.Core.Security
|
||||
if (http == null) throw new ArgumentNullException("http");
|
||||
new HttpContextWrapper(http).UmbracoLogout();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Renews the Umbraco authentication ticket
|
||||
/// This will force ticket renewal in the OWIN pipeline
|
||||
/// </summary>
|
||||
/// <param name="http"></param>
|
||||
/// <returns></returns>
|
||||
public static bool RenewUmbracoAuthTicket(this HttpContextBase http)
|
||||
{
|
||||
if (http == null) throw new ArgumentNullException("http");
|
||||
return RenewAuthTicket(http,
|
||||
UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName,
|
||||
UmbracoConfig.For.UmbracoSettings().Security.AuthCookieDomain,
|
||||
//Umbraco has always persisted it's original cookie for 1 day so we'll keep it that way
|
||||
1440);
|
||||
http.Items["umbraco-force-auth"] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This will force ticket renewal in the OWIN pipeline
|
||||
/// </summary>
|
||||
/// <param name="http"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool RenewUmbracoAuthTicket(this HttpContext http)
|
||||
{
|
||||
if (http == null) throw new ArgumentNullException("http");
|
||||
return new HttpContextWrapper(http).RenewUmbracoAuthTicket();
|
||||
http.Items["umbraco-force-auth"] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -390,8 +389,7 @@ namespace Umbraco.Core.Security
|
||||
//ensure there's def an expired cookie
|
||||
http.Response.Cookies.Add(new HttpCookie(c) { Expires = DateTime.Now.AddYears(-1) });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static FormsAuthenticationTicket GetAuthTicket(this HttpContextBase http, string cookieName)
|
||||
@@ -432,51 +430,6 @@ namespace Umbraco.Core.Security
|
||||
return FormsAuthentication.Decrypt(formsCookie);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renews the forms authentication ticket & cookie
|
||||
/// </summary>
|
||||
/// <param name="http"></param>
|
||||
/// <param name="cookieName"></param>
|
||||
/// <param name="cookieDomain"></param>
|
||||
/// <param name="minutesPersisted"></param>
|
||||
/// <returns>true if there was a ticket to renew otherwise false if there was no ticket</returns>
|
||||
private static bool RenewAuthTicket(this HttpContextBase http, string cookieName, string cookieDomain, int minutesPersisted)
|
||||
{
|
||||
if (http == null) throw new ArgumentNullException("http");
|
||||
//get the ticket
|
||||
var ticket = GetAuthTicket(http, cookieName);
|
||||
//renew the ticket
|
||||
var renewed = FormsAuthentication.RenewTicketIfOld(ticket);
|
||||
if (renewed == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//get the request cookie to get it's expiry date,
|
||||
//NOTE: this will never be null becaues we already do this
|
||||
// check in teh GetAuthTicket.
|
||||
var formsCookie = http.Request.Cookies[cookieName];
|
||||
|
||||
//encrypt it
|
||||
var hash = FormsAuthentication.Encrypt(renewed);
|
||||
//write it to the response
|
||||
var cookie = new HttpCookie(cookieName, hash)
|
||||
{
|
||||
Expires = DateTime.Now.AddMinutes(minutesPersisted),
|
||||
Domain = cookieDomain
|
||||
};
|
||||
|
||||
if (GlobalSettings.UseSSL)
|
||||
cookie.Secure = true;
|
||||
|
||||
//ensure http only, this should only be able to be accessed via the server
|
||||
cookie.HttpOnly = true;
|
||||
|
||||
//rewrite the cooke
|
||||
http.Response.Cookies.Set(cookie);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a custom FormsAuthentication ticket with the data specified
|
||||
/// </summary>
|
||||
|
||||
@@ -1,12 +1,38 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Owin;
|
||||
using Microsoft.Owin.Security.Cookies;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Security
|
||||
{
|
||||
public class BackOfficeCookieAuthenticationProvider : CookieAuthenticationProvider
|
||||
{
|
||||
public override void ResponseSignOut(CookieResponseSignOutContext context)
|
||||
{
|
||||
base.ResponseSignOut(context);
|
||||
|
||||
//Make sure the definitely all of these cookies are cleared when signing out with cookies
|
||||
context.Response.Cookies.Append(UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName, "", new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddYears(-1),
|
||||
Path = "/"
|
||||
});
|
||||
context.Response.Cookies.Append(Constants.Web.PreviewCookieName, "", new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddYears(-1),
|
||||
Path = "/"
|
||||
});
|
||||
context.Response.Cookies.Append(Constants.Security.BackOfficeExternalCookieName, "", new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddYears(-1),
|
||||
Path = "/"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensures that the culture is set correctly for the current back office user
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,11 @@ namespace Umbraco.Core.Security
|
||||
switch (result)
|
||||
{
|
||||
case SignInStatus.Success:
|
||||
_logger.WriteCore(TraceEventType.Information, 0,
|
||||
string.Format(
|
||||
"User: {0} logged in from IP address {1}",
|
||||
userName,
|
||||
_request.RemoteIpAddress), null, null);
|
||||
break;
|
||||
case SignInStatus.LockedOut:
|
||||
_logger.WriteCore(TraceEventType.Information, 0,
|
||||
|
||||
@@ -152,6 +152,9 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
var contentType = FindContentTypeByAlias(contentTypeAlias);
|
||||
var content = new Content(name, parentId, contentType);
|
||||
var parent = GetById(content.ParentId);
|
||||
content.Path = string.Concat(parent.IfNotNull(x => x.Path, content.ParentId.ToString()), ",", content.Id);
|
||||
|
||||
|
||||
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IContent>(content, contentTypeAlias, parentId), this))
|
||||
{
|
||||
@@ -190,8 +193,11 @@ namespace Umbraco.Core.Services
|
||||
/// <returns><see cref="IContent"/></returns>
|
||||
public IContent CreateContent(string name, IContent parent, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException("parent");
|
||||
|
||||
var contentType = FindContentTypeByAlias(contentTypeAlias);
|
||||
var content = new Content(name, parent, contentType);
|
||||
content.Path = string.Concat(parent.Path, ",", content.Id);
|
||||
|
||||
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IContent>(content, contentTypeAlias, parent), this))
|
||||
{
|
||||
@@ -225,7 +231,7 @@ namespace Umbraco.Core.Services
|
||||
public IContent CreateContentWithIdentity(string name, int parentId, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
var contentType = FindContentTypeByAlias(contentTypeAlias);
|
||||
var content = new Content(name, parentId, contentType);
|
||||
var content = new Content(name, parentId, contentType);
|
||||
|
||||
//NOTE: I really hate the notion of these Creating/Created events - they are so inconsistent, I've only just found
|
||||
// out that in these 'WithIdentity' methods, the Saving/Saved events were not fired, wtf. Anyways, they're added now.
|
||||
@@ -276,6 +282,8 @@ namespace Umbraco.Core.Services
|
||||
/// <returns><see cref="IContent"/></returns>
|
||||
public IContent CreateContentWithIdentity(string name, IContent parent, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException("parent");
|
||||
|
||||
var contentType = FindContentTypeByAlias(contentTypeAlias);
|
||||
var content = new Content(name, parent, contentType);
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ namespace Umbraco.Core.Services
|
||||
|
||||
xml.Add(new XAttribute("loginName", member.Username));
|
||||
xml.Add(new XAttribute("email", member.Email));
|
||||
|
||||
xml.Add(new XAttribute("icon", member.ContentType.Icon));
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
|
||||
var media = new Models.Media(name, parentId, mediaType);
|
||||
var parent = GetById(media.ParentId);
|
||||
media.Path = string.Concat(parent.IfNotNull(x => x.Path, media.ParentId.ToString()), ",", media.Id);
|
||||
|
||||
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parentId), this))
|
||||
{
|
||||
@@ -95,8 +97,12 @@ namespace Umbraco.Core.Services
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
public IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException("parent");
|
||||
|
||||
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
|
||||
var media = new Models.Media(name, parent, mediaType);
|
||||
media.Path = string.Concat(parent.Path, ",", media.Id);
|
||||
|
||||
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parent), this))
|
||||
{
|
||||
media.WasCancelled = true;
|
||||
@@ -184,6 +190,8 @@ namespace Umbraco.Core.Services
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
public IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException("parent");
|
||||
|
||||
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
|
||||
var media = new Models.Media(name, parent, mediaType);
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
static class ThreadExtensions
|
||||
{
|
||||
public static void SanitizeThreadCulture(this Thread thread)
|
||||
{
|
||||
// get the current culture
|
||||
var currentCulture = CultureInfo.CurrentCulture;
|
||||
|
||||
// at the top of any culture should be the invariant culture - find it
|
||||
// doing an .Equals comparison ensure that we *will* find it and not loop
|
||||
// endlessly
|
||||
var invariantCulture = currentCulture;
|
||||
while (invariantCulture.Equals(CultureInfo.InvariantCulture) == false)
|
||||
invariantCulture = invariantCulture.Parent;
|
||||
|
||||
// now that invariant culture should be the same object as CultureInfo.InvariantCulture
|
||||
// yet for some reasons, sometimes it is not - and this breaks anything that loops on
|
||||
// culture.Parent until a reference equality to CultureInfo.InvariantCulture. See, for
|
||||
// example, the following code in PerformanceCounterLib.IsCustomCategory:
|
||||
//
|
||||
// CultureInfo culture = CultureInfo.CurrentCulture;
|
||||
// while (culture != CultureInfo.InvariantCulture)
|
||||
// {
|
||||
// library = GetPerformanceCounterLib(machine, culture);
|
||||
// if (library.IsCustomCategory(category))
|
||||
// return true;
|
||||
// culture = culture.Parent;
|
||||
// }
|
||||
//
|
||||
// The reference comparisons never succeeds, hence the loop never ends, and the
|
||||
// application hangs.
|
||||
//
|
||||
// granted, that comparison should probably be a .Equals comparison, but who knows
|
||||
// how many times the framework assumes that it can do a reference comparison? So,
|
||||
// better fix the cultures.
|
||||
|
||||
if (ReferenceEquals(invariantCulture, CultureInfo.InvariantCulture))
|
||||
return;
|
||||
|
||||
// if we do not have equality, fix cultures by replacing them with a culture with
|
||||
// the same name, but obtained here and now, with a proper invariant top culture
|
||||
|
||||
thread.CurrentCulture = CultureInfo.GetCultureInfo(thread.CurrentCulture.Name);
|
||||
thread.CurrentUICulture = CultureInfo.GetCultureInfo(thread.CurrentUICulture.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\MySql.Data.6.9.7\lib\net45\MySql.Data.dll</HintPath>
|
||||
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
@@ -404,6 +404,8 @@
|
||||
<Compile Include="Persistence\Mappers\AccessMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\DomainMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\MigrationEntryMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\TaskTypeMapper.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeTwo\EnsureMigrationsTableIdentityIsCorrect.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeZero\AddExternalLoginsTable.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeZero\AddForeignKeysForLanguageAndDictionaryTables.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeZero\AddServerRegistrationColumnsAndLock.cs" />
|
||||
@@ -1278,6 +1280,7 @@
|
||||
<Compile Include="Sync\ApplicationUrlHelper.cs" />
|
||||
<Compile Include="Sync\RefreshMethodType.cs" />
|
||||
<Compile Include="Sync\ServerMessengerBase.cs" />
|
||||
<Compile Include="ThreadExtensions.cs" />
|
||||
<Compile Include="TopologicalSorter.cs" />
|
||||
<Compile Include="Strings\DefaultUrlSegmentProvider.cs" />
|
||||
<Compile Include="Strings\IUrlSegmentProvider.cs" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
using log4net;
|
||||
@@ -64,6 +65,7 @@ namespace Umbraco.Core
|
||||
/// <param name="e"></param>
|
||||
protected void Application_Start(object sender, EventArgs e)
|
||||
{
|
||||
Thread.CurrentThread.SanitizeThreadCulture();
|
||||
StartApplication(sender, e);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.9.7" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.9.8" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
<package id="semver" version="1.1.2" targetFramework="net45" />
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<appSettings>
|
||||
<add key="umbracoConfigurationStatus" value="6.0.0" />
|
||||
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
|
||||
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
|
||||
<add key="umbracoReservedPaths" value="~/install/" />
|
||||
<add key="umbracoPath" value="~/umbraco" />
|
||||
<add key="umbracoHideTopLevelNodeFromPath" value="true" />
|
||||
<add key="umbracoUseDirectoryUrls" value="false" />
|
||||
@@ -203,4 +203,4 @@
|
||||
</assemblyBinding>
|
||||
|
||||
</runtime>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Examine Management">
|
||||
<control>/umbraco/dashboard/ExamineManagement.ascx</control>
|
||||
<control>dashboard/ExamineManagement.ascx</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Last Edits">
|
||||
<control addPanel="true" MaxRecords="30">/umbraco/dashboard/latestEdits.ascx</control>
|
||||
<control addPanel="true" MaxRecords="30">dashboard/latestEdits.ascx</control>
|
||||
</tab>
|
||||
<tab caption="Change Password">
|
||||
<control addPanel="true">
|
||||
@@ -104,11 +104,11 @@
|
||||
views/dashboard/members/membersdashboardintro.html
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
/umbraco/members/membersearch.ascx
|
||||
members/membersearch.ascx
|
||||
</control>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
views/dashboard/members/membersdashboardvideos.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
</dashBoard>
|
||||
</dashBoard>
|
||||
|
||||
@@ -173,7 +173,8 @@ namespace Umbraco.Tests.Logging
|
||||
Console.WriteLine("Flushed {0} events during shutdown", numberLoggedAfterClose - numberLoggedBeforeClose);
|
||||
}
|
||||
|
||||
[Test, Explicit("Long-running")]
|
||||
[NUnit.Framework.Ignore("Keeps failing very randomly")]
|
||||
[Test]
|
||||
public void WillShutdownIfBufferCannotBeFlushedFastEnough()
|
||||
{
|
||||
const int testSize = 250;
|
||||
|
||||
@@ -482,7 +482,7 @@ ALTER TABLE umbracoUser2NodePermission ADD CONSTRAINT PK_umbracoUser2NodePermiss
|
||||
INSERT INTO umbracoNode (id, trashed, parentID, nodeUser, level, path, sortOrder, uniqueID, text, nodeObjectType, createDate) VALUES
|
||||
(-92, 0, -1, 0, 11, '-1,-92', 37, 'f0bc4bfb-b499-40d6-ba86-058885a5178c', 'Label', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-90, 0, -1, 0, 11, '-1,-90', 35, '84c6b441-31df-4ffe-b67e-67d5bc3ae65a', 'Upload', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-89, 0, -1, 0, 11, '-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', 'Textbox multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-89, 0, -1, 0, 11, '-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', 'Textarea', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-88, 0, -1, 0, 11, '-1,-88', 33, '0cc0eba1-9960-42c9-bf9b-60e150b429ae', 'Textstring', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-87, 0, -1, 0, 11, '-1,-87', 32, 'ca90c950-0aff-4e72-b976-a30b1ac57dad', 'Richtext editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
(-51, 0, -1, 0, 11, '-1,-51', 4, '2e6d3631-066e-44b8-aec4-96f09099b2b5', 'Numeric', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '2004/09/30 14:01:49.920'),
|
||||
|
||||
Binary file not shown.
@@ -624,7 +624,7 @@ ALTER TABLE [umbracoNode] DROP CONSTRAINT [FK_umbracoNode_umbracoNode]
|
||||
SET IDENTITY_INSERT [umbracoNode] ON
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-92, 0, -1, 0, 11, N'-1,-92', 37, 'f0bc4bfb-b499-40d6-ba86-058885a5178c', N'Label', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-90, 0, -1, 0, 11, N'-1,-90', 35, '84c6b441-31df-4ffe-b67e-67d5bc3ae65a', N'Upload', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-89, 0, -1, 0, 11, N'-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', N'Textbox multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-89, 0, -1, 0, 11, N'-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', N'Textarea', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-88, 0, -1, 0, 11, N'-1,-88', 33, '0cc0eba1-9960-42c9-bf9b-60e150b429ae', N'Textstring', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-87, 0, -1, 0, 11, N'-1,-87', 32, 'ca90c950-0aff-4e72-b976-a30b1ac57dad', N'Richtext editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
INSERT INTO [umbracoNode] ([id], [trashed], [parentID], [nodeUser], [level], [path], [sortOrder], [uniqueID], [text], [nodeObjectType], [createDate]) VALUES (-51, 0, -1, 0, 11, N'-1,-51', 4, '2e6d3631-066e-44b8-aec4-96f09099b2b5', N'Numeric', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', '20040930 14:01:49.920')
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Models;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class RenderIndexActionSelectorAttributeTests
|
||||
{
|
||||
private MethodInfo GetRenderMvcControllerIndexMethodFromCurrentType(Type currType)
|
||||
{
|
||||
return currType.GetMethods().Single(x =>
|
||||
{
|
||||
if (x.Name != "Index") return false;
|
||||
if (x.ReturnParameter == null || x.ReturnParameter.ParameterType != typeof (ActionResult)) return false;
|
||||
var p = x.GetParameters();
|
||||
if (p.Length != 1) return false;
|
||||
if (p[0].ParameterType != typeof (RenderModel)) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Matches_Default_Index()
|
||||
{
|
||||
var attr = new RenderIndexActionSelectorAttribute();
|
||||
var req = new RequestContext();
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.EnsureContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new Mock<WebSecurity>(null, null).Object,
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
Enumerable.Empty<IUrlProvider>(),
|
||||
true);
|
||||
var ctrl = new MatchesDefaultIndexController(umbCtx);
|
||||
var controllerCtx = new ControllerContext(req, ctrl);
|
||||
var result = attr.IsValidForRequest(controllerCtx,
|
||||
GetRenderMvcControllerIndexMethodFromCurrentType(ctrl.GetType()));
|
||||
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Matches_Overriden_Index()
|
||||
{
|
||||
var attr = new RenderIndexActionSelectorAttribute();
|
||||
var req = new RequestContext();
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.EnsureContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new Mock<WebSecurity>(null, null).Object,
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
Enumerable.Empty<IUrlProvider>(),
|
||||
true);
|
||||
var ctrl = new MatchesOverriddenIndexController(umbCtx);
|
||||
var controllerCtx = new ControllerContext(req, ctrl);
|
||||
var result = attr.IsValidForRequest(controllerCtx,
|
||||
GetRenderMvcControllerIndexMethodFromCurrentType(ctrl.GetType()));
|
||||
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Matches_Custom_Index()
|
||||
{
|
||||
var attr = new RenderIndexActionSelectorAttribute();
|
||||
var req = new RequestContext();
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.EnsureContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new Mock<WebSecurity>(null, null).Object,
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
Enumerable.Empty<IUrlProvider>(),
|
||||
true);
|
||||
var ctrl = new MatchesCustomIndexController(umbCtx);
|
||||
var controllerCtx = new ControllerContext(req, ctrl);
|
||||
var result = attr.IsValidForRequest(controllerCtx,
|
||||
GetRenderMvcControllerIndexMethodFromCurrentType(ctrl.GetType()));
|
||||
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Matches_Async_Index_Same_Signature()
|
||||
{
|
||||
var attr = new RenderIndexActionSelectorAttribute();
|
||||
var req = new RequestContext();
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.EnsureContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new Mock<WebSecurity>(null, null).Object,
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
Enumerable.Empty<IUrlProvider>(),
|
||||
true);
|
||||
var ctrl = new MatchesAsyncIndexController(umbCtx);
|
||||
var controllerCtx = new ControllerContext(req, ctrl);
|
||||
var result = attr.IsValidForRequest(controllerCtx,
|
||||
GetRenderMvcControllerIndexMethodFromCurrentType(ctrl.GetType()));
|
||||
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
public class MatchesDefaultIndexController : RenderMvcController
|
||||
{
|
||||
public MatchesDefaultIndexController(UmbracoContext umbracoContext) : base(umbracoContext)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class MatchesOverriddenIndexController : RenderMvcController
|
||||
{
|
||||
public MatchesOverriddenIndexController(UmbracoContext umbracoContext) : base(umbracoContext)
|
||||
{
|
||||
}
|
||||
|
||||
public override ActionResult Index(RenderModel model)
|
||||
{
|
||||
return base.Index(model);
|
||||
}
|
||||
}
|
||||
|
||||
public class MatchesCustomIndexController : RenderMvcController
|
||||
{
|
||||
public MatchesCustomIndexController(UmbracoContext umbracoContext) : base(umbracoContext)
|
||||
{
|
||||
}
|
||||
|
||||
public ActionResult Index(RenderModel model, int page)
|
||||
{
|
||||
return base.Index(model);
|
||||
}
|
||||
}
|
||||
|
||||
public class MatchesAsyncIndexController : RenderMvcController
|
||||
{
|
||||
public MatchesAsyncIndexController(UmbracoContext umbracoContext) : base(umbracoContext)
|
||||
{
|
||||
}
|
||||
|
||||
public new async Task<ActionResult> Index(RenderModel model)
|
||||
{
|
||||
return await Task.FromResult(base.Index(model));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace Umbraco.Tests.Plugins
|
||||
public void Resolves_Assigned_Mappers()
|
||||
{
|
||||
var foundTypes1 = _manager.ResolveAssignedMapperTypes();
|
||||
Assert.AreEqual(27, foundTypes1.Count());
|
||||
Assert.AreEqual(28, foundTypes1.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -141,6 +141,20 @@ namespace Umbraco.Tests.Services
|
||||
Assert.AreEqual(20, contentService.CountDescendants(parent.Id));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetAncestors_Returns_Empty_List_When_Path_Is_Null()
|
||||
{
|
||||
// Arrange
|
||||
var contentService = ServiceContext.ContentService;
|
||||
|
||||
// Act
|
||||
var current = new Mock<IContent>();
|
||||
var res = contentService.GetAncestors(current.Object);
|
||||
|
||||
// Assert
|
||||
Assert.IsEmpty(res);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Tags_For_Entity_Are_Not_Exposed_Via_Tag_Api_When_Content_Is_Recycled()
|
||||
{
|
||||
|
||||
@@ -1168,6 +1168,8 @@ namespace Umbraco.Tests.Services
|
||||
{
|
||||
var service = ServiceContext.ContentTypeService;
|
||||
var basePage = (IContentType)MockedContentTypes.CreateBasicContentType();
|
||||
basePage.AddPropertyGroup("Content");
|
||||
basePage.AddPropertyGroup("Meta");
|
||||
service.Save(basePage);
|
||||
|
||||
var authorPropertyType = new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext, "author")
|
||||
@@ -1179,6 +1181,16 @@ namespace Umbraco.Tests.Services
|
||||
DataTypeDefinitionId = -88
|
||||
};
|
||||
var authorAdded = basePage.AddPropertyType(authorPropertyType, "Content");
|
||||
var titlePropertyType = new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext, "title")
|
||||
{
|
||||
Name = "Title",
|
||||
Description = "",
|
||||
Mandatory = false,
|
||||
SortOrder = 1,
|
||||
DataTypeDefinitionId = -88
|
||||
};
|
||||
var titleAdded = basePage.AddPropertyType(authorPropertyType, "Meta");
|
||||
|
||||
service.Save(basePage);
|
||||
|
||||
basePage = service.GetContentType(basePage.Id);
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
|
||||
namespace Umbraco.Tests.Templates
|
||||
{
|
||||
[TestFixture]
|
||||
public class TemplateRepositoryTests
|
||||
{
|
||||
private readonly Mock<IDatabaseUnitOfWork> _unitOfWorkMock = new Mock<IDatabaseUnitOfWork>();
|
||||
private readonly Mock<CacheHelper> _cacheMock = new Mock<CacheHelper>();
|
||||
private TemplateRepository _templateRepository;
|
||||
private readonly Mock<IFileSystem> _viewFileSystemMock = new Mock<IFileSystem>();
|
||||
private readonly Mock<IFileSystem> _masterpageFileSystemMock = new Mock<IFileSystem>();
|
||||
private readonly Mock<ITemplatesSection> _templateConfigMock = new Mock<Core.Configuration.UmbracoSettings.ITemplatesSection>();
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
var loggerMock = new Mock<ILogger>();
|
||||
var sqlSyntaxMock = new Mock<ISqlSyntaxProvider>();
|
||||
_templateRepository = new TemplateRepository(_unitOfWorkMock.Object, _cacheMock.Object, loggerMock.Object, sqlSyntaxMock.Object, _masterpageFileSystemMock.Object, _viewFileSystemMock.Object, _templateConfigMock.Object);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DetermineTemplateRenderingEngine_Returns_MVC_When_ViewFile_Exists_And_Content_Has_Webform_Markup()
|
||||
{
|
||||
// Project in MVC mode
|
||||
_templateConfigMock.Setup(x => x.DefaultRenderingEngine).Returns(RenderingEngine.Mvc);
|
||||
|
||||
// Template has masterpage content
|
||||
var templateMock = new Mock<ITemplate>();
|
||||
templateMock.Setup(x => x.Alias).Returns("Something");
|
||||
templateMock.Setup(x => x.Content).Returns("<asp:Content />");
|
||||
|
||||
// but MVC View already exists
|
||||
_viewFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(true);
|
||||
|
||||
var res = _templateRepository.DetermineTemplateRenderingEngine(templateMock.Object);
|
||||
Assert.AreEqual(RenderingEngine.Mvc, res);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DetermineTemplateRenderingEngine_Returns_WebForms_When_ViewFile_Doesnt_Exist_And_Content_Has_Webform_Markup()
|
||||
{
|
||||
// Project in MVC mode
|
||||
_templateConfigMock.Setup(x => x.DefaultRenderingEngine).Returns(RenderingEngine.Mvc);
|
||||
|
||||
// Template has masterpage content
|
||||
var templateMock = new Mock<ITemplate>();
|
||||
templateMock.Setup(x => x.Alias).Returns("Something");
|
||||
templateMock.Setup(x => x.Content).Returns("<asp:Content />");
|
||||
|
||||
// MVC View doesn't exist
|
||||
_viewFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(false);
|
||||
|
||||
var res = _templateRepository.DetermineTemplateRenderingEngine(templateMock.Object);
|
||||
Assert.AreEqual(RenderingEngine.WebForms, res);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DetermineTemplateRenderingEngine_Returns_WebForms_When_MasterPage_Exists_And_In_Mvc_Mode()
|
||||
{
|
||||
// Project in MVC mode
|
||||
_templateConfigMock.Setup(x => x.DefaultRenderingEngine).Returns(RenderingEngine.Mvc);
|
||||
|
||||
var templateMock = new Mock<ITemplate>();
|
||||
templateMock.Setup(x => x.Alias).Returns("Something");
|
||||
|
||||
// but masterpage already exists
|
||||
_viewFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(false);
|
||||
_masterpageFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(true);
|
||||
|
||||
var res = _templateRepository.DetermineTemplateRenderingEngine(templateMock.Object);
|
||||
Assert.AreEqual(RenderingEngine.WebForms, res);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DetermineTemplateRenderingEngine_Returns_Mvc_When_ViewPage_Exists_And_In_Webforms_Mode()
|
||||
{
|
||||
// Project in WebForms mode
|
||||
_templateConfigMock.Setup(x => x.DefaultRenderingEngine).Returns(RenderingEngine.WebForms);
|
||||
|
||||
var templateMock = new Mock<ITemplate>();
|
||||
templateMock.Setup(x => x.Alias).Returns("Something");
|
||||
|
||||
// but MVC View already exists
|
||||
_viewFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(true);
|
||||
_masterpageFileSystemMock.Setup(x => x.FileExists(It.IsAny<string>())).Returns(false);
|
||||
|
||||
var res = _templateRepository.DetermineTemplateRenderingEngine(templateMock.Object);
|
||||
Assert.AreEqual(RenderingEngine.Mvc, res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using System.Web;
|
||||
using System.Web.Routing;
|
||||
using Moq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Tests.TestHelpers
|
||||
{
|
||||
@@ -60,7 +61,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
|
||||
//Cookie collection
|
||||
var cookieCollection = new HttpCookieCollection();
|
||||
cookieCollection.Add(new HttpCookie(Constants.Web.AuthCookieName, "FBA996E7-D6BE-489B-B199-2B0F3D2DD826"));
|
||||
cookieCollection.Add(new HttpCookie("UMB_UCONTEXT", "FBA996E7-D6BE-489B-B199-2B0F3D2DD826"));
|
||||
|
||||
//Request
|
||||
var requestMock = new Mock<HttpRequestBase>();
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<Compile Include="Logging\AsyncRollingFileAppenderTest.cs" />
|
||||
<Compile Include="Logging\DebugAppender.cs" />
|
||||
<Compile Include="Logging\ParallelForwarderTest.cs" />
|
||||
<Compile Include="Mvc\RenderIndexActionSelectorAttributeTests.cs" />
|
||||
<Compile Include="Persistence\Repositories\AuditRepositoryTest.cs" />
|
||||
<Compile Include="Persistence\Repositories\DomainRepositoryTest.cs" />
|
||||
<Compile Include="Persistence\Repositories\PartialViewRepositoryTests.cs" />
|
||||
@@ -361,6 +362,7 @@
|
||||
<Compile Include="Services\MacroServiceTests.cs" />
|
||||
<Compile Include="Services\UserServiceTests.cs" />
|
||||
<Compile Include="Manifest\ManifestParserTests.cs" />
|
||||
<Compile Include="Templates\TemplateRepositoryTests.cs" />
|
||||
<Compile Include="TestHelpers\BaseSeleniumTest.cs" />
|
||||
<Compile Include="Integration\InstallPackage.cs" />
|
||||
<Compile Include="CoreXml\NavigableNavigatorTests.cs" />
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"jquery": "2.0.3",
|
||||
"jquery-file-upload": "~9.4.0",
|
||||
"jquery-ui": "1.10.3",
|
||||
"angular-dynamic-locale": "~0.1.27",
|
||||
"angular-dynamic-locale": "0.1.27",
|
||||
"tinymce": "~4.1.10",
|
||||
"codemirror": "~5.3.0"
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider',
|
||||
];
|
||||
$scope.previewDevice = $scope.devices[0];
|
||||
|
||||
var apiController = "/Umbraco/Api/Canvasdesigner/";
|
||||
var apiController = "../Api/Canvasdesigner/";
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Preview devices */
|
||||
@@ -40,7 +40,7 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider',
|
||||
/*****************************************************************************/
|
||||
|
||||
$scope.exitPreview = function () {
|
||||
window.top.location.href = "/umbraco/endPreview.aspx?redir=%2f" + $scope.pageId;
|
||||
window.top.location.href = "../endPreview.aspx?redir=%2f" + $scope.pageId;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Umbraco Canvas Designer</title>
|
||||
<link href="/Umbraco/assets/css/canvasdesigner.css" type="text/css" rel="stylesheet" />
|
||||
<link href="/Umbraco/lib/spectrum/spectrum.css" type="text/css" rel="stylesheet" />
|
||||
<link href="/Umbraco/lib/jquery-ui/jquery-ui-1.10.4.custom.min.css" type="text/css" rel="stylesheet" />
|
||||
<link href="../assets/css/canvasdesigner.css" type="text/css" rel="stylesheet" />
|
||||
<link href="../lib/spectrum/spectrum.css" type="text/css" rel="stylesheet" />
|
||||
<link href="../lib/jquery-ui/jquery-ui-1.10.4.custom.min.css" type="text/css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body id="canvasdesignerPanel" ng-mouseover="outlinePositionHide()" ng-class="{ leftOpen: (showStyleEditor || showPalettePicker) && !showDevicesPreview }" ng-controller="Umbraco.canvasdesignerController">
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="fix-left-menu selected">
|
||||
|
||||
<div class="avatar">
|
||||
<img ng-src="/umbraco/assets/img/application/logo.png">
|
||||
<img ng-src="../assets/img/application/logo.png">
|
||||
</div>
|
||||
|
||||
<ul class="sections" ng-class="{selected: showDevicesPreview}">
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class="canvasdesigner-panel-container" ng-show="categoriesVisibility[category] === true">
|
||||
<div class="canvasdesigner-panel-property" ng-repeat="item in configItem.editors" ng-show="item.category == category">
|
||||
<h5>{{item.name}} <i class="icon icon-help-alt"></i></h5>
|
||||
<div ng-include="'/Umbraco/preview/editors/' + item.type + '.html'"></div>
|
||||
<div ng-include="'../preview/editors/' + item.type + '.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,8 +154,8 @@
|
||||
<p>Styles saved and published</p>
|
||||
</div>
|
||||
|
||||
<script src="/umbraco/lib/rgrove-lazyload/lazyload.js"></script>
|
||||
<script src="/umbraco/js/canvasdesigner.loader.js"></script>
|
||||
<script src="../lib/rgrove-lazyload/lazyload.js"></script>
|
||||
<script src="../js/canvasdesigner.loader.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ angular.module("umbraco.directives")
|
||||
if(scope.configuration && scope.configuration.stylesheets){
|
||||
angular.forEach(scope.configuration.stylesheets, function(stylesheet, key){
|
||||
|
||||
stylesheets.push("/css/" + stylesheet + ".css");
|
||||
stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + stylesheet + ".css");
|
||||
await.push(stylesheetResource.getRulesByName(stylesheet).then(function (rules) {
|
||||
angular.forEach(rules, function (rule) {
|
||||
var r = {};
|
||||
|
||||
@@ -94,14 +94,24 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
navigationService.showHelpDialog();
|
||||
};
|
||||
|
||||
scope.sectionClick = function (section) {
|
||||
scope.sectionClick = function (event, section) {
|
||||
|
||||
if (event.ctrlKey ||
|
||||
event.shiftKey ||
|
||||
event.metaKey || // apple
|
||||
(event.button && event.button === 1) // middle click, >IE9 + everyone else
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (navigationService.userDialog) {
|
||||
navigationService.userDialog.close();
|
||||
}
|
||||
if (navigationService.helpDialog) {
|
||||
navigationService.helpDialog.close();
|
||||
}
|
||||
|
||||
|
||||
navigationService.hideSearch();
|
||||
navigationService.showTree(section.alias);
|
||||
$location.path("/" + section.alias);
|
||||
|
||||
@@ -38,9 +38,9 @@ angular.module("umbraco.directives")
|
||||
'<div ng-class="getNodeCssClass(node)" ng-swipe-right="options(node, $event)" >' +
|
||||
//NOTE: This ins element is used to display the search icon if the node is a container/listview and the tree is currently in dialog
|
||||
//'<ins ng-if="tree.enablelistviewsearch && node.metaData.isContainer" class="umb-tree-node-search icon-search" ng-click="searchNode(node, $event)" alt="searchAltText"></ins>' +
|
||||
'<ins ng-class="{\'icon-navigation-right\': !node.expanded, \'icon-navigation-down\': node.expanded}" ng-click="load(node)"></ins>' +
|
||||
'<i class="icon umb-tree-icon sprTree"></i>' +
|
||||
'<a ng-click="select(node, $event)"></a>' +
|
||||
'<ins ng-class="{\'icon-navigation-right\': !node.expanded, \'icon-navigation-down\': node.expanded}" ng-click="load(node)"> </ins>' +
|
||||
'<i class="icon umb-tree-icon sprTree" ng-click="select(node, $event)"></i>' +
|
||||
'<a href="#/{{node.routePath}}" ng-click="select(node, $event)"></a>' +
|
||||
//NOTE: These are the 'option' elipses
|
||||
'<a class="umb-options" ng-click="options(node, $event)"><i></i><i></i><i></i></a>' +
|
||||
'<div ng-show="node.loading" class="l"><div></div></div>' +
|
||||
@@ -148,8 +148,17 @@ angular.module("umbraco.directives")
|
||||
and emits it as a treeNodeSelect element if there is a callback object
|
||||
defined on the tree
|
||||
*/
|
||||
scope.select = function(n, ev) {
|
||||
scope.select = function (n, ev) {
|
||||
if (ev.ctrlKey ||
|
||||
ev.shiftKey ||
|
||||
ev.metaKey || // apple
|
||||
(ev.button && ev.button === 1) // middle click, >IE9 + everyone else
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
emitEvent("treeNodeSelect", { element: element, tree: scope.tree, node: n, event: ev });
|
||||
ev.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @description Utillity directives for key and field events
|
||||
* @description Utility directives for key and field events
|
||||
**/
|
||||
angular.module('umbraco.directives')
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ angular.module("umbraco.directives").directive('focusWhen', function ($timeout)
|
||||
link: function (scope, elm, attrs, ctrl) {
|
||||
attrs.$observe("focusWhen", function (newValue) {
|
||||
if (newValue === "true") {
|
||||
elm.focus();
|
||||
$timeout(function() {
|
||||
elm.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function macroResource($q, $http, umbRequestHelper) {
|
||||
* @methodOf umbraco.resources.macroResource
|
||||
*
|
||||
* @description
|
||||
* Gets the result of a macro as html to display in the rich text editor
|
||||
* Gets the result of a macro as html to display in the rich text editor or in the Grid
|
||||
*
|
||||
* @param {int} macroId The macro id to get parameters for
|
||||
* @param {int} pageId The current page id
|
||||
@@ -45,39 +45,17 @@ function macroResource($q, $http, umbRequestHelper) {
|
||||
*/
|
||||
getMacroResultAsHtmlForEditor: function (macroAlias, pageId, macroParamDictionary) {
|
||||
|
||||
//need to format the query string for the custom dictionary
|
||||
var query = "macroAlias=" + macroAlias + "&pageId=" + pageId;
|
||||
if (macroParamDictionary) {
|
||||
var counter = 0;
|
||||
_.each(macroParamDictionary, function (val, key) {
|
||||
//check for null
|
||||
val = val ? val : "";
|
||||
//need to detect if the val is a string or an object
|
||||
if (!angular.isString(val)) {
|
||||
//if it's not a string we'll send it through the json serializer
|
||||
var json = angular.toJson(val);
|
||||
//then we need to url encode it so that it's safe
|
||||
val = encodeURIComponent(json);
|
||||
}
|
||||
else {
|
||||
//we still need to encode the string, it could contain line breaks, etc...
|
||||
val = encodeURIComponent(val);
|
||||
}
|
||||
|
||||
query += "¯oParams[" + counter + "].key=" + key + "¯oParams[" + counter + "].value=" + val;
|
||||
counter++;
|
||||
});
|
||||
}
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"macroApiBaseUrl",
|
||||
"GetMacroResultAsHtmlForEditor",
|
||||
query)),
|
||||
'Failed to retrieve macro result for macro with alias ' + macroAlias);
|
||||
$http.post(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"macroApiBaseUrl",
|
||||
"GetMacroResultAsHtmlForEditor"), {
|
||||
macroAlias: macroAlias,
|
||||
pageId: pageId,
|
||||
macroParams: macroParamDictionary
|
||||
}),
|
||||
'Failed to retrieve macro result for macro with alias ' + macroAlias);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ angular.module("umbraco.install").factory('installerService', function($rootScop
|
||||
|
||||
//add to umbraco installer facts here
|
||||
var facts = ['Umbraco helped millions of people watch a man jump from the edge of space',
|
||||
'Over 250.000 websites are currently powered by Umbraco',
|
||||
'Over 300 000 websites are currently powered by Umbraco',
|
||||
"At least 2 people have named their cat 'Umbraco'",
|
||||
'On an average day, more than 1.000 people download Umbraco',
|
||||
'On an average day, more than 1000 people download Umbraco',
|
||||
'<a target="_blank" href="http://umbraco.tv">umbraco.tv</a> is the premier source of Umbraco video tutorials to get you started',
|
||||
'You can find the world\'s friendliest CMS community at <a target="_blank" href="http://our.umbraco.org">our.umbraco.org</a>',
|
||||
'You can become a certified Umbraco developer by attending one of the official courses',
|
||||
@@ -31,7 +31,7 @@ angular.module("umbraco.install").factory('installerService', function($rootScop
|
||||
"At least 4 people have the Umbraco logo tattooed on them",
|
||||
"'Umbraco' is the danish name for an allen key",
|
||||
"Umbraco has been around since 2005, that's a looong time in IT",
|
||||
"More than 400 people from all over the world meet each year in Denmark in June for our annual conference <a target='_blank' href='http://codegarden14.com'>CodeGarden</a>",
|
||||
"More than 400 people from all over the world meet each year in Denmark in June for our annual conference <a target='_blank' href='http://codegarden15.com'>CodeGarden</a>",
|
||||
"While you are installing Umbraco someone else on the other side of the planet is probably doing it too",
|
||||
"You can extend Umbraco without modifying the source code and using either JavaScript or C#"
|
||||
];
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/******* font-face *******/
|
||||
|
||||
@font-face {
|
||||
src: url('/Umbraco/assets/fonts/helveticons/helveticons.eot') !important;
|
||||
src: url('/Umbraco/assets/fonts/helveticons/helveticons.eot?#iefix') format('embedded-opentype'), url('/Umbraco/assets/fonts/helveticons/helveticons.ttf') format('truetype'), url('/Umbraco/assets/fonts/helveticons/helveticons.svg#icomoon') format('svg') !important;
|
||||
src: url('assets/fonts/helveticons/helveticons.eot') !important;
|
||||
src: url('assets/fonts/helveticons/helveticons.eot?#iefix') format('embedded-opentype'), url('assets/fonts/helveticons/helveticons.ttf') format('truetype'), url('assets/fonts/helveticons/helveticons.svg#icomoon') format('svg') !important;
|
||||
}
|
||||
|
||||
/****************************/
|
||||
|
||||
@@ -155,7 +155,7 @@ body {
|
||||
}
|
||||
|
||||
#speechbubble {
|
||||
z-index: 1000;
|
||||
z-index: 1060;
|
||||
position: absolute;
|
||||
bottom: 100px;
|
||||
left: 0;
|
||||
@@ -266,4 +266,4 @@ body {
|
||||
margin-left: 40px;
|
||||
width: 85%!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ h5{
|
||||
.umb-control-group label.control-label {
|
||||
text-align: left
|
||||
}
|
||||
.umb-control-group label .help-block,
|
||||
.umb-control-group label .help-block,
|
||||
.umb-control-group label small {
|
||||
font-size: 11px;
|
||||
color: #a0a0a0;
|
||||
@@ -148,6 +148,11 @@ h5{
|
||||
padding-top: 5px;
|
||||
margin-left: 240px;
|
||||
}
|
||||
|
||||
.umb-user-panel .controls-row {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.controls-row label {
|
||||
display: inline-block
|
||||
}
|
||||
@@ -189,7 +194,7 @@ h5{
|
||||
|
||||
.umb-dashboard-control a{text-decoration: underline;}
|
||||
|
||||
.umb-dashboard-control
|
||||
.umb-dashboard-control
|
||||
iframe{ position: absolute; display: block; width: 99%; height: 99%; overflow: auto !important;}
|
||||
|
||||
|
||||
@@ -234,16 +239,16 @@ table thead a {
|
||||
|
||||
.umb-table tbody.ui-sortable tr.ui-sortable-helper {
|
||||
background-color: @sortableHelperBg;
|
||||
border: none;
|
||||
border: none;
|
||||
}
|
||||
.umb-table tbody.ui-sortable tr.ui-sortable-helper td
|
||||
.umb-table tbody.ui-sortable tr.ui-sortable-helper td
|
||||
{
|
||||
border:none;
|
||||
}
|
||||
|
||||
.umb-table tbody.ui-sortable tr.ui-sortable-placeholder {
|
||||
background-color: @sortablePlaceholderBg;
|
||||
border:none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.umb-table tbody.ui-sortable tr.ui-sortable-placeholder td
|
||||
@@ -363,7 +368,7 @@ table thead a {
|
||||
background: @inputBorder;
|
||||
height: 1px;
|
||||
margin: 20px 0 0 0;
|
||||
width: 82%;
|
||||
width: 82%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -432,7 +437,7 @@ table thead a {
|
||||
color:@green;
|
||||
}
|
||||
|
||||
// Loading Animation
|
||||
// Loading Animation
|
||||
// ------------------------
|
||||
|
||||
.umb-loader{
|
||||
@@ -518,11 +523,67 @@ height:1px;
|
||||
}
|
||||
|
||||
.umb-loader-wrapper {
|
||||
|
||||
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin: 10px 0;
|
||||
overflow: hidden;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Helpers
|
||||
|
||||
.strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
||||
// Input label styles
|
||||
// @Simon: not sure where to put this part yet
|
||||
// --- TODO Needs to be divided into the right .less directories
|
||||
|
||||
|
||||
// Titles for input fields
|
||||
.input-label--title {
|
||||
font-weight: bold;
|
||||
color: @black;
|
||||
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
|
||||
// Used for input checkmark fields
|
||||
.input-label--small {
|
||||
display: inline;
|
||||
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: fade(@black, 70);
|
||||
|
||||
&:hover {
|
||||
color: @black;
|
||||
}
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked + .input-label--small {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
|
||||
// Use this for headers in the panels
|
||||
.panel-dialog--header {
|
||||
border-bottom: 1px solid @gray;
|
||||
|
||||
margin: 10px 0;
|
||||
padding-bottom: 10px;
|
||||
|
||||
font-size: @fontSizeLarge;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,23 @@
|
||||
bottom: 90px;
|
||||
}
|
||||
|
||||
.umb-mediapicker-upload {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
|
||||
.form-search {
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.upload-button {
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.umb-panel.editor-breadcrumb .umb-panel-body, .umb-panel.editor-breadcrumb .umb-bottom-bar {
|
||||
bottom: 31px !important;
|
||||
}
|
||||
@@ -153,6 +170,7 @@
|
||||
border-radius: @tabsBorderRadius;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
z-index: 6020;
|
||||
}
|
||||
|
||||
.umb-btn-toolbar .dropdown-menu small {
|
||||
|
||||
@@ -40,8 +40,16 @@
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.umb-contentpicker small a {
|
||||
.umb-contentpicker small {
|
||||
|
||||
&:not(:last-child) {
|
||||
padding-right: 3px;
|
||||
border-right: 1px solid @grayMed;
|
||||
}
|
||||
|
||||
a {
|
||||
color: @gray;
|
||||
}
|
||||
}
|
||||
|
||||
/* CODEMIRROR DATATYPE */
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
@grayDarker: #222;
|
||||
@grayDark: #343434;
|
||||
@gray: #555;
|
||||
@grayMed: #999;
|
||||
@grayLight: #d9d9d9;
|
||||
@grayLighter: #f8f8f8;
|
||||
@white: #fff;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<li class="span2" ng-repeat="video in videos">
|
||||
<div class="thumbnail" style="margin-right: 20px">
|
||||
<a target="_blank" href="{{video.link}}?utm_source=core&utm_medium=help&utm_content=link&utm_campaign=tv" title="{{video.title}}">
|
||||
<img ng-src="{{video.thumbnail}}" alt="{{video.title}}">
|
||||
<img ng-src="{{video.thumbnail}}?width=120" alt="{{video.title}}">
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -34,11 +34,12 @@ angular.module("umbraco")
|
||||
$scope.submitFolder = function(e) {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
$scope.showFolderInput = false;
|
||||
|
||||
|
||||
mediaResource
|
||||
.addFolder($scope.newFolderName, $scope.options.formData.currentFolder)
|
||||
.then(function(data) {
|
||||
$scope.showFolderInput = false;
|
||||
$scope.newFolderName = "";
|
||||
|
||||
//we've added a new folder so lets clear the tree cache for that specific item
|
||||
treeService.clearCache({
|
||||
@@ -80,7 +81,7 @@ angular.module("umbraco")
|
||||
$scope.options.formData.currentFolder = folder.id;
|
||||
$scope.currentFolder = folder;
|
||||
};
|
||||
|
||||
|
||||
//This executes prior to the whole processing which we can use to get the UI going faster,
|
||||
//this also gives us the start callback to invoke to kick of the whole thing
|
||||
$scope.$on('fileuploadadd', function (e, data) {
|
||||
|
||||
@@ -62,18 +62,16 @@
|
||||
<div class="umb-panel umb-dialogs-mediapicker browser" ng-hide="target" ng-style="{opacity: dropping == true ? '0.25' : '1.0'}">
|
||||
<div class="umb-panel-header">
|
||||
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="span5">
|
||||
<div class="form-search">
|
||||
<i class="icon-search"></i>
|
||||
<input type="text"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query"
|
||||
placeholder="Filter...">
|
||||
</div>
|
||||
<div class="umb-el-wrap umb-panel-buttons umb-mediapicker-upload">
|
||||
<div class="form-search">
|
||||
<i class="icon-search"></i>
|
||||
<input type="text"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query"
|
||||
placeholder="Filter...">
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<div class="upload-button">
|
||||
<span class="btn fileinput-button" ng-class="{disabled: disabled}">
|
||||
<i class="icon-page-up"></i>
|
||||
<input type="file" name="files[]" multiple ng-disabled="disabled" class="uploader">
|
||||
@@ -103,7 +101,8 @@
|
||||
ng-show="showFolderInput"
|
||||
ng-model="newFolderName"
|
||||
ng-keydown="submitFolder($event)"
|
||||
on-blur="showFolderInput = false">
|
||||
on-blur="showFolderInput = false"
|
||||
focus-when="{{showFolderInput}}">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
angular.module("umbraco").controller('Umbraco.Dialogs.Template.SnippetController',
|
||||
function($scope) {
|
||||
$scope.type = $scope.dialogOptions.type;
|
||||
$scope.section = {
|
||||
name: "",
|
||||
required: false
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
<form novalidate name="contentForm"
|
||||
ng-controller="Umbraco.Dialogs.Template.SnippetController"
|
||||
ng-submit="close()"
|
||||
val-form-manager>
|
||||
<div class="umb-panel">
|
||||
|
||||
<div class="umb-panel-header">
|
||||
<div class="panel-dialog--header" style="border-bottom: 1px solid whitesmoke">Configure the section</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-body with-footer umb-querybuilder">
|
||||
<label>
|
||||
<div class="input-label--title">
|
||||
Section name:
|
||||
</div>
|
||||
<input type="text" ng-model="section.name"/>
|
||||
</label>
|
||||
<label ng-show="type === 'rendersection'">
|
||||
<input style="margin: 0;" type="checkbox" ng-checked="section.required" ng-model="section.required"/>
|
||||
<div class="input-label--small">
|
||||
<localize key="general_required">Required</localize>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_close">Close</localize>
|
||||
</a>
|
||||
<a href ng-click="submit(section)" class="btn btn-primary">Insert</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module("umbraco")
|
||||
.controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource) {
|
||||
.controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource, currentUserResource, formHelper) {
|
||||
|
||||
$scope.history = historyService.getCurrent();
|
||||
$scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion;
|
||||
@@ -102,4 +102,44 @@ angular.module("umbraco")
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
//create the initial model for change password property editor
|
||||
$scope.changePasswordModel = {
|
||||
alias: "_umb_password",
|
||||
view: "changepassword",
|
||||
config: {},
|
||||
value: {}
|
||||
};
|
||||
|
||||
//go get the config for the membership provider and add it to the model
|
||||
currentUserResource.getMembershipProviderConfig().then(function (data) {
|
||||
$scope.changePasswordModel.config = data;
|
||||
//ensure the hasPassword config option is set to true (the user of course has a password already assigned)
|
||||
//this will ensure the oldPassword is shown so they can change it
|
||||
$scope.changePasswordModel.config.hasPassword = true;
|
||||
$scope.changePasswordModel.config.disableToggle = true;
|
||||
});
|
||||
|
||||
////this is the model we will pass to the service
|
||||
//$scope.profile = {};
|
||||
|
||||
$scope.changePassword = function () {
|
||||
|
||||
if (formHelper.submitForm({ scope: $scope })) {
|
||||
currentUserResource.changePassword($scope.changePasswordModel.value).then(function (data) {
|
||||
|
||||
//if the password has been reset, then update our model
|
||||
if (data.value) {
|
||||
$scope.changePasswordModel.value.generatedPassword = data.value;
|
||||
}
|
||||
|
||||
formHelper.resetForm({ scope: $scope, notifications: data.notifications });
|
||||
|
||||
}, function (err) {
|
||||
|
||||
formHelper.handleError(err);
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -8,28 +8,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="headline">{{user.name}}</h1>
|
||||
<small class="umb-version">Umbraco version {{version}}</small>
|
||||
<p class="muted">
|
||||
<small>
|
||||
<localize key="user_sessionExpires" />: {{remainingAuthSeconds | timespan}}
|
||||
</small>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-body umb-scrollable">
|
||||
<div class="tab-content umb-control-group">
|
||||
|
||||
<div class="umb-pane" ng-if="canEditProfile">
|
||||
|
||||
<div class="umb-pane">
|
||||
<h5><localize key="user_yourProfile" /></h5>
|
||||
<p>
|
||||
<a href="#/users/framed/%252Fumbraco%252Fusers%252Fedituser.aspx%253Fid%253D{{user.id}}"
|
||||
<a href="#/users/framed/users%252Fedituser.aspx%253Fid%253D{{user.id}}"
|
||||
class="btn btn-primary"
|
||||
ng-click="close()">
|
||||
ng-click="close()" ng-if="canEditProfile">
|
||||
<localize key="general_edit">Edit</localize>
|
||||
</a>
|
||||
<a href
|
||||
class="btn"
|
||||
ng-click="showChangePassword = showChangePassword === true ? false : true;" ng-init="showChangePassword = false;">
|
||||
<localize key="user_newPassword">Change password</localize>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="umb-pane external-logins" ng-if="externalLoginProviders.length > 0">
|
||||
|
||||
<h5>External login providers</h5>
|
||||
@@ -63,6 +69,24 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-pane" ng-if="showChangePassword">
|
||||
<form novalidate name="passwordForm"
|
||||
ng-controller="Umbraco.Dashboard.StartupChangePasswordController"
|
||||
ng-submit="changePassword()"
|
||||
val-form-manager>
|
||||
|
||||
<h3><localize key="user_changePassword">Change password</localize></h3>
|
||||
|
||||
<umb-editor model="changePasswordModel"></umb-editor>
|
||||
|
||||
<umb-control-group hideLabel="1">
|
||||
<button class="btn btn-primary"><localize key="user_change">Change</localize></button>
|
||||
<!-- Could not get the button to change the showChangePassword scope variable to hide the form again... -->
|
||||
<!--<button class="btn"><localize key="general_cancel" ng-click="showChangePassword = false;">Cancel</localize></button>-->
|
||||
</umb-control-group>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="umb-pane">
|
||||
<h5><localize key="user_yourHistory" /></h5>
|
||||
<ul class="umb-tree">
|
||||
@@ -75,7 +99,5 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<small class="umb-version">Umbraco version {{version}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,15 +3,16 @@
|
||||
ng-submit="changePassword()"
|
||||
val-form-manager>
|
||||
|
||||
<h3>Change password</h3>
|
||||
<h3><localize key="user_changePassword">Change password</localize></h3>
|
||||
|
||||
<umb-pane>
|
||||
|
||||
<umb-editor model="changePasswordModel"></umb-editor>
|
||||
|
||||
<umb-control-group hideLabel="1">
|
||||
<button class="btn btn-primary">Change</button>
|
||||
<button class="btn btn-primary">
|
||||
<localize key="user_change">Change</localize>
|
||||
</button>
|
||||
</umb-control-group>
|
||||
|
||||
</umb-pane>
|
||||
</form>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<li ng-repeat="section in sections | limitTo: maxSections" ng-class="{current: section.alias == currentSection}">
|
||||
<a href="#/{{section.alias}}"
|
||||
ng-dblclick="sectionDblClick(section)"
|
||||
ng-click="sectionClick(section)"
|
||||
ng-click="sectionClick($event, section)"
|
||||
prevent-default>
|
||||
<section-icon icon="{{section.cssclass}}"></section-icon>
|
||||
<span>{{section.name}}</span>
|
||||
@@ -36,9 +36,9 @@
|
||||
<li ng-repeat="section in sections | limitTo: overflowingSections" ng-class="{current: section.alias == currentSection}">
|
||||
<a href="#/{{section.alias}}"
|
||||
ng-dblclick="sectionDblClick(section)"
|
||||
ng-click="sectionClick(section)"
|
||||
ng-click="sectionClick($event, section)"
|
||||
prevent-default>
|
||||
<section-icon icon="{{section.cssclass}}"></section-icon>
|
||||
<section-icon icon="{{section.cssclass}}"></section-icon>
|
||||
<span>{{section.name}}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
+28
-5
@@ -1,7 +1,7 @@
|
||||
//this controller simply tells the dialogs service to open a mediaPicker window
|
||||
//with a specified callback, this callback will receive an object with a selection on it
|
||||
|
||||
function contentPickerController($scope, dialogService, entityResource, editorState, $log, iconHelper, $routeParams, fileManager, contentEditingHelper) {
|
||||
function contentPickerController($scope, dialogService, entityResource, editorState, $log, iconHelper, $routeParams, fileManager, contentEditingHelper, angularHelper, navigationService, $location) {
|
||||
|
||||
function trim(str, chr) {
|
||||
var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g');
|
||||
@@ -49,7 +49,9 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
//the default pre-values
|
||||
var defaultConfig = {
|
||||
multiPicker: false,
|
||||
showEditButton: false,
|
||||
showOpenButton: false,
|
||||
showEditButton: false,
|
||||
showPathOnHover: false,
|
||||
startNode: {
|
||||
query: "",
|
||||
type: "content",
|
||||
@@ -64,13 +66,17 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
|
||||
//Umbraco persists boolean for prevalues as "0" or "1" so we need to convert that!
|
||||
$scope.model.config.multiPicker = ($scope.model.config.multiPicker === "1" ? true : false);
|
||||
$scope.model.config.showOpenButton = ($scope.model.config.showOpenButton === "1" ? true : false);
|
||||
$scope.model.config.showEditButton = ($scope.model.config.showEditButton === "1" ? true : false);
|
||||
|
||||
$scope.model.config.showPathOnHover = ($scope.model.config.showPathOnHover === "1" ? true : false);
|
||||
|
||||
var entityType = $scope.model.config.startNode.type === "member"
|
||||
? "Member"
|
||||
: $scope.model.config.startNode.type === "media"
|
||||
? "Media"
|
||||
: "Document";
|
||||
$scope.allowOpenButton = entityType === "Document" || entityType === "Media";
|
||||
$scope.allowEditButton = entityType === "Document";
|
||||
|
||||
//the dialog options for the picker
|
||||
var dialogOptions = {
|
||||
@@ -87,6 +93,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
$scope.clear();
|
||||
$scope.add(data);
|
||||
}
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
},
|
||||
treeAlias: $scope.model.config.startNode.type,
|
||||
section: $scope.model.config.startNode.type
|
||||
@@ -141,7 +148,23 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
|
||||
$scope.remove = function (index) {
|
||||
$scope.renderModel.splice(index, 1);
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
};
|
||||
|
||||
$scope.showNode = function (index) {
|
||||
var item = $scope.renderModel[index];
|
||||
var id = item.id;
|
||||
var section = $scope.model.config.startNode.type.toLowerCase();
|
||||
|
||||
entityResource.getPath(id, entityType).then(function (path) {
|
||||
navigationService.changeSection(section);
|
||||
navigationService.showTree(section, {
|
||||
tree: section, path: path, forceReload: false, activate: true
|
||||
});
|
||||
var routePath = section + "/" + section + "/edit/" + id.toString();
|
||||
$location.path(routePath).search("");
|
||||
});
|
||||
}
|
||||
|
||||
$scope.add = function (item) {
|
||||
var currIds = _.map($scope.renderModel, function (i) {
|
||||
@@ -150,7 +173,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
|
||||
if (currIds.indexOf(item.id) < 0) {
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon });
|
||||
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, path: item.path });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -182,7 +205,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
|
||||
|
||||
if (entity) {
|
||||
entity.icon = iconHelper.convertFromLegacyIcon(entity.icon);
|
||||
$scope.renderModel.push({ name: entity.name, id: entity.id, icon: entity.icon });
|
||||
$scope.renderModel.push({ name: entity.name, id: entity.id, icon: entity.icon, path: entity.path });
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
-10
@@ -5,19 +5,18 @@
|
||||
<ul class="unstyled list-icons"
|
||||
ui-sortable
|
||||
ng-model="renderModel">
|
||||
|
||||
<li ng-repeat="node in renderModel">
|
||||
|
||||
<li ng-repeat="node in renderModel" ng-attr-title="{{model.config.showPathOnHover && 'Path: ' + node.path || undefined}}">
|
||||
<i class="icon icon-navigation handle"></i>
|
||||
|
||||
<a href="#" prevent-default ng-click="remove($index)">
|
||||
<i class="icon icon-delete red hover-show"></i>
|
||||
<i class="{{node.icon}} hover-hide"></i>
|
||||
{{node.name}}
|
||||
</a>
|
||||
<div ng-if="!dialogEditor && model.config.showEditButton">
|
||||
<small><a href umb-launch-mini-editor="node"><localize key="edit">Edit</localize></a></small>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div ng-if="!dialogEditor && ((model.config.showOpenButton && allowOpenButton) || (model.config.showEditButton && allowEditButton))">
|
||||
<small ng-if="model.config.showOpenButton && allowOpenButton"><a href ng-click="showNode($index)"><localize key="open">Open</localize></a></small>
|
||||
<small ng-if="model.config.showEditButton && allowEditButton"><a href umb-launch-mini-editor="node"><localize key="edit">Edit</localize></a></small>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -37,11 +36,10 @@
|
||||
<div class="help-inline" val-msg-for="minCount" val-toggle-msg="minCount">
|
||||
You need to add at least {{model.config.minNumber}} items
|
||||
</div>
|
||||
|
||||
|
||||
<div class="help-inline" val-msg-for="maxCount" val-toggle-msg="maxCount">
|
||||
You can only have {{model.config.maxNumber}} items selected
|
||||
</div>
|
||||
|
||||
|
||||
</ng-form>
|
||||
</div>
|
||||
+15
-3
@@ -243,11 +243,23 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
|
||||
$scope.reloadView($scope.contentId);
|
||||
}
|
||||
});
|
||||
}, 200));
|
||||
}, 1000));
|
||||
|
||||
$scope.enterSearch = function($event) {
|
||||
$scope.filterResults = function (ev) {
|
||||
//13: enter
|
||||
|
||||
switch (ev.keyCode) {
|
||||
case 13:
|
||||
$scope.options.pageNumber = 1;
|
||||
$scope.actionInProgress = true;
|
||||
$scope.reloadView($scope.contentId);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.enterSearch = function ($event) {
|
||||
$($event.target).next().focus();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.selectAll = function($event) {
|
||||
var checkbox = $event.target;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<form class="form-search pull-right" novalidate ng-show="!actionInProgress">
|
||||
<div class="inner-addon left-addon">
|
||||
<i class="icon icon-search" ng-click="enterSearch($event)"></i>
|
||||
<input type="text" class="form-control" localize="placeholder" placeholder="@general_typeToSearch" ng-model="options.filter" prevent-enter-submit no-dirty-check>
|
||||
<input type="text" class="form-control" localize="placeholder" placeholder="@general_typeToSearch" ng-model="options.filter" ng-keydown="filterResults($event)" prevent-enter-submit no-dirty-check>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
//this controller simply tells the dialogs service to open a mediaPicker window
|
||||
//with a specified callback, this callback will receive an object with a selection on it
|
||||
angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerController",
|
||||
function ($rootScope, $scope, dialogService, entityResource, mediaResource, mediaHelper, $timeout, userService) {
|
||||
function ($rootScope, $scope, dialogService, entityResource, mediaResource, mediaHelper, $timeout, userService, angularHelper) {
|
||||
|
||||
//check the pre-values for multi-picker
|
||||
var multiPicker = $scope.model.config.multiPicker && $scope.model.config.multiPicker !== '0' ? true : false;
|
||||
@@ -54,6 +54,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl
|
||||
$scope.remove = function(index) {
|
||||
$scope.images.splice(index, 1);
|
||||
$scope.ids.splice(index, 1);
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
$scope.sync();
|
||||
};
|
||||
|
||||
@@ -76,6 +77,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl
|
||||
|
||||
$scope.images.push(media);
|
||||
$scope.ids.push(media.id);
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
});
|
||||
|
||||
$scope.sync();
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
//this controller simply tells the dialogs service to open a memberPicker window
|
||||
//with a specified callback, this callback will receive an object with a selection on it
|
||||
function memberPickerController($scope, dialogService, entityResource, $log, iconHelper){
|
||||
function memberPickerController($scope, dialogService, entityResource, $log, iconHelper, angularHelper){
|
||||
|
||||
function trim(str, chr) {
|
||||
var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g');
|
||||
@@ -27,6 +27,7 @@ function memberPickerController($scope, dialogService, entityResource, $log, ico
|
||||
$scope.clear();
|
||||
$scope.add(data);
|
||||
}
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ angular.module("umbraco")
|
||||
|
||||
//queue rules loading
|
||||
angular.forEach(editorConfig.stylesheets, function (val, key) {
|
||||
stylesheets.push("../css/" + val + ".css?" + new Date().getTime());
|
||||
|
||||
stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + val + ".css?" + new Date().getTime());
|
||||
await.push(stylesheetResource.getRulesByName(val).then(function (rules) {
|
||||
angular.forEach(rules, function (rule) {
|
||||
var r = {};
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\MySql.Data.6.9.7\lib\net45\MySql.Data.dll</HintPath>
|
||||
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
@@ -1856,6 +1856,7 @@
|
||||
<Content Include="Umbraco\Images\Editor\newdocument.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\opacity.png" />
|
||||
<Content Include="Umbraco\Images\Editor\outdent.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\renderbody.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\removeformat.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\separator.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\showStyles.png" />
|
||||
@@ -2413,7 +2414,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\"
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>7310</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:7310</IISUrl>
|
||||
<IISUrl>http://localhost:7320</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -75,13 +75,16 @@ else
|
||||
|
||||
@if (registerModel.MemberProperties != null)
|
||||
{
|
||||
@*
|
||||
It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type.
|
||||
*@
|
||||
for (var i = 0; i < registerModel.MemberProperties.Count; i++)
|
||||
{
|
||||
@Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name)
|
||||
@*
|
||||
By default this will render a textbox but if you want to change the editor template for this property you can
|
||||
@*
|
||||
By default this will render a textbox but if you want to change the editor template for this property you can
|
||||
easily change it. For example, if you wanted to render a custom editor for this field called "MyEditor" you would
|
||||
create a file at ~/Views/Shared/EditorTemplates/MyEditor.cshtml", then you will change the next line of code to
|
||||
create a file at ~/Views/Shared/EditorTemplates/MyEditor.cshtml", then you will change the next line of code to
|
||||
render your specific editor template like:
|
||||
@Html.EditorFor(m => profileModel.MemberProperties[i].Value, "MyEditor")
|
||||
*@
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
LazyLoad.js( [
|
||||
'lib/jquery/jquery.min.js',
|
||||
/* 1.1.5 */
|
||||
'lib/angular/1.1.5/angular.min.js',
|
||||
'lib/angular/1.1.5/angular-cookies.min.js',
|
||||
'lib/angular/1.1.5/angular-mobile.min.js',
|
||||
'lib/angular/1.1.5/angular-mocks.js',
|
||||
'lib/angular/1.1.5/angular-sanitize.min.js',
|
||||
'lib/underscore/underscore-min.js',
|
||||
'js/umbraco.installer.js',
|
||||
'js/umbraco.directives.js'
|
||||
], function () {
|
||||
jQuery(document).ready(function () {
|
||||
angular.bootstrap(document, ['ngSanitize', 'umbraco.install', 'umbraco.directives.validation']);
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -72,12 +72,7 @@
|
||||
views/dashboard/default/startupdashboardintro.html
|
||||
</control>
|
||||
|
||||
</tab>
|
||||
<tab caption="Change Password">
|
||||
<control showOnce="false" addPanel="false" panelCaption="">
|
||||
views/dashboard/ChangePassword.html
|
||||
</control>
|
||||
</tab>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupMemberDashboardSection">
|
||||
|
||||
@@ -75,11 +75,6 @@
|
||||
views/dashboard/default/startupdashboardintro.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Change Password">
|
||||
<control showOnce="false" addPanel="false" panelCaption="">
|
||||
views/dashboard/ChangePassword.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
<section alias="StartupMemberDashboardSection">
|
||||
<areas>
|
||||
@@ -96,7 +91,7 @@
|
||||
<area>contour</area>
|
||||
</areas>
|
||||
<tab caption="Dashboard">
|
||||
<control>/umbraco/plugins/umbracocontour/formsdashboard.ascx</control>
|
||||
<control>plugins/umbracocontour/formsdashboard.ascx</control>
|
||||
</tab>
|
||||
</section>
|
||||
</dashBoard>
|
||||
</dashBoard>
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
<plugin loadOnFrontend="true">charmap</plugin>
|
||||
<plugin loadOnFrontend="true">table</plugin>
|
||||
<plugin loadOnFrontend="true">lists</plugin>
|
||||
<plugin loadOnFrontend="true">hr</plugin>
|
||||
</plugins>
|
||||
<validElements>
|
||||
<![CDATA[+a[id|style|rel|data-id|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
<plugin loadOnFrontend="true">charmap</plugin>
|
||||
<plugin loadOnFrontend="true">table</plugin>
|
||||
<plugin loadOnFrontend="true">lists</plugin>
|
||||
<plugin loadOnFrontend="true">hr</plugin>
|
||||
</plugins>
|
||||
<validElements>
|
||||
<![CDATA[+a[id|style|rel|data-id|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.9.7" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.9.8" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
|
||||
@@ -45,7 +45,20 @@
|
||||
<p ng-bind-html-unsafe="installer.fact"></p>
|
||||
</div>
|
||||
|
||||
<h3 ng-cloak ng-animate="'fade'" id="feedback" ng-show="installer.feedback">{{installer.feedback}}</h3>
|
||||
<h3 ng-cloak ng-animate="'fade'" id="feedback" ng-show="installer.feedback">{{installer.feedback}}</h3>
|
||||
|
||||
<div id="missinglazyload" style="display: none;">
|
||||
<h3>There has been a problem with the build.</h3>
|
||||
<p>This might be because you could be offline or on a slow connection. Please try the following steps</p>
|
||||
<ol>
|
||||
<li>Make sure you have <a href="https://nodejs.org" target="_blank">Node.js</a> installed.</li>
|
||||
<li>Open command prompt and cd to \src\Umbraco.Web.UI.Client.</li>
|
||||
<li>Check to see if \src\Umbraco.Web.UI.Client\node_modules folder exists (this could be hidden); if so delete it.</li>
|
||||
<li>Run npm install; if successfull the node_modules folder should be created in the Umbraco.Web.UI.Client directory.</li>
|
||||
<li>Run build\Build.bat.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var Umbraco = {};
|
||||
Umbraco.Sys = {};
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
|
||||
</head>
|
||||
<noscript><h5><strong> JavaScript is disabled. Please enable to continue!</strong></h5></noscript>
|
||||
<body ng-class="{touch:touchDevice,emptySection:emptySection}" ng-controller="Umbraco.MainController" id="umbracoMainPageBody">
|
||||
<div ng-hide="!authenticated" ng-cloak id="mainwrapper" id="mainwrapper" class="clearfix" ng-click="closeDialogs($event)">
|
||||
|
||||
|
||||
@@ -923,6 +923,7 @@ Mange hilsner fra Umbraco robotten
|
||||
<key alias="userTypes">Brugertyper</key>
|
||||
<key alias="writer">Forfatter</key>
|
||||
<key alias="translator">Oversætter</key>
|
||||
<key alias="change">Skift</key>
|
||||
<key alias="yourProfile">Din profil</key>
|
||||
<key alias="yourHistory">Din historik</key>
|
||||
<key alias="sessionExpires">Session udløber</key>
|
||||
|
||||
@@ -1057,6 +1057,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="userTypes">User types</key>
|
||||
<key alias="writer">Writer</key>
|
||||
<key alias="translator">Translator</key>
|
||||
<key alias="change">Change</key>
|
||||
<key alias="yourProfile" version="7.0">Your profile</key>
|
||||
<key alias="yourHistory" version="7.0">Your recent history</key>
|
||||
<key alias="sessionExpires" version="7.0">Session expires in</key>
|
||||
|
||||
@@ -1055,6 +1055,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="userTypes">User types</key>
|
||||
<key alias="writer">Writer</key>
|
||||
<key alias="translator">Translator</key>
|
||||
<key alias="change">Change</key>
|
||||
<key alias="yourProfile" version="7.0">Your profile</key>
|
||||
<key alias="yourHistory" version="7.0">Your recent history</key>
|
||||
<key alias="sessionExpires" version="7.0">Session expires in</key>
|
||||
|
||||
@@ -985,6 +985,7 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de
|
||||
<key alias="usertype">Gebruikerstype</key>
|
||||
<key alias="userTypes">Gebruikerstypes</key>
|
||||
<key alias="writer">Auteur</key>
|
||||
<key alias="change">Wijzig</key>
|
||||
|
||||
<key alias="yourProfile" version="7.0">Je profiel</key>
|
||||
<key alias="yourHistory" version="7.0">Je recente historie</key>
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
table.relations td.DataType {}
|
||||
|
||||
/* direction icons */
|
||||
table.relations td.parentToChild { background-image: url('/umbraco/developer/RelationTypes/Images/ParentToChild.png'); }
|
||||
table.relations td.bidirectional { background-image: url('/umbraco/developer/RelationTypes/Images/Bidirectional.png'); }
|
||||
table.relations td.parentToChild { background-image: url('../../developer/RelationTypes/Images/ParentToChild.png'); }
|
||||
table.relations td.bidirectional { background-image: url('../../developer/RelationTypes/Images/Bidirectional.png'); }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -144,4 +144,4 @@
|
||||
</umb:Pane>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
</asp:Content>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user