Zend_auth multiple instances
As ZF creates single instance of zend_auth.
But i 开发者_开发技巧need separate for admin and front panel of my site
So i have made a copy on zend/Auth.php and saved as zend/Autuadmin.php in library and created sessin as zend_Authadmin and its now working fine at all places.
Is it correct way to do? or can it crate problem in future ?
Using Zend_Auth with Zend_Acl should you to create two roles with different access for each role. I control acl's using an ini file but it is quite easy to configure either way.
Zend_Acl
very quick example...
$acl->addRole(new Zend_Acl_Role('admin'), 'staff');
$acl->addResource(new Zend_Acl_Resource('news'));
$acl->allow('admin', array('news', 'latest'));
Then to check you can use $acl->isAllowed()
精彩评论