bjyauthorize

zfcuser add user role after registration

杀马特。学长 韩版系。学妹 提交于 2019-12-03 08:21:26
I'm using Zend Framework 2 with ZfcUser, BjyAuthorize and Doctrine for the database. Registration etc. works very well so far. My problem is, that registered users have no role assigned, so i want to add the role "user" to the user during registration. I think i could attach this to the "register" event, but i don't know how to do that. I hope someone can help me ... (i used this tutorial for setting up zfcuser etc. http://samminds.com/2013/03/zfcuser-bjyauthorize-and-doctrine-working-together/ ) public function onBootstrap(MvcEvent $e) { $zfcServiceEvents = $e->getApplication()-

How to redirect to the login page with BjyAuthorize

佐手、 提交于 2019-12-01 22:50:00
问题 I want to redirect some pages to the login page instead of page 403. By default BjyAuthorize redirects everything to a 403 page. Is it possible to configure this behavior? I found this: RedirectionStrategy. How do I use this? 回答1: Finally I got it. With version 1.2.* of BjyAuthorize, you simply add in config/autoload/bjyauthorize.global.php : return array( 'bjyauthorize' => array( 'unauthorized_strategy' => 'BjyAuthorize\View\RedirectionStrategy', // [...] ), ); And it will redirect you to

How to redirect to the login page with BjyAuthorize

落花浮王杯 提交于 2019-12-01 20:32:40
I want to redirect some pages to the login page instead of page 403. By default BjyAuthorize redirects everything to a 403 page. Is it possible to configure this behavior? I found this: RedirectionStrategy . How do I use this? Finally I got it. With version 1.2.* of BjyAuthorize, you simply add in config/autoload/bjyauthorize.global.php : return array( 'bjyauthorize' => array( 'unauthorized_strategy' => 'BjyAuthorize\View\RedirectionStrategy', // [...] ), ); And it will redirect you to the route configured in vendor/bjyoungblood/bjy-authorize/src/BjyAuthorize/View/RedirectionStrategy.php Check

Zend Framework 2 - BjyAuthorize always denies access

心不动则不痛 提交于 2019-11-30 13:02:32
I have setup the bjyoungblood/bjy-authorize module, but I am currently getting a 403 "access denied" error for each URL except for the one configured in the home route. My module.byjauthorize.global.php looks like following: 'bjyauthorize' => array( 'guards' => array( 'BjyAuthorize\Guard\Controller' => array( array('controller' => 'index', 'action' => 'index', 'roles' => array('guest','user')), array('controller' => 'index', 'action' => 'stuff', 'roles' => array('user')), array('controller' => 'zfcuser', 'roles' => array()), //backend array('controller' => 'Application\Controller\Index',