0lukasz0
0lukasz0

Reputation: 3267

How to disable build-in orchard controller action

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?

Upvotes: 1

Views: 826

Answers (1)

Paul Devenney
Paul Devenney

Reputation: 1309

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

Upvotes: 1

Related Questions