Merge branch '1.x' into feature/localizationchanges

This commit is contained in:
Nicholas Mayne
2014-08-27 21:43:11 +01:00
357 changed files with 11910 additions and 15250 deletions

View File

@@ -13,7 +13,7 @@
<levelMin value="WARN" />
</filter>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %logger - %message%newline" />
<conversionPattern value="%date [%thread] %logger - %P{Tenant} - %message%newline %P{Url}%newline" />
</layout>
</appender>

View File

@@ -99,14 +99,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>

View File

@@ -18,7 +18,7 @@
</appSettings>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Collections.Generic"/>
@@ -55,14 +55,14 @@
<system.web>
<httpRuntime targetFramework="4.5" requestValidationMode="2.0" maxRequestLength="65536"/>
<httpRuntime targetFramework="4.5.1" requestValidationMode="2.0" maxRequestLength="65536"/>
<compilation debug="true" targetFramework="4.5" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
<compilation debug="true" targetFramework="4.5.1" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
<buildProviders>
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim"/>
</buildProviders>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Mvc, Version=5..0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
@@ -141,59 +141,59 @@
</security>
</system.webServer>
<runtime>
<gcServer enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="App_Data/Dependencies"/>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="2.2.0.0-2.6.3.862" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<runtime>
<gcServer enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="App_Data/Dependencies"/>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -33,7 +33,6 @@ namespace Orchard.Core.Tests.Body {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
builder.RegisterInstance(new Mock<IAuthorizer>().Object);

View File

@@ -52,7 +52,6 @@ namespace Orchard.Core.Tests.Common.Providers {
public override void Register(ContainerBuilder builder) {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<TestHandler>().As<IContentHandler>();
builder.RegisterType<CommonPartHandler>().As<IContentHandler>();
builder.RegisterType<CommonPartDriver>().As<IContentPartDriver>();

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Core.Tests</RootNamespace>
<AssemblyName>Orchard.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -39,7 +39,6 @@ namespace Orchard.Core.Tests.Scheduling {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
builder.RegisterType<ShapeTableLocator>().As<IShapeTableLocator>();
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();

View File

@@ -42,7 +42,6 @@ namespace Orchard.Core.Tests.Scheduling {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
builder.RegisterType<ShapeTableLocator>().As<IShapeTableLocator>();
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Profile</RootNamespace>
<AssemblyName>Orchard.Profile</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -1,9 +1,9 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.8.1.0
// SpecFlow Generator Version:1.8.0.0
// Runtime Version:4.0.30319.239
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -16,7 +16,7 @@ namespace Orchard.Profile.Tests
using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.8.1.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Profiling")]
@@ -73,13 +73,13 @@ namespace Orchard.Profile.Tests
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
testRunner.Given("I am logged in");
testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 8
testRunner.When("I go to \"/admin\"");
testRunner.When("I go to \"/admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 9
testRunner.When("I go to \"/blog0\"");
testRunner.When("I go to \"/blog0\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 10
testRunner.When("I go to \"/\"");
testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
this.ScenarioCleanup();
}
@@ -92,9 +92,9 @@ this.ScenarioSetup(scenarioInfo);
#line 12
this.ScenarioSetup(scenarioInfo);
#line 13
testRunner.Given("I am logged in");
testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 14
testRunner.When("I go to \"/admin\" 40 times");
testRunner.When("I go to \"/admin\" 40 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
this.ScenarioCleanup();
}
@@ -107,17 +107,17 @@ this.ScenarioSetup(scenarioInfo);
#line 16
this.ScenarioSetup(scenarioInfo);
#line 17
testRunner.Given("I am logged in");
testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 18
testRunner.When("I go to \"/blog0\" 10 times");
testRunner.When("I go to \"/blog0\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 19
testRunner.When("I go to \"/blog1\" 10 times");
testRunner.When("I go to \"/blog1\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 20
testRunner.When("I go to \"/blog2\" 10 times");
testRunner.When("I go to \"/blog2\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 21
testRunner.When("I go to \"/blog3\" 10 times");
testRunner.When("I go to \"/blog3\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 22
testRunner.When("I go to \"/blog4\" 10 times");
testRunner.When("I go to \"/blog4\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
this.ScenarioCleanup();
}
@@ -130,13 +130,13 @@ this.ScenarioSetup(scenarioInfo);
#line 24
this.ScenarioSetup(scenarioInfo);
#line 26
testRunner.When("I go to \"/\" 10 times");
testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 27
testRunner.When("I go to \"/\" 10 times");
testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 28
testRunner.When("I go to \"/\" 10 times");
testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 29
testRunner.When("I go to \"/\" 10 times");
testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -7,7 +7,7 @@
<system.web>
<compilation targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
</assemblies>
</compilation>
<pages>

View File

@@ -10,11 +10,11 @@
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<controls>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>

View File

@@ -26,7 +26,7 @@
</appSettings>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
@@ -49,19 +49,19 @@
<defaultSettings timeout="00:30:00"/>
</system.transactions>
<system.web>
<httpRuntime targetFramework="4.5" requestValidationMode="2.0" />
<httpRuntime targetFramework="4.5.1" requestValidationMode="2.0" />
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" targetFramework="4.5" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
<compilation debug="false" targetFramework="4.5.1" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
<buildProviders>
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim"/>
</buildProviders>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
@@ -152,7 +152,7 @@
<probing privatePath="App_Data/Dependencies"/>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
@@ -192,12 +192,12 @@
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="2.2.0.0-2.6.3.862" newVersion="3.0.0.0"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>

View File

@@ -50,7 +50,7 @@
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
@@ -139,7 +139,7 @@
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
</system.webServer>
@@ -148,7 +148,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
@@ -178,7 +178,7 @@
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Specs</RootNamespace>
<AssemblyName>Orchard.Specs</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -3,7 +3,7 @@
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.33440
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View File

@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<source name="Orchard.Tests.Logging.Thing" switchValue="Warning">
<listeners>
<add name="loopback" type="Orchard.Tests.Logging.InMemoryCapture,Orchard.Framework.Tests"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -49,7 +49,6 @@ namespace Orchard.Tests.Modules.Comments.Services {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
builder.RegisterInstance(new Mock<IAuthorizer>().Object);

View File

@@ -70,11 +70,9 @@ namespace Orchard.Tests.Modules.Indexing {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(_contentDefinitionManager.Object);
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
builder.RegisterType<OrchardServices>().As<IOrchardServices>();

View File

@@ -493,12 +493,12 @@ namespace Orchard.Tests.Modules.Indexing {
_provider.Store("default", _provider.New(3).Add("media-path", "images/pets/kitties").Store());
// Assert.That(SearchBuilder.WithField("media-path", "Pets").Mandatory().Count(), Is.EqualTo(0));
Assert.That(SearchBuilder.WithField("media-path", "Images").Mandatory().Count(), Is.EqualTo(3));
Assert.That(SearchBuilder.WithField("media-path", "Images").ExactMatch().Mandatory().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets").Mandatory().Count(), Is.EqualTo(2));
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets").ExactMatch().Mandatory().Count(), Is.EqualTo(0));
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets/Puppies").ExactMatch().Mandatory().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets/Puppies").Mandatory().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().Mandatory().Count(), Is.EqualTo(3));
Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().Mandatory().Count(), Is.EqualTo(2));
Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(0));
Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().Mandatory().Count(), Is.EqualTo(1));
}
[Test]
@@ -543,6 +543,7 @@ namespace Orchard.Tests.Modules.Indexing {
// trying in full word match mode
Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("tag-value", "Tag1").ExactMatch().Count(), Is.EqualTo(1));
Assert.That(SearchBuilder.WithField("tag-value", "Tag1").NotAnalyzed().ExactMatch().Count(), Is.EqualTo(0));
}
[Test]

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Tests.Modules</RootNamespace>
<AssemblyName>Orchard.Tests.Modules</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -318,6 +318,11 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -50,7 +50,7 @@
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>

View File

@@ -58,7 +58,6 @@ namespace Orchard.Tests.Modules.Users.Controllers {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType(typeof(SettingsFormatter)).As<ISettingsFormatter>();
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<DefaultContentQuery>().As<IContentQuery>().InstancePerDependency();
builder.RegisterInstance(new Mock<IAuthenticationService>().Object);

View File

@@ -79,7 +79,6 @@ namespace Orchard.Tests.Modules.Users.Services {
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType(typeof(SettingsFormatter)).As<ISettingsFormatter>();
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();

View File

@@ -91,7 +91,6 @@ namespace Orchard.Tests.Modules.Users.Services {
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType(typeof(SettingsFormatter)).As<ISettingsFormatter>();
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<OrchardServices>().As<IOrchardServices>();

View File

@@ -91,7 +91,6 @@ namespace Orchard.Tests.Modules.Widgets.Services {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
builder.RegisterInstance(new Mock<IAuthorizer>().Object);

View File

@@ -10,22 +10,26 @@
</sources>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -51,7 +51,6 @@ namespace Orchard.Tests.ContentManagement {
builder.RegisterType<DefaultContentManager>().As<IContentManager>().SingleInstance();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });

View File

@@ -63,7 +63,6 @@ namespace Orchard.Tests.ContentManagement {
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(_contentDefinitionManager.Object);
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
builder.RegisterInstance(new ShellSettings {Name = ShellSettings.DefaultName, DataProvider = "SqlCe"});

View File

@@ -49,7 +49,6 @@ namespace Orchard.Tests.ContentManagement {
builder.RegisterType<DefaultContentManager>().As<IContentManager>().SingleInstance();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });

View File

@@ -53,7 +53,6 @@ namespace Orchard.Tests.ContentManagement {
builder.RegisterType<DefaultContentManager>().As<IContentManager>().SingleInstance();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });

View File

@@ -53,7 +53,6 @@ namespace Orchard.Tests.Localization {
builder.RegisterType<StubHttpContextAccessor>().As<IHttpContextAccessor>();
builder.RegisterType<WorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
builder.RegisterType<TestCultureSelector>().As<ICultureSelector>();
builder.RegisterType<DefaultCultureManager>().As<ICultureManager>();

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Tests</RootNamespace>
<AssemblyName>Orchard.Framework.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -61,7 +61,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Integration.Web, Version=2.1.13.813, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<Reference Include="Autofac.Integration.Web, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\autofac\Autofac.Integration.Web.dll</HintPath>
</Reference>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.WarmupStarter</RootNamespace>
<AssemblyName>Orchard.WarmupStarter</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Web.Tests</RootNamespace>
<AssemblyName>Orchard.Web.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -51,11 +51,6 @@ namespace Orchard.Core.Common.Drivers {
}
protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
var currentUser = _authenticationService.GetAuthenticatedUser();
if (!_authorizationService.TryCheckAccess(StandardPermissions.SiteOwner, currentUser, part)) {
return null;
}
var model = new ContainerEditorViewModel();
if (part.Container != null)
model.ContainerId = part.Container.ContentItem.Id;

View File

@@ -12,6 +12,10 @@ namespace Orchard.Core.Common.Handlers {
IContentManager contentManager) {
Filters.Add(StorageFilter.For(identityRepository));
OnInitializing<IdentityPart>(AssignIdentity);
OnIndexing<IdentityPart>((context, part) => {
context.DocumentIndex.Add("identifier", part.Identifier).Store();
});
}
protected void AssignIdentity(InitializingContentContext context, IdentityPart part) {

View File

@@ -38,11 +38,11 @@ namespace Orchard.Core.Contents {
}
public IEnumerable<Permission> GetPermissions() {
// manage rights only for Creatable types
var creatableTypes = _contentDefinitionManager.ListTypeDefinitions()
.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable);
// manage rights only for Securable types
var securableTypes = _contentDefinitionManager.ListTypeDefinitions()
.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Securable);
foreach (var typeDefinition in creatableTypes) {
foreach (var typeDefinition in securableTypes) {
foreach (var permissionTemplate in PermissionTemplates.Values) {
yield return CreateDynamicPermission(permissionTemplate, typeDefinition);
}

View File

@@ -15,6 +15,10 @@ namespace Orchard.Core.Contents.Extensions {
return builder.WithSetting("ContentTypeSettings.Draftable", draftable.ToString());
}
public static ContentTypeDefinitionBuilder Securable(this ContentTypeDefinitionBuilder builder, bool securable = true) {
return builder.WithSetting("ContentTypeSettings.Securable", securable.ToString());
}
public static ContentPartDefinitionBuilder Attachable(this ContentPartDefinitionBuilder builder, bool attachable = true) {
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
}

View File

@@ -25,7 +25,7 @@ namespace Orchard.Core.Contents.Security {
var typeDefinition = context.Content.ContentItem.TypeDefinition;
// replace permission if a content type specific version exists
if (typeDefinition.Settings.GetModel<ContentTypeSettings>().Creatable) {
if (typeDefinition.Settings.GetModel<ContentTypeSettings>().Securable) {
var permission = GetContentTypeVariation(context.Permission);
if (permission != null) {

View File

@@ -16,5 +16,9 @@
/// Defines the stereotype of the type
/// </summary>
public string Stereotype { get; set; }
/// <summary>
/// Used to determine if this content type supports custom permissions
/// </summary>
public bool Securable { get; set; }
}
}

View File

@@ -1,18 +1,36 @@
using Orchard.Localization;
using Orchard.ContentManagement;
using Orchard.Localization;
using Orchard.UI.Navigation;
using System.Linq;
namespace Orchard.Core.Navigation {
public class AdminMenu : INavigationProvider {
public Localizer T { get; set; }
public string MenuName { get { return "admin"; } }
public IOrchardServices Services { get; set; }
public AdminMenu(IOrchardServices services) {
Services = services;
}
public void GetNavigation(NavigationBuilder builder) {
//todo: - add new menu? and list menus? ...and remove hard-coded menu name here
var user = Services.WorkContext.CurrentUser;
// if the current user cannot manage menus, check if they can manage at least one
if (!Services.Authorizer.Authorize(Permissions.ManageMenus)) {
var menus = Services.ContentManager.Query("Menu").List();
if (!menus.Any(x => Services.Authorizer.Authorize(Permissions.ManageMenus, x))) {
return;
}
}
builder.AddImageSet("navigation")
.Add(T("Navigation"), "7",
menu => menu
.Add(T("Main Menu"), "0", item => item.Action("Index", "Admin", new { area = "Navigation" })
.Permission(Permissions.ManageMainMenu)));
));
}
}
}

View File

@@ -44,19 +44,26 @@ namespace Orchard.Core.Navigation.Controllers {
public IOrchardServices Services { get; set; }
public ActionResult Index(NavigationManagementViewModel model, int? menuId) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Not allowed to manage the main menu"))) {
var menus = Services.ContentManager.Query("Menu").List().ToList()
.OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText);
if (!menus.Any()) {
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) {
return new HttpUnauthorizedResult();
}
return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl });
}
var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList();
if (!allowedMenus.Any()) {
return new HttpUnauthorizedResult();
}
IEnumerable<TitlePart> menus = Services.ContentManager.Query<TitlePart, TitlePartRecord>().OrderBy(x => x.Title).ForType("Menu").List();
if (!menus.Any()) {
return RedirectToAction("Create", "Admin", new {area = "Contents", id = "Menu", returnUrl = Request.RawUrl});
}
IContent currentMenu = menuId == null
? menus.FirstOrDefault()
: menus.FirstOrDefault(menu => menu.Id == menuId);
? allowedMenus.FirstOrDefault()
: allowedMenus.FirstOrDefault(menu => menu.Id == menuId);
if (currentMenu == null && menuId != null) { // incorrect menu id passed
return RedirectToAction("Index");
@@ -71,7 +78,7 @@ namespace Orchard.Core.Navigation.Controllers {
}
model.MenuItemDescriptors = _menuManager.GetMenuItemTypes();
model.Menus = menus;
model.Menus = allowedMenus;
model.CurrentMenu = currentMenu;
// need action name as this action is referenced from another action
@@ -80,7 +87,7 @@ namespace Orchard.Core.Navigation.Controllers {
[HttpPost, ActionName("Index")]
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries, int? menuId) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult();
// See http://orchard.codeplex.com/workitem/17116
@@ -109,7 +116,7 @@ namespace Orchard.Core.Navigation.Controllers {
[HttpPost]
public ActionResult Delete(int id) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult();
MenuPart menuPart = _menuService.Get(id);
@@ -148,7 +155,7 @@ namespace Orchard.Core.Navigation.Controllers {
}
public ActionResult CreateMenuItem(string id, int menuId, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult();
// create a new temporary menu item
@@ -180,7 +187,7 @@ namespace Orchard.Core.Navigation.Controllers {
[HttpPost, ActionName("CreateMenuItem")]
public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult();
var menuPart = Services.ContentManager.New<MenuPart>(id);

View File

@@ -38,7 +38,7 @@ namespace Orchard.Core.Navigation.Drivers {
protected override DriverResult Editor(AdminMenuPart part, dynamic shapeHelper) {
// todo: we need a 'ManageAdminMenu' too?
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part)) {
if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part)) {
return null;
}
@@ -51,7 +51,7 @@ namespace Orchard.Core.Navigation.Drivers {
}
protected override DriverResult Editor(AdminMenuPart part, IUpdateModel updater, dynamic shapeHelper) {
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part))
if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part))
return null;
updater.TryUpdateModel(part, Prefix, null, null);

View File

@@ -17,7 +17,7 @@ namespace Orchard.Core.Navigation.Drivers {
protected override DriverResult Editor(MenuItemPart part, dynamic shapeHelper) {
var currentUser = _workContextAccessor.GetContext().CurrentUser;
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, currentUser, part))
if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part))
return null;
return ContentShape("Parts_MenuItem_Edit",
@@ -26,7 +26,7 @@ namespace Orchard.Core.Navigation.Drivers {
protected override DriverResult Editor(MenuItemPart part, IUpdateModel updater, dynamic shapeHelper) {
var currentUser = _workContextAccessor.GetContext().CurrentUser;
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, currentUser, part))
if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part))
return null;
if (updater != null) {

View File

@@ -1,4 +1,5 @@
using JetBrains.Annotations;
using System.Linq;
using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Navigation.Models;
@@ -38,14 +39,16 @@ namespace Orchard.Core.Navigation.Drivers {
}
protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) {
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part))
var allowedMenus = _menuService.GetMenus().Where(menu => _authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu)).ToList();
if (!allowedMenus.Any())
return null;
return ContentShape("Parts_Navigation_Menu_Edit", () => {
var model = new MenuPartViewModel {
CurrentMenuId = part.Menu == null ? -1 : part.Menu.Id,
ContentItem = part.ContentItem,
Menus = _menuService.GetMenus(),
Menus = allowedMenus,
OnMenu = part.Menu != null,
MenuText = part.MenuText
};
@@ -55,14 +58,14 @@ namespace Orchard.Core.Navigation.Drivers {
}
protected override DriverResult Editor(MenuPart part, IUpdateModel updater, dynamic shapeHelper) {
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part))
return null;
var model = new MenuPartViewModel();
if(updater.TryUpdateModel(model, Prefix, null, null)) {
var menu = model.OnMenu ? _orchardServices.ContentManager.Get(model.CurrentMenuId) : null;
if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu))
return null;
part.MenuText = model.MenuText;
part.Menu = menu;

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData.Models;
using Orchard.Core.Navigation.Services;
using Orchard.Core.Title.Models;
using Orchard.Environment.Extensions.Models;
using Orchard.Security.Permissions;
namespace Orchard.Core.Navigation {
public class DynamicPermissions : IPermissionProvider {
private static readonly Permission ManageMenu = new Permission { Description = "Manage '{0}' menu", Name = "Manage_{0}", ImpliedBy = new[] { Permissions.ManageMenus } };
private readonly IMenuService _menuService;
private readonly IContentManager _contentManager;
public virtual Feature Feature { get; set; }
public DynamicPermissions(
IMenuService menuService,
IContentManager contentManager) {
_menuService = menuService;
_contentManager = contentManager;
}
public IEnumerable<Permission> GetPermissions() {
return _menuService.GetMenus().Select(menu => CreateMenuPermission(menu, _contentManager));
}
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
return Enumerable.Empty<PermissionStereotype>();
}
public static Permission CreateMenuPermission(ContentItem menu, IContentManager contentManager) {
var metadata = contentManager.GetItemMetadata(menu);
return new Permission {
Name = String.Format(ManageMenu.Name, metadata.Identity),
Description = String.Format(ManageMenu.Description, metadata.DisplayText),
Category = "Navigation Feature",
ImpliedBy = new[] { Permissions.ManageMenus }
};
}
}
}

View File

@@ -4,13 +4,13 @@ using Orchard.Security.Permissions;
namespace Orchard.Core.Navigation {
public class Permissions : IPermissionProvider {
public static readonly Permission ManageMainMenu = new Permission { Name = "ManageMainMenu", Description = "Manage main menu" };
public static readonly Permission ManageMenus = new Permission { Name = "ManageMenus", Description = "Manage all menus" };
public virtual Feature Feature { get; set; }
public IEnumerable<Permission> GetPermissions() {
return new[] {
ManageMainMenu
ManageMenus
};
}
@@ -18,7 +18,7 @@ namespace Orchard.Core.Navigation {
return new[] {
new PermissionStereotype {
Name = "Administrator",
Permissions = new[] {ManageMainMenu}
Permissions = new[] {ManageMenus}
}
};
}

View File

@@ -0,0 +1,30 @@
using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.Security;
namespace Orchard.Core.Navigation.Security {
[UsedImplicitly]
public class AuthorizationEventHandler : IAuthorizationServiceEventHandler {
private readonly IContentManager _contentManager;
public AuthorizationEventHandler(IContentManager contentManager) {
_contentManager = contentManager;
}
public void Checking(CheckAccessContext context) { }
public void Complete(CheckAccessContext context) { }
public void Adjust(CheckAccessContext context) {
if (!context.Granted && context.Permission.Name == Permissions.ManageMenus.Name && context.Content != null) {
var menuAsContentItem = context.Content.As<ContentItem>();
if (menuAsContentItem == null || menuAsContentItem.Id <= 0) {
return;
}
context.Adjusted = true;
context.Permission = DynamicPermissions.CreateMenuPermission(menuAsContentItem, _contentManager);
}
}
}
}

View File

@@ -9,6 +9,8 @@
Script.Require("jQueryUI_Sortable").AtFoot();
Script.Include("jquery.mjs.nestedSortable.js").AtFoot();
Script.Include("navigation-admin.js").AtFoot();
var hasPermission = Authorizer.Authorize(Orchard.Core.Navigation.Permissions.ManageMenus);
}
<div id="save-message" class="message message-Warning">@T("You need to hit \"Save All\" in order to save your changes.")</div>
@@ -23,14 +25,17 @@
@Html.SelectOption(Model.CurrentMenu.Id, menu.Id, Convert.ToString(Html.ItemDisplayText(menu)))
}
</select>
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" })
@if (hasPermission) {
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" })
}
</fieldset>
}
}
@if (hasPermission) {
<div id="navigation-menu-add">
@Html.Link(T("Add a new menu...").Text, Url.Action("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl }))
</div>
}
</div>
@@ -131,6 +136,10 @@
<script type="text/javascript">
//<![CDATA[
var leaveConfirmation = '@T("Some items where not saved.")';
$('#menuId').change(function () {
$(this).parents('form').submit();
});
//]]>
</script>
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Core</RootNamespace>
<AssemblyName>Orchard.Core</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -152,6 +152,7 @@
<Compile Include="Navigation\Drivers\MenuItemPartDriver.cs" />
<Compile Include="Navigation\Drivers\MenuWidgetPartDriver.cs" />
<Compile Include="Navigation\Drivers\ShapeMenuItemPartDriver.cs" />
<Compile Include="Navigation\DynamicPermissions.cs" />
<Compile Include="Navigation\Handlers\AdminMenuPartHandler.cs" />
<Compile Include="Navigation\Handlers\MenuHandler.cs" />
<Compile Include="Navigation\Handlers\MenuItemPartHandler.cs" />
@@ -160,6 +161,7 @@
<Compile Include="Navigation\Models\AdminMenuPartRecord.cs" />
<Compile Include="Navigation\Models\MenuWidgetPart.cs" />
<Compile Include="Navigation\Models\ShapeMenuItemPart.cs" />
<Compile Include="Navigation\Security\AuthorizationEventHandler.cs" />
<Compile Include="Navigation\Services\AdminMenuNavigationProvider.cs" />
<Compile Include="Navigation\Services\DefaultMenuManager.cs" />
<Compile Include="Navigation\Services\IMenuManager.cs" />

View File

@@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -23,13 +23,21 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -13,7 +13,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lucene</RootNamespace>
<AssemblyName>Lucene</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
<FileUpgradeFlags>

View File

@@ -12,6 +12,7 @@ using Orchard.Indexing;
using Orchard.Logging;
using Lucene.Net.Documents;
using Lucene.Net.QueryParsers;
using Lucene.Net.Analysis.Tokenattributes;
namespace Lucene.Services {
public class LuceneSearchBuilder : ISearchBuilder {
@@ -19,8 +20,8 @@ namespace Lucene.Services {
private const int MaxResults = Int16.MaxValue;
private readonly Directory _directory;
private ILuceneAnalyzerProvider _analyzerProvider;
private string _indexName;
private Analyzer _analyzer;
private readonly List<BooleanClause> _clauses;
private readonly List<BooleanClause> _filters;
@@ -34,6 +35,7 @@ namespace Lucene.Services {
// pending clause attributes
private Occur _occur;
private bool _exactMatch;
private bool _notAnalyzed;
private float _boost;
private Query _query;
@@ -45,7 +47,7 @@ namespace Lucene.Services {
string indexName) {
_directory = directory;
_indexName = indexName;
_analyzerProvider = analyzerProvider;
_analyzer = analyzerProvider.GetAnalyzer(_indexName);
Logger = NullLogger.Instance;
@@ -79,7 +81,7 @@ namespace Lucene.Services {
foreach (var defaultField in defaultFields) {
CreatePendingClause();
_query = new QueryParser(LuceneIndexProvider.LuceneVersion, defaultField, _analyzerProvider.GetAnalyzer(_indexName)).Parse(query);
_query = new QueryParser(LuceneIndexProvider.LuceneVersion, defaultField, _analyzer).Parse(query);
}
return this;
@@ -127,7 +129,7 @@ namespace Lucene.Services {
public ISearchBuilder WithinRange(string field, string min, string max, bool includeMin = true, bool includeMax = true) {
CreatePendingClause();
_query = new TermRangeQuery(field, min != null ? QueryParser.Escape(min.ToLower()) : null, max != null ? QueryParser.Escape(max.ToLower()) : null, includeMin, includeMax);
_query = new TermRangeQuery(field, min != null ? QueryParser.Escape(min) : null, max != null ? QueryParser.Escape(max) : null, includeMin, includeMax);
return this;
}
@@ -135,7 +137,7 @@ namespace Lucene.Services {
CreatePendingClause();
if (!String.IsNullOrWhiteSpace(value)) {
_query = new TermQuery(new Term(field, QueryParser.Escape(value.ToLower())));
_query = new TermQuery(new Term(field, QueryParser.Escape(value)));
}
return this;
@@ -156,6 +158,11 @@ namespace Lucene.Services {
return this;
}
public ISearchBuilder NotAnalyzed() {
_notAnalyzed = true;
return this;
}
public ISearchBuilder Weighted(float weight) {
_boost = weight;
return this;
@@ -164,6 +171,7 @@ namespace Lucene.Services {
private void InitPendingClause() {
_occur = Occur.SHOULD;
_exactMatch = false;
_notAnalyzed = false;
_query = null;
_boost = 0;
_asFilter = false;
@@ -180,14 +188,32 @@ namespace Lucene.Services {
_query.Boost = _boost;
}
if (!_notAnalyzed) {
var termQuery = _query as TermQuery;
if (termQuery != null) {
var term = termQuery.Term;
var analyzedText = AnalyzeText(_analyzer, term.Field, term.Text).FirstOrDefault();
_query = new TermQuery(new Term(term.Field, analyzedText));
}
var termRangeQuery = _query as TermRangeQuery;
if (termRangeQuery != null) {
var lowerTerm = AnalyzeText(_analyzer, termRangeQuery.Field, termRangeQuery.LowerTerm).FirstOrDefault();
var upperTerm = AnalyzeText(_analyzer, termRangeQuery.Field, termRangeQuery.UpperTerm).FirstOrDefault();
_query = new TermRangeQuery(termRangeQuery.Field, lowerTerm, upperTerm, termRangeQuery.IncludesLower, termRangeQuery.IncludesUpper);
}
}
if (!_exactMatch) {
var termQuery = _query as TermQuery;
if (termQuery != null) {
var term = termQuery.Term;
// prefixed queries are case sensitive
_query = new PrefixQuery(term);
_query = new PrefixQuery(new Term(term.Field, term.Text));
}
}
if (_asFilter) {
_filters.Add(new BooleanClause(_query, _occur));
}
@@ -198,6 +224,27 @@ namespace Lucene.Services {
InitPendingClause();
}
private static List<string> AnalyzeText(Analyzer analyzer, string field, string text) {
if (String.IsNullOrEmpty(text)) {
return new List<string>();
}
var result = new List<string>();
using (var sr = new System.IO.StringReader(text)) {
using (TokenStream stream = analyzer.TokenStream(field, sr)) {
while (stream.IncrementToken()) {
var termAttribute = stream.GetAttribute<ITermAttribute>();
if(termAttribute != null) {
result.Add(termAttribute.Term);
}
}
}
}
return result;
}
public ISearchBuilder SortBy(string name) {
_sort = name;
_comparer = 0;

View File

@@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -23,13 +23,21 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Markdown</RootNamespace>
<AssemblyName>Markdown</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -23,13 +23,21 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Alias</RootNamespace>
<AssemblyName>Orchard.Alias</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -1,41 +1,45 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<remove name="host" />
<remove name="pages" />
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<remove name="host"/>
<remove name="pages"/>
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Web.WebPages"/>
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
</system.web>
</configuration>
</configuration>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.AntiSpam</RootNamespace>
<AssemblyName>Orchard.AntiSpam</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -23,13 +23,21 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -13,7 +13,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.ArchiveLater</RootNamespace>
<AssemblyName>Orchard.ArchiveLater</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>

View File

@@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc"/>
@@ -23,13 +23,21 @@
</namespaces>
</pages>
</system.web.webPages.razor>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.1" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.5">
<compilation targetFramework="4.5.1">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>

View File

@@ -48,7 +48,8 @@ namespace Orchard.AuditTrail.Drivers {
};
var viewModel = new AuditTrailSettingsViewModel {
Categories = categoriesQuery.ToList()
Categories = categoriesQuery.ToList(),
EnableClientIpAddressLogging = part.EnableClientIpAddressLogging
};
// Update the settings as we may have added new settings.
@@ -58,12 +59,13 @@ namespace Orchard.AuditTrail.Drivers {
var eventsDictionary = _auditTrailManager.DescribeProviders().Describe().SelectMany(x => x.Events).ToDictionary(x => x.Event);
if (updater.TryUpdateModel(viewModel, Prefix, null, null)) {
foreach (var eventSettingViewModel in viewModel.Categories.SelectMany(x => x.Events)) {
var eventSetting = eventSettings.FirstOrDefault(x => x.EventName == eventSettingViewModel.Event);
var eventSetting = eventSettings.First(x => x.EventName == eventSettingViewModel.Event);
var descriptor = eventsDictionary[eventSetting.EventName];
eventSetting.IsEnabled = eventSettingViewModel.IsEnabled || descriptor.IsMandatory;
}
part.EventSettings = eventSettings;
part.EnableClientIpAddressLogging = viewModel.EnableClientIpAddressLogging;
}
}

View File

@@ -0,0 +1,31 @@
using Orchard.AuditTrail.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Security;
namespace Orchard.AuditTrail.Drivers {
public class ClientIpAddressSettingsPartDriver : ContentPartDriver<ClientIpAddressSettingsPart> {
private readonly IAuthorizer _authorizer;
public ClientIpAddressSettingsPartDriver(IAuthorizer authorizer) {
_authorizer = authorizer;
}
protected override DriverResult Editor(ClientIpAddressSettingsPart part, dynamic shapeHelper) {
return Editor(part, null, shapeHelper);
}
protected override DriverResult Editor(ClientIpAddressSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
if (!_authorizer.Authorize(Permissions.ManageClientIpAddressSettings))
return null;
return ContentShape("Parts_ClientIpAddressSettings_Edit", () => {
if (updater != null) {
updater.TryUpdateModel(part, Prefix, null, null);
}
return shapeHelper.EditorTemplate(TemplateName: "Parts.ClientIpAddressSettings", Model: part, Prefix: Prefix);
}).OnGroup("Audit Trail");
}
}
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Collections.Generic;
using Orchard.AuditTrail.Models;
using Orchard.AuditTrail.Providers.AuditTrail;
using Orchard.AuditTrail.Services;
@@ -9,7 +6,6 @@ using Orchard.Caching;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Localization;
using Orchard.Logging;
namespace Orchard.AuditTrail.Handlers {
public class AuditTrailSettingsPartHandler : ContentHandler {

View File

@@ -0,0 +1,17 @@
using Orchard.AuditTrail.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Localization;
namespace Orchard.AuditTrail.Handlers {
public class ClientIpAddressSettingsPartHandler : ContentHandler {
public ClientIpAddressSettingsPartHandler() {
Filters.Add(new ActivatingFilter<ClientIpAddressSettingsPart>("Site"));
OnGetContentItemMetadata<ClientIpAddressSettingsPart>((context, part) => context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Audit Trail"))));
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
}
}

View File

@@ -17,13 +17,20 @@ namespace Orchard.AuditTrail {
.Column<string>("EventData", c => c.Unlimited())
.Column<string>("EventFilterKey", c => c.WithLength(16))
.Column<string>("EventFilterData", c => c.WithLength(256))
.Column<string>("Comment", c => c.Unlimited()));
.Column<string>("Comment", c => c.Unlimited())
.Column<string>("ClientIpAddress", c => c.WithLength(46)));
ContentDefinitionManager.AlterPartDefinition("AuditTrailPart", part => part
.Attachable()
.WithDescription("Enables the user to enter a comment about the change when saving a content item."));
.WithDescription("Adds an inline audit trail to content items, and allows editors to enter a comment when saving content items."));
return 1;
return 2;
}
public int UpdateFrom1() {
SchemaBuilder.AlterTable("AuditTrailEventRecord", table => table
.AddColumn<string>("ClientIpAddress", c => c.WithLength(46)));
return 2;
}
}
}

View File

@@ -17,5 +17,6 @@ namespace Orchard.AuditTrail.Models {
[StringLengthMax]
public virtual string Comment { get; set; }
public virtual string ClientIpAddress { get; set; }
}
}

View File

@@ -10,5 +10,10 @@ namespace Orchard.AuditTrail.Models {
get { return _eventProviderSettingsField.Value; }
set { _eventProviderSettingsField.Value = value; }
}
public bool EnableClientIpAddressLogging {
get { return this.Retrieve(x => x.EnableClientIpAddressLogging); }
set { this.Store(x => x.EnableClientIpAddressLogging, value); }
}
}
}

View File

@@ -0,0 +1,16 @@
using Orchard.ContentManagement;
namespace Orchard.AuditTrail.Models {
public class ClientIpAddressSettingsPart : ContentPart {
public bool EnableClientIpAddressHeader {
get { return this.Retrieve(x => x.EnableClientIpAddressHeader); }
set { this.Store(x => x.EnableClientIpAddressHeader, value); }
}
public string ClientIpAddressHeaderName {
get { return this.Retrieve(x => x.ClientIpAddressHeaderName, "X-Forwarded-For"); }
set { this.Store(x => x.ClientIpAddressHeaderName, value); }
}
}
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.AuditTrail</RootNamespace>
<AssemblyName>Orchard.AuditTrail</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -57,13 +57,16 @@
<Reference Include="System.ComponentModel.DataAnnotations">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
@@ -75,7 +78,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Placement.info" />
<Content Include="Placement.info" />
<Content Include="Lib\XmlDiffPatch\xmldiffpatch.dll" />
<Content Include="Recipes\audit-trail.recipe.xml" />
<Content Include="Scripts\audittrail-expando.js" />
@@ -181,8 +184,10 @@
<Compile Include="AdminMenu.cs" />
<Compile Include="Controllers\ContentController.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Drivers\ClientIpAddressSettingsPartDriver.cs" />
<Compile Include="Drivers\AuditTrailTrimmingSettingsPartDriver.cs" />
<Compile Include="Drivers\AuditTrailSettingsPartDriver.cs" />
<Compile Include="Handlers\ClientIpAddressSettingsPartHandler.cs" />
<Compile Include="Handlers\AuditTrailTrimmingSettingsPartHandler.cs" />
<Compile Include="Helpers\FiltersExtensions.cs" />
<Compile Include="Helpers\DateTimeExtensions.cs" />
@@ -194,11 +199,14 @@
<Compile Include="ImportExport\AuditTrailExportHandler.cs" />
<Compile Include="ImportExport\AuditTrailImportHandler.cs" />
<Compile Include="Models\AuditTrailEventRecordResult.cs" />
<Compile Include="Models\ClientIpAddressSettingsPart.cs" />
<Compile Include="Models\AuditTrailTrimmingSettingsPart.cs" />
<Compile Include="Providers\AuditTrail\AuditTrailTrimmingSettingsEventProvider.cs" />
<Compile Include="Providers\AuditTrail\AuditTrailSettingsEventProvider.cs" />
<Compile Include="Providers\ContentDefinition\Shapes\ContentPartImportedEventShape.cs" />
<Compile Include="Providers\ContentDefinition\Shapes\ContentTypeImportedEventShape.cs" />
<Compile Include="Services\DefaultClientIpAddressProvider.cs" />
<Compile Include="Services\IClientIpAddressProvider.cs" />
<Compile Include="Services\Models\AuditTrailSettingsContext.cs" />
<Compile Include="Services\CommonAuditTrailEventHandler.cs" />
<Compile Include="Services\AuditTrailEventHandlerBase.cs" />
@@ -291,7 +299,9 @@
<ItemGroup>
<Content Include="Views\EditorTemplates\Parts.AuditTrail.Comment.cshtml" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Views\EditorTemplates\Parts.ClientIpAddressSettings.cshtml" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

View File

@@ -7,6 +7,7 @@ namespace Orchard.AuditTrail {
public static readonly Permission ViewAuditTrail = new Permission { Description = "View audit trail", Name = "ViewAuditTrail" };
public static readonly Permission ManageAuditTrailSettings = new Permission { Description = "Manage audit trail settings", Name = "ManageAuditTrailSettings" };
public static readonly Permission ImportAuditTrail = new Permission { Description = "Import audit trail", Name = "ImportAuditTrail" };
public static readonly Permission ManageClientIpAddressSettings = new Permission { Description = "Manage client IP address settings", Name = "ManageClientIpAddressSettings" };
public virtual Feature Feature { get; set; }
@@ -14,6 +15,7 @@ namespace Orchard.AuditTrail {
yield return ViewAuditTrail;
yield return ManageAuditTrailSettings;
yield return ImportAuditTrail;
yield return ManageClientIpAddressSettings;
}
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
@@ -22,7 +24,8 @@ namespace Orchard.AuditTrail {
Permissions = new[] {
ViewAuditTrail,
ManageAuditTrailSettings,
/* Not even an administrator will get the ImportAuditTrail permission. */
ManageClientIpAddressSettings,
/* Not even an administrator will get the ImportAuditTrail permission by default. */
}
};
}

View File

@@ -3,7 +3,8 @@
Parts_AuditTrail_Link="Content:after.2"
Parts_AuditTrail="Content:after.3"
Parts_AuditTrailSettings_Edit="Content:0"
Parts_AuditTrailTrimmingSettings_Edit="Content:1"/>
Parts_AuditTrailTrimmingSettings_Edit="Content:3"
Parts_ClientIpAddressSettings_Edit="Content:2"/>
<Match DisplayType="SummaryAdmin">
<Place Parts_Contents_AuditTrail_SummaryAdmin="Actions:7"/>

View File

@@ -26,6 +26,7 @@ namespace Orchard.AuditTrail.Services {
private readonly ISiteService _siteService;
private readonly ISignals _signals;
private readonly IShapeFactory _shapeFactory;
private readonly IClientIpAddressProvider _clientIpAddressProvider;
public AuditTrailManager(
IRepository<AuditTrailEventRecord> auditTrailRepository,
@@ -36,7 +37,8 @@ namespace Orchard.AuditTrail.Services {
ICacheManager cacheManager,
ISiteService siteService,
ISignals signals,
IShapeFactory shapeFactory) {
IShapeFactory shapeFactory,
IClientIpAddressProvider clientIpAddressProvider) {
_auditTrailRepository = auditTrailRepository;
_providers = providers;
@@ -47,6 +49,7 @@ namespace Orchard.AuditTrail.Services {
_siteService = siteService;
_signals = signals;
_shapeFactory = shapeFactory;
_clientIpAddressProvider = clientIpAddressProvider;
}
public IPageOfItems<AuditTrailEventRecord> GetRecords(
@@ -151,7 +154,8 @@ namespace Orchard.AuditTrail.Services {
EventData = _serializer.Serialize(context.EventData),
EventFilterKey = context.EventFilterKey,
EventFilterData = context.EventFilterData,
Comment = context.Comment
Comment = context.Comment,
ClientIpAddress = GetClientIpAddress()
};
_auditTrailRepository.Create(record);
@@ -161,18 +165,6 @@ namespace Orchard.AuditTrail.Services {
};
}
private bool IsEventEnabled(AuditTrailEventDescriptor eventDescriptor) {
if (eventDescriptor.IsMandatory)
return true;
var settingsDictionary = _cacheManager.Get("AuditTrail.EventSettings", context => {
context.Monitor(_signals.When("AuditTrail.EventSettings"));
return _siteService.GetSiteSettings().As<AuditTrailSettingsPart>().EventSettings.ToDictionary(x => x.EventName);
});
var setting = settingsDictionary.ContainsKey(eventDescriptor.Event) ? settingsDictionary[eventDescriptor.Event] : default(AuditTrailEventSetting);
return setting != null ? setting.IsEnabled : eventDescriptor.IsEnabledByDefault;
}
public IEnumerable<AuditTrailCategoryDescriptor> DescribeCategories() {
var context = DescribeProviders();
return context.Describe();
@@ -245,5 +237,26 @@ namespace Orchard.AuditTrail.Services {
}
return Enumerable.Empty<AuditTrailEventSetting>();
}
private string GetClientIpAddress() {
var settings = _siteService.GetSiteSettings().As<AuditTrailSettingsPart>();
if (!settings.EnableClientIpAddressLogging)
return null;
return _clientIpAddressProvider.GetClientIpAddress();
}
private bool IsEventEnabled(AuditTrailEventDescriptor eventDescriptor) {
if (eventDescriptor.IsMandatory)
return true;
var settingsDictionary = _cacheManager.Get("AuditTrail.EventSettings", context => {
context.Monitor(_signals.When("AuditTrail.EventSettings"));
return _siteService.GetSiteSettings().As<AuditTrailSettingsPart>().EventSettings.ToDictionary(x => x.EventName);
});
var setting = settingsDictionary.ContainsKey(eventDescriptor.Event) ? settingsDictionary[eventDescriptor.Event] : default(AuditTrailEventSetting);
return setting != null ? setting.IsEnabled : eventDescriptor.IsEnabledByDefault;
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Orchard.AuditTrail.Models;
using Orchard.ContentManagement;
namespace Orchard.AuditTrail.Services {
public class DefaultClientIpAddressProvider : IClientIpAddressProvider {
private readonly IWorkContextAccessor _wca;
public DefaultClientIpAddressProvider(IWorkContextAccessor wca) {
_wca = wca;
}
public string GetClientIpAddress() {
var workContext = _wca.GetContext();
var settings = workContext.CurrentSite.As<ClientIpAddressSettingsPart>();
var address = workContext.HttpContext.Request.UserHostAddress;
if (settings.EnableClientIpAddressHeader && !String.IsNullOrWhiteSpace(settings.ClientIpAddressHeaderName)) {
var headerName = settings.ClientIpAddressHeaderName.Trim();
var customAddresses = ParseAddresses(workContext.HttpContext.Request.Headers[headerName]).ToArray();
if (customAddresses.Any())
address = customAddresses.First();
}
return address;
}
private static IEnumerable<string> ParseAddresses(string value) {
return !String.IsNullOrWhiteSpace(value)
? value.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim())
: Enumerable.Empty<string>();
}
}
}

View File

@@ -0,0 +1,5 @@
namespace Orchard.AuditTrail.Services {
public interface IClientIpAddressProvider : IDependency {
string GetClientIpAddress();
}
}

View File

@@ -37,6 +37,7 @@
.audittrail-list-section table .category-column,
.audittrail-list-section table .event-column,
.audittrail-list-section table .user-column,
.audittrail-list-section table .client-ip-address-column,
.audittrail-list-section table .timestamp-column {
white-space: nowrap;
}

View File

@@ -3,5 +3,6 @@ using System.Collections.Generic;
namespace Orchard.AuditTrail.ViewModels {
public class AuditTrailSettingsViewModel {
public IList<AuditTrailCategorySettingsViewModel> Categories { get; set; }
public bool EnableClientIpAddressLogging { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More