mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Merge
--HG-- branch : dev rename : src/Orchard.Tests/Orchard.Tests.csproj => src/Orchard.Tests/Orchard.Framework.Tests.csproj rename : src/Orchard/Orchard.csproj => src/Orchard/Orchard.Framework.csproj
This commit is contained in:
commit
6c74a37693
@ -67,14 +67,10 @@
|
||||
<Reference Include="System.Web.Routing">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Common\Providers\CommonAspectProviderTests.cs" />
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
@ -78,9 +78,6 @@
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
|
@ -192,6 +192,7 @@
|
||||
<Compile Include="UI\Navigation\MenuItemComparerTests.cs" />
|
||||
<Compile Include="UI\Navigation\NavigationManagerTests.cs" />
|
||||
<Compile Include="UI\Navigation\PositionComparerTests.cs" />
|
||||
<Compile Include="Utility\Extensions\StringExtensionsTests.cs" />
|
||||
<Compile Include="Utility\ReflectOnTests.cs" />
|
||||
<Compile Include="Utility\ReflectTests.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -0,0 +1,31 @@
|
||||
using NUnit.Framework;
|
||||
using Orchard.Extensions;
|
||||
|
||||
namespace Orchard.Tests.Utility.Extensions {
|
||||
[TestFixture]
|
||||
public class StringExtensionsTests {
|
||||
[Test]
|
||||
public void IsNullOrEmptyTrimmed_EmptyStringReturnsTrue() {
|
||||
const string testString = "";
|
||||
Assert.AreEqual(true, testString.IsNullOrEmptyTrimmed());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsNullOrEmptyTrimmed_NullStringReturnsTrue() {
|
||||
const string testString = null;
|
||||
Assert.AreEqual(true, testString.IsNullOrEmptyTrimmed());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsNullOrEmptyTrimmed_SpacedStringReturnsTrue() {
|
||||
const string testString = " ";
|
||||
Assert.AreEqual(true, testString.IsNullOrEmptyTrimmed());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsNullOrEmptyTrimmed_ActualStringReturnsFalse() {
|
||||
const string testString = "testString";
|
||||
Assert.AreEqual(false, testString.IsNullOrEmptyTrimmed());
|
||||
}
|
||||
}
|
||||
}
|
@ -43,7 +43,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\nunit\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core">
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Core.Common {
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Results;
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
|
||||
namespace Orchard.Core.Feeds {
|
||||
public interface IFeedItemBuilder : IEvents {
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
using Orchard.Core.Feeds.Models;
|
||||
|
||||
namespace Orchard.Core.Feeds {
|
||||
public interface IFeedQueryProvider : IEvents {
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
|
@ -32,16 +32,12 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
@ -49,16 +45,12 @@
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Common\Drivers\BodyDriver.cs" />
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Core.Themes {
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Orchard.Core.Themes.ViewModels {
|
||||
|
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Logging;
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Logging;
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
@ -32,32 +32,18 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc;
|
||||
using Futures.Widgets.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Mvc.Filters;
|
||||
|
@ -7,7 +7,6 @@ using Orchard.Blogs.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Mvc.AntiForgery;
|
||||
using Orchard.Mvc.FollowReturnUrl;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.UI.Admin;
|
||||
using Orchard.UI.Notify;
|
||||
@ -101,7 +100,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit"), FollowReturnUrl]
|
||||
[HttpPost, ActionName("Edit")]
|
||||
public ActionResult EditPOST(string blogSlug, int postId) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.EditBlogPost, T("Couldn't edit blog post")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Data.Conventions;
|
||||
|
||||
namespace Orchard.Comments.Models {
|
||||
public class CommentRecord : ContentPartRecord {
|
||||
@ -9,6 +10,7 @@ namespace Orchard.Comments.Models {
|
||||
public virtual string Email { get; set; }
|
||||
public virtual CommentStatus Status { get; set; }
|
||||
public virtual DateTime? CommentDateUtc { get; set; }
|
||||
[StringLengthMax]
|
||||
public virtual string CommentText { get; set; }
|
||||
public virtual int CommentedOn { get; set; }
|
||||
public virtual int CommentedOnContainer { get; set; }
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Media.Models;
|
||||
using Orchard.Media.Services;
|
||||
@ -146,6 +146,13 @@ namespace Orchard.Media.Controllers {
|
||||
if (!Services.Authorizer.Authorize(Permissions.UploadMediaFiles, T("Couldn't upload media file")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if(Request.Files[0].FileName.IsNullOrEmptyTrimmed()) {
|
||||
ModelState.AddModelError("File", T("Select a file to upload").ToString());
|
||||
}
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return View(viewModel);
|
||||
|
||||
foreach (string fileName in Request.Files) {
|
||||
HttpPostedFileBase file = Request.Files[fileName];
|
||||
_mediaService.UploadMediaFile(viewModel.MediaPath, file);
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Media {
|
||||
|
@ -7,7 +7,6 @@ using JetBrains.Annotations;
|
||||
using Orchard.Localization;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Mvc.AntiForgery;
|
||||
using Orchard.Mvc.FollowReturnUrl;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.Pages.Drivers;
|
||||
using Orchard.Pages.Models;
|
||||
@ -174,7 +173,7 @@ namespace Orchard.Pages.Controllers {
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit"), FollowReturnUrl]
|
||||
[HttpPost, ActionName("Edit")]
|
||||
public ActionResult EditPOST(int id) {
|
||||
var page = _pageService.GetPageOrDraft(id);
|
||||
if (page == null)
|
||||
|
@ -5,7 +5,7 @@ using System.Security.Principal;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.FollowReturnUrl;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.Users.Services;
|
||||
@ -52,7 +52,7 @@ namespace Orchard.Users.Controllers {
|
||||
return View("LogOn", new LogOnViewModel {Title = "Log On"});
|
||||
}
|
||||
|
||||
[HttpPost, FollowReturnUrl]
|
||||
[HttpPost]
|
||||
[SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
|
||||
Justification = "Needs to take same parameter type as Controller.Redirect()")]
|
||||
public ActionResult LogOn(string userName, string password, bool rememberMe) {
|
||||
@ -63,14 +63,13 @@ namespace Orchard.Users.Controllers {
|
||||
|
||||
_authenticationService.SignIn(user, rememberMe);
|
||||
|
||||
return Redirect("~/");
|
||||
return this.ReturnUrlRedirect();
|
||||
}
|
||||
|
||||
[FollowReturnUrl]
|
||||
public ActionResult LogOff() {
|
||||
_authenticationService.SignOut();
|
||||
|
||||
return Redirect("~/");
|
||||
return this.ReturnUrlRedirect();
|
||||
}
|
||||
|
||||
int MinPasswordLength {
|
||||
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
namespace Orchard.ContentManagement {
|
||||
public class ContentType {
|
||||
public string Name { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace Orchard.ContentManagement.Handlers {
|
||||
namespace Orchard.ContentManagement.Handlers {
|
||||
public class ContentItemBuilder {
|
||||
private readonly ContentItem _item;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
|
||||
namespace Orchard.ContentManagement.Handlers {
|
||||
public class TemplateFilterForRecord<TRecord> : TemplateFilterBase<ContentPart<TRecord>> where TRecord : ContentPartRecord, new() {
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public class ContentItemRecord {
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.ContentManagement.Records {
|
||||
public static class Utility {
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Transactions;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Logging;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Hosting;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.Environment {
|
||||
public static class ServiceLocator {
|
||||
|
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.Data;
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
|
31
src/Orchard/Mvc/Extensions/ControllerExtensions.cs
Normal file
31
src/Orchard/Mvc/Extensions/ControllerExtensions.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Orchard.Mvc.Extensions {
|
||||
public static class ControllerExtensions {
|
||||
public static RedirectResult ReturnUrlRedirect(this Controller controller) {
|
||||
var request = controller.HttpContext.Request;
|
||||
Uri returnUrl = null;
|
||||
try {
|
||||
returnUrl = new Uri(request.QueryString["ReturnUrl"]);
|
||||
}
|
||||
catch {
|
||||
try {
|
||||
returnUrl =
|
||||
new Uri(string.Format("{0}://{1}{2}{3}", request.Url.Scheme, request.Url.Host,
|
||||
request.Url.Port != 80 ? ":" + request.Url.Port : "",
|
||||
request.QueryString["ReturnUrl"]));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
if (returnUrl != null &&
|
||||
returnUrl.Scheme == request.Url.Scheme &&
|
||||
returnUrl.Port == request.Url.Port &&
|
||||
returnUrl.Host == request.Url.Host) {
|
||||
return new RedirectResult(returnUrl.ToString());
|
||||
}
|
||||
return new RedirectResult("~/");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Orchard.Mvc.FollowReturnUrl {
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class FollowReturnUrlAttribute : FilterAttribute {
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Mvc.Filters;
|
||||
|
||||
namespace Orchard.Mvc.FollowReturnUrl {
|
||||
public class FollowReturnUrlFilter : FilterProvider, IActionFilter {
|
||||
public void OnActionExecuting(ActionExecutingContext filterContext) {
|
||||
}
|
||||
|
||||
public void OnActionExecuted(ActionExecutedContext filterContext) {
|
||||
var attributes =
|
||||
(FollowReturnUrlAttribute[])
|
||||
filterContext.ActionDescriptor.GetCustomAttributes(typeof (FollowReturnUrlAttribute), false);
|
||||
|
||||
if (attributes.Length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var request = filterContext.HttpContext.Request;
|
||||
Uri returnUrl = null;
|
||||
try {
|
||||
returnUrl = new Uri(request.QueryString["ReturnUrl"]);
|
||||
}
|
||||
catch {
|
||||
try {
|
||||
returnUrl =
|
||||
new Uri(string.Format("{0}://{1}{2}{3}", request.Url.Scheme, request.Url.Host,
|
||||
request.Url.Port != 80 ? ":" + request.Url.Port : "",
|
||||
request.QueryString["ReturnUrl"]));
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
|
||||
if (returnUrl != null &&
|
||||
returnUrl.Scheme == request.Url.Scheme &&
|
||||
returnUrl.Port == request.Url.Port &&
|
||||
returnUrl.Host == request.Url.Host) {
|
||||
filterContext.Result = new RedirectResult(returnUrl.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -187,10 +187,8 @@ namespace Orchard.Mvc.Html {
|
||||
|
||||
public static string Link(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes)
|
||||
{
|
||||
TagBuilder tagBuilder = new TagBuilder("a")
|
||||
{
|
||||
InnerHtml = linkContents
|
||||
};
|
||||
TagBuilder tagBuilder = new TagBuilder("a")
|
||||
{ InnerHtml = htmlHelper.Encode(linkContents) };
|
||||
tagBuilder.MergeAttributes(htmlAttributes);
|
||||
tagBuilder.MergeAttribute("href", href);
|
||||
return tagBuilder.ToString(TagRenderMode.Normal);
|
||||
@ -340,4 +338,4 @@ namespace Orchard.Mvc.Html {
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.Mvc.Routes {
|
||||
namespace Orchard.Mvc.Routes {
|
||||
public static class RouteExtensions {
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.UI.Zones;
|
||||
|
||||
namespace Orchard.Mvc.ViewEngines {
|
||||
public class LayoutView : IView {
|
||||
|
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace Orchard.Mvc.ViewEngines {
|
||||
public class LayoutViewContext {
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Themes;
|
||||
|
||||
namespace Orchard.Mvc.ViewEngines {
|
||||
|
@ -63,8 +63,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\sharpziplib\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="Microsoft.VisualStudio.TeamSystem.Data.UnitTesting, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\fluentnhibernate\NHibernate.dll</HintPath>
|
||||
@ -93,14 +91,6 @@
|
||||
<Reference Include="System.Web.Routing">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Yaml, Version=1.0.3370.39839, Culture=neutral, PublicKeyToken=187a3d240e44a135, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\yaml\Yaml.dll</HintPath>
|
||||
@ -187,10 +177,9 @@
|
||||
<Compile Include="Extensions\Records\ExtensionRecord.cs" />
|
||||
<Compile Include="Extensions\ShellTopology.cs" />
|
||||
<Compile Include="Mvc\AntiForgery\ValidateAntiForgeryTokenOrchardAttribute.cs" />
|
||||
<Compile Include="Mvc\FollowReturnUrl\FollowReturnUrlFilter.cs" />
|
||||
<Compile Include="Mvc\Extensions\ControllerExtensions.cs" />
|
||||
<Compile Include="Mvc\Html\FileRegistrationContextExtensions.cs" />
|
||||
<Compile Include="Mvc\Extensions\UrlHelperExtensions.cs" />
|
||||
<Compile Include="Mvc\FollowReturnUrl\FollowReturnUrlAttribute.cs" />
|
||||
<Compile Include="Mvc\ViewModels\AdaptedViewModel.cs" />
|
||||
<Compile Include="Mvc\ViewUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Security.Permissions {
|
||||
public class Permission {
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Filters;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Security {
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Orchard.Services {
|
||||
public interface IClock : IDependency {
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.UI.Notify {
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
@ -42,9 +42,6 @@
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user