0

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 ?

1 Answers1

2

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()

piddl0r
  • 2,431
  • 2
  • 23
  • 35