mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 14:54:57 +08:00
Handlers to redirect creating and editing users to the correct controller (#8549)
This commit is contained in:
parent
a5f657540a
commit
c0fa82fcf9
@ -2,6 +2,7 @@
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Users.Models;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Orchard.Users.Handlers {
|
||||
public class UserPartHandler : ContentHandler {
|
||||
@ -16,6 +17,19 @@ namespace Orchard.Users.Handlers {
|
||||
if (part != null) {
|
||||
context.Metadata.Identity.Add("User.UserName", part.UserName);
|
||||
context.Metadata.DisplayText = part.UserName;
|
||||
|
||||
// Configure routing metadata to make back-office experience more robust
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Users"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Create"}
|
||||
};
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Users"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Edit"},
|
||||
{"id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user