Hello.
Since redirect() and Security->blackHole() do send headers to the
browser it doesn't give any help to people who use autentication for
requests made by requestAction(). In my case I just want to do nothing
instead of running the requested controller. Thats why redirects, and
exits don't come in handy this time (exit aborts the code, way before
rendering, so I get a blank page). Calling setAction() from the
controller also doesn't give much help, since it calls the given
action, but doesn't abort the execution.
If there would be a way to change the requested action in beforeFilter
it would do the job.
I'm thinking of doing something like this: (the one solution i've
figured out)
function _invoke (&$controller, $params, $missingAction = false) {
$action = $params['action'];
$this->start($controller);
if( $action != $controller->action ){
$action = $controller->action;
}
//...
$output = call_user_func_array(array(&$controller, $action ),
empty($params['pass'])? null: $params['pass']);
in the dispatcher.php file. It would substain the current behaviour,
and it'd add an option for changing the action in beforeFilter
runtime. Also, if the new action would be defined in AppController
(eg. AppController::returnNothing() ), then it would be avalible for
all requests.
Please, correct me if i'm wrong somewhere or if there's an option that
doesn't require any modifications in Cake's libs ( which i don't even
think of doing on my own ).
I'm quite desperate with this one, cause it stopped me for a while,
and after few hours of searching i haven't found any solution.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---