|
- <?php
-
-
-
- namespace backend\controllers;
-
- use yii\filters\VerbFilter;
- use yii\filters\AccessControl;
-
- class OnlineAdminController extends BackendController
- {
- public function behaviors()
- {
- return [
- 'verbs' => [
- 'class' => VerbFilter::class,
- ],
- 'access' => [
- 'class' => AccessControl::class,
- 'rules' => [
- [
- 'allow' => true,
- 'roles' => ['@'],
- 'matchCallback' => function ($rule, $action) {
- return $this->getUserModule()
- ->getAuthorizationChecker()
- ->isGrantedAsAdministrator($this->getUserCurrent());
- }
- ]
- ],
- ],
- ];
- }
-
- public function actionIndex()
- {
- $usersWithStatusProducerOnlineArray = $this->getUserModule()->getRepository()->findUsersWithStatusProducerAndOnline();
- $usersWithStatusUserOnlineArray = $this->getUserModule()->getRepository()->findUsersWithStatusUserAndOnline();
-
- return $this->render('index', [
- 'usersWithStatusProducerOnlineArray' => $usersWithStatusProducerOnlineArray,
- 'usersWithStatusUserOnlineArray' => $usersWithStatusUserOnlineArray,
- ]);
- }
- }
|