-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
985e9eb
commit 290b1ce
Showing
8 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25123.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9E51B0CB-18E4-4D4C-93C4-54E07F2CFF43}") = "Sitecore.Support.421362", "Sitecore.Support.421362\Sitecore.Support.421362.csproj", "{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
10 changes: 10 additions & 0 deletions
10
src/Sitecore.Support.421362/App_Config/Include/zzz/Sitecore.Support.421362.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | ||
<sitecore> | ||
<archives defaultProvider="sql" enabled="true"> | ||
<providers> | ||
<add name="sql" type="Sitecore.Support.Data.Archiving.SqlArchiveProvider" database="*" patch:instead="*[@type='Sitecore.Data.Archiving.SqlArchiveProvider, Sitecore.Kernel']" /> | ||
</providers> | ||
</archives> | ||
</sitecore> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace Sitecore.Support.Data.Archiving | ||
{ | ||
using Sitecore.Data; | ||
using Sitecore.Data.DataProviders.Sql; | ||
using Sitecore.Security.Accounts; | ||
using System.Collections.Generic; | ||
|
||
public class SqlArchive : Sitecore.Data.Archiving.SqlArchive | ||
{ | ||
public SqlArchive(string name, Database database) : base(name, database) | ||
{ | ||
} | ||
|
||
protected override int GetEntryCount(User user) | ||
{ | ||
List<string> list = new List<string>(new string[] | ||
{ | ||
"archiveName", | ||
base.Name | ||
}); | ||
string text = "SELECT COUNT(*) FROM {0}Archive{1}\r\n WHERE {0}ArchiveName{1} = {2}archiveName{3}"; | ||
#region Changed code | ||
if (user != null && !user.IsAdministrator) | ||
#endregion | ||
{ | ||
text += " AND {0}ArchivedBy{1} = {2}archivedBy{3}"; | ||
list.AddRange(new string[] | ||
{ | ||
"archivedBy", | ||
user.Name | ||
}); | ||
} | ||
int result; | ||
using (DataProviderReader dataProviderReader = base.Api.CreateReader(text, list.ToArray())) | ||
{ | ||
result = ((!dataProviderReader.Read()) ? 0 : base.Api.GetInt(0, dataProviderReader)); | ||
} | ||
return result; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Sitecore.Support.421362/Data/Archiving/SqlArchiveProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Sitecore.Support.Data.Archiving | ||
{ | ||
using Sitecore.Data; | ||
using Sitecore.Data.Archiving; | ||
using Sitecore.Xml; | ||
using System.Xml; | ||
|
||
public class SqlArchiveProvider : Sitecore.Data.Archiving.SqlArchiveProvider | ||
{ | ||
protected override Archive GetArchive(XmlNode configNode, Database database) | ||
{ | ||
string attribute = XmlUtil.GetAttribute("name", configNode); | ||
Archive result; | ||
if (string.IsNullOrEmpty(attribute)) | ||
{ | ||
result = null; | ||
} | ||
else | ||
{ | ||
result = new Sitecore.Support.Data.Archiving.SqlArchive(attribute, database); | ||
} | ||
return result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
[assembly: AssemblyTitle("Sitecore.Support.421362")] | ||
[assembly: AssemblyProduct("Sitecore.Support.421362")] | ||
[assembly: ComVisible(false)] |
90 changes: 90 additions & 0 deletions
90
src/Sitecore.Support.421362/Sitecore.Support.421362.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<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> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion> | ||
</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{385AA4BA-DED1-4AAD-A3AA-9698285D3B2A}</ProjectGuid> | ||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Sitecore.Support</RootNamespace> | ||
<AssemblyName>Sitecore.Support.421362</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<UseIISExpress>true</UseIISExpress> | ||
<IISExpressSSLPort /> | ||
<IISExpressAnonymousAuthentication /> | ||
<IISExpressWindowsAuthentication /> | ||
<IISExpressUseClassicPipelineMode /> | ||
<UseGlobalApplicationHostFile /> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Sitecore.Kernel"> | ||
<HintPath>..\packages\SC.Sitecore.Kernel.7.2.3\lib\Sitecore.Kernel.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Web" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Configuration" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Data\Archiving\SqlArchive.cs" /> | ||
<Compile Include="Data\Archiving\SqlArchiveProvider.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="App_Config\Include\zzz\Sitecore.Support.421362.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
<None Include="web.config" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||
<WebProjectProperties> | ||
<UseIIS>True</UseIIS> | ||
<AutoAssignPort>True</AutoAssignPort> | ||
<DevelopmentServerPort>0</DevelopmentServerPort> | ||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | ||
<IISUrl>http://localhost:53138/</IISUrl> | ||
<NTLMAuthentication>False</NTLMAuthentication> | ||
<UseCustomServer>False</UseCustomServer> | ||
<CustomServerUrl> | ||
</CustomServerUrl> | ||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> | ||
</WebProjectProperties> | ||
</FlavorProperties> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="SC.Sitecore.Kernel" version="7.2.3" targetFramework="net45" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!-- Do not change this file - it must be empty, see https://github.com/SitecoreSupport/PatchCreator/issues/13 --> | ||
</configuration> |