Hi Simon,
I've sussed out where the issue is and have commented it in the
following:
The example url; site.com/auth/ goes to default/controllers/
AuthController.php...
AuthController extends Zend_Controller_Action
{
public function indexAction()
{
$this-_forward( 'login',
What happens if you add:-
$this-add(new Zend_Acl_Resource('default'));
$this-allow(null, 'login');
Hey, no worries. I'm here and I'm finding any excuse to get
distracted at the moment :)
I had read your code too quickly - yes indeed, you're using a plugin.
It looks to me that you're
What happens if you add:-
$this-add(new Zend_Acl_Resource('default'));
$this-allow(null, 'login');
Well the default resource is already there so just adding the
latter bit results in:
Fatal error: Uncaught exception 'Zend_Acl_Exception' with message
'Resource 'login' not found' in...
Forgot to finish that by asking if you are able to get _forward()
doing its stuff succesfully, presuming of course, a similar
Controller plugin, Auth, Acl, etc setup as you originally specified
(and I pinched)? If not then I'll know it's not just me.
Thanks,
Nick
What happens if you
A further follow up:
The secret recipe seems to be to use dispatchLoopStartup() rather
than preDispatch as in:
class Menu_Controller_Plugin_Auth extends
Zend_Controller_Plugin_Abstract
{
private $_auth;
private $_acl;
private $_noauth = array('module' = 'default',
Hi Nick
So you're saying that if you set the request's action via
setActionName(), it will trigger another forward? Even if it's the
same value as it was before the plugin performed its check? Must have
been one of those subtle changes from 0.7 - 0.9 that I missed.
Thanks for spotting
Hi Nick
No mystery there - having the auth logic embedded within the
Controller means preDispatch will be called each time the controller
is called... sending it onto the same controller... with the same
preDispatch... etc...
I'd recommend either:-
a) Moving the preDispatch controller
Hi Simon,
Thanks for the super quick reply, I didn't mean to summons you to an
answer by the way, I just cc'd past you since I was using your code
and thought you might be interested.
I don't quite follow but, suspecting I may be being dense here, I'll
go ahead anyway...
No mystery
Hey, no worries. I'm here and I'm finding any excuse to get
distracted at the moment :)
I had read your code too quickly - yes indeed, you're using a plugin.
It looks to me that you're requesting a controller name that the ACL
is returning as a DENY. And then you're _forward'ing to another