0
我有基於acl的CakePHP應用程序,用戶屬於組。用戶組重定向到儀表板
請諮詢我,我應該通過用戶組實現重定向代碼:
- 用戶屬於管理員組重定向到
admin/dashboard
- 用戶屬於管理員組重定向到
manager/dashboard
- 用戶屬於用戶組重定向到
user/dashboard
我有基於acl的CakePHP應用程序,用戶屬於組。用戶組重定向到儀表板
請諮詢我,我應該通過用戶組實現重定向代碼:
admin/dashboard
manager/dashboard
user/dashboard
set $this->Auth->autoRedirect = false;
in beforeRedirect()in users contr奧勒
在login()函數:
if ($this->Auth->user()){ $this->redirect(array('prefix'=>$this->Auth->user('group'),'controller'=>'dashboard','action'=>'index')); }
此代碼是爲了顯示它是如何做的,而不是被當作-就是例子。