mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-03-03 16:44:01 +01:00
43 lines
903 B
PHP
43 lines
903 B
PHP
<?php
|
|
|
|
namespace app\controllers;
|
|
|
|
use Yii;
|
|
use yii\filters\AccessControl;
|
|
use yii\web\Controller;
|
|
use yii\web\View;
|
|
|
|
class PanelController extends Controller
|
|
{
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
'access' => [
|
|
'class' => AccessControl::className(),
|
|
'rules' => [
|
|
[
|
|
'allow' => true,
|
|
'roles' => ['@'],
|
|
],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
|
|
public function actionIndex()
|
|
{
|
|
$this->view->registerJs('
|
|
var wsURL = "' . Yii::$app->params['wsURL']
|
|
. '/?type=user&id=' . Yii::$app->user->identity->id
|
|
. '&auth_token=' . Yii::$app->user->identity->getAuthToken()
|
|
. '";
|
|
', View::POS_HEAD);
|
|
|
|
return $this->render('index');
|
|
}
|
|
|
|
}
|