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 requesting a controller name that the
ACL is returning as a DENY. And then you're _forward'ing to
another controller that is _also_ being returned by ACL as a DENY.
Does your ACL rule allow the 'login' resource to any anonymous
user? Could you provide a quick extract of your ACL rules?
Yeah I know what you mean about distraction!
The ACL is not really setup for much at the moment and hasn't
really changed much from your example (except perhaps that my
"resource" became the module rather than the
controller ...experimenting with that still):
class Example_Acl extends Zend_Acl
{
public function __construct()
{
//parent::__construct();
$this->add(new Zend_Acl_Resource('default'));
$this->add(new Zend_Acl_Resource('gallery'));
$this->add(new Zend_Acl_Resource('articles'));
$this->add(new Zend_Acl_Resource('directory'));
$this->add(new Zend_Acl_Resource('shop'));
$this->add(new Zend_Acl_Resource('forum'));
$this->add(new Zend_Acl_Resource('support'));
$this->add(new Zend_Acl_Resource('admin'));
$this->addRole(new Zend_Acl_Role('guest'));
$this->addRole(new Zend_Acl_Role('member'), 'guest');
$this->addRole(new Zend_Acl_Role('admin'), 'member');
// Guest may only view content
$this->allow('guest', 'default');
$this->allow('guest', 'gallery');
$this->allow('guest', 'directory');
$this->allow('guest', 'articles');
$this->allow('guest', 'shop');
$this->allow('guest', 'forum');
$this->deny('member', 'forum', 'update'); // Remove
specific privilege
$this->allow('member', 'support');
$this->allow('admin'); // unrestricted access
}
}
Thanks,
Nick
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 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'm not entirely clear on your use of "Controller" there. Do you
mean embedded in Zend_Controller_Front or a
Zend_Controller_Action? To clarify (mostly for myself) I have the
auth logic in a subclass of Zend_Controller_Plugin_Abstract which
is registered as a plugin with Zend_Controller_Front, which is
what I think you mean with (b) below?
Nick
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3
9654 4124
http://www.peptolab.com
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com