Yii Framework Forum: 独立module下,如何绑定到自定义webuser授权下 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

独立module下,如何绑定到自定义webuser授权下 Rate Topic: -----

#1 User is offline   syncake 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-January 12

Posted 29 August 2012 - 01:55 PM

强哥,咨询一下,

我有一个admin module, module下面自定义了adminUser(extends CWebUser),

因为Yii::app()->user是给前台用户使用,所以adminModule->addComponent('user', new adminUser),

如何将admin module 下的accessRule中未获得授权的访问跳转到/admin/default/login,而不是yii默认已经建立的/site/login?

谢谢!
0

#2 User is offline   hiscaler 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 230
  • Joined: 17-October 09

Posted 05 October 2012 - 12:33 PM

In AdminModule.php file
Yii::app()->setComponents(array(
        'errorHandler' => array(
        'class' => 'CErrorHandler',
        'errorAction' => '/admin/default/error',
        ),
        'user' => array(
        'class' => 'CWebUser',
        'allowAutoLogin' => true,
        'loginUrl' => Yii::app()->createUrl('/admin/default/login'),
        )), false);

0

#3 User is offline   syncake 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-January 12

Posted 18 December 2012 - 01:06 AM

View Posthiscaler, on 05 October 2012 - 12:33 PM, said:

In AdminModule.php file
Yii::app()->setComponents(array(
        'errorHandler' => array(
        'class' => 'CErrorHandler',
        'errorAction' => '/admin/default/error',
        ),
        'user' => array(
        'class' => 'CWebUser',
        'allowAutoLogin' => true,
        'loginUrl' => Yii::app()->createUrl('/admin/default/login'),
        )), false);



TKS!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users