How to disable build-in orchard controller action

六眼飞鱼酱① 提交于 2019-12-13 02:23:01

问题


I would like to know, is there a way to disable a controller action from the Orchard framework?

I have created a custom registration controller and I would like to override the built-in /Users/Account/Register action. I don't know how to solve this issue; there are route registrations within the framework, maybe I could override the routes somehow?


回答1:


There are two routes.

1) Implement your own controller and supress the original Accounts Controller (substituting the namespace listed below with the correct one. This is what our project does (we have a separate authentication system

[OrchardSuppressDependency("Orchard.Tags.Controllers.HomeController")]
public class HomeController : Controller {
    //my controller implementation
}

2) Implement IRouteProvider in your module with your own definition for that route (to some other completely separate controller/action). You can see that outlined in the "Adding a Route" section of this article http://docs.orchardproject.net/Documentation/Building-a-hello-world-module

Option 2 is probably better if you don't intend to replace the entire of authentication



来源:https://stackoverflow.com/questions/16946204/how-to-disable-build-in-orchard-controller-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!