|
|||
|
Hello.
I have the following problem. I'm trying to create plugin, that enforces certain ip access policy (you can call it banlist if you want) to the site. IP check takes place in routeStartup() function, when I already have recieved the request from client with $_SERVER['REMOTE_ADDR'] set. Then my plugin checks that remote ip address against some list and so on ..., and then if it matches some of those I want to immediately stop processing the request and exit. So my current solution if something like this PHP Code:
|
|
|||
|
Well, after some experiments, i found out that simply moving IPcheck into plugins postDispatch() function does the trick, simply check for match, and if its true then use
$request->setControllerName() and $request->setActionName() functions. For example I`m using something like this $request->setControllerName('error'); $request->setActionName('banned'); And this doesn't break MVC flow with some ugly die or similar. Yes, i know maybe it seems obvious to do like that, but it didn`t seemed for me back then. Of course now it does . |
|
||||
|
if you implemented acl's it's easier to write an assert ip policy in combination with a plugin
__________________
Zym Framework - A Zend Framework extension library w/ demo app SpotSec Blog: http://spotsec.com/blog |
![]() |
| Thread Tools | |
| Display Modes | |
|
|