Esempio n. 1
0
 public function behaviors()
 {
     $actions = ['signup', 'login', 'remote-proceed', 'confirm-password', 'restore-password', 'reset-password'];
     return array_merge(parent::behaviors(), ['access' => ['class' => AccessControl::class, 'only' => array_merge($actions, ['lockscreen']), 'denyCallback' => function () {
         return $this->redirect([$this->user->getIsGuest() ? 'login' : 'lockscreen']);
     }, 'rules' => [['actions' => $actions, 'roles' => ['?'], 'allow' => true], ['actions' => ['lockscreen'], 'roles' => ['@'], 'allow' => true]]]]);
 }
Esempio n. 2
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['loginRequired' => ['class' => AccessControl::class, 'only' => ['profile'], 'rules' => [['allow' => true, 'roles' => ['@']]]]]);
 }