使用Zfcuser&的Zend Framework2 Bjy授权路由 [英] Zend Framework2 using Zfcuser & Bjyauthorize routing

查看:94
本文介绍了使用Zfcuser&的Zend Framework2 Bjy授权路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是zend初学者框架程序员.我确实使用ZfcUser进行身份验证,并使用Bjyauthorize进行授权.我必须输入用户类型:普通用户和管理员.所以我要做的是在身份验证后将用户路由到页面A,将管理员路由到页面B. 在Zfcuser配置文件中,没有这种可能性,我们只有这一行

I'm a beginer zend framework programmer. I did use ZfcUser for authentification and Bjyauthorize for authorization. I have to type of users : normal users and administrator . So what i want to do is to route the user to page A and admin to page B after authentification . In the Zfcuser configuation file there not this possibility we have just this line

 'logout_redirect_route' => 'zfcuser/login',

如何为我的不同用户指定不同的路由?

how can do specify a diffrent route for my differents users?

推荐答案

对我来说,您的问题与ZfcUser或BjyAuthorize无关:只需让用户和管理员进入您的控制器即可,您可以根据用户角色.

To me your problem has nothing to do with ZfcUser or BjyAuthorize: Just let the user and the admin go inside your controller and there you can dispatch them depending on the user role.

return $this->forward()->dispatch('MyModule\Controller\Index', array('action'=>'PageB'));

这篇关于使用Zfcuser&的Zend Framework2 Bjy授权路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆