![]() |
(03-25-2022, 04:15 AM)kenjis Wrote: Auto routing is very dangerous, because it is very difficult to know all routes for human beings. That sounds like a problem with the tutorials rather than an inherent problem with CodeIgniter. I don't like defining tons of routes, and much prefer to use autorouting, and frequently make use of the _remap function because it's quite useful when one is tweaking urls for SEO. If you have a controller and all of its methods should require some level of authentication, you can make a special AdminController whose init or constructor checks to make sure the user is authorized. If you have one or two methods in a controller that require authentication, it's quite easy to define an authentication-checking fn in your own base controller and expressly call it in any method that needs it. I'd very much like to know more about how autorouting introduces security problems. Can anyone give more detail rather than simply linking a tutorial that has a security hole? (03-25-2022, 04:44 PM)kenjis Wrote: @ChicagoPhil Okay, Good question. This seems like a problem with using filters to enforce authentication rather than an autorouting problem. Just enforce the authentication in the controller or the method. |
Welcome Guest, Not a member yet? Register Sign In |