public function beforeAction($action)
 {
     if (defined('STDIN')) {
         return true;
     }
     return parent::beforeAction($action);
 }
Esempio n. 2
0
 public function behaviors()
 {
     return ['access' => ['class' => AccessControl::className()], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]];
 }
Esempio n. 3
0
<?php

$params = array_merge(require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php');
return ['basePath' => dirname(__DIR__), 'controllerNamespace' => 'backend\\controllers', 'bootstrap' => ['log', 'admin'], 'modules' => ['filemanager' => ['class' => 'pendalf89\\filemanager\\Module', 'routes' => ['baseUrl' => '', 'basePath' => '@backend/web', 'uploadPath' => 'uploads'], 'thumbs' => ['small' => ['name' => '小图', 'size' => [100, 100]], 'medium' => ['name' => '中图', 'size' => [300, 200]], 'large' => ['name' => '大图', 'size' => [500, 400]]]], 'admin' => ['class' => 'mdm\\admin\\Module', 'mainLayout' => '@app/views/layouts/main.php', 'controllerMap' => ['assignment' => ['class' => 'mdm\\admin\\controllers\\AssignmentController', 'userClassName' => \dektrium\user\models\User::className(), 'idField' => 'id', 'usernameField' => 'username', 'extraColumns' => [['attribute' => 'email', 'label' => '联系邮箱', 'value' => function ($model, $key, $index, $column) {
    return $model->email;
}]]]], 'menus' => ['assignment' => ['label' => '用户权限']]], 'user' => ['as backend' => ['class' => \dektrium\user\filters\BackendFilter::className(), 'controllers' => ['profile', 'recovery', 'registration']]], 'rbac' => ['class' => 'dektrium\\rbac\\Module'], 'settings' => ['class' => 'pheme\\settings\\Module', 'sourceLanguage' => 'en'], 'audit' => ['class' => 'bedezign\\yii2\\audit\\Audit', 'layout' => '@backend/views/layouts/main', 'db' => 'db', 'trackActions' => ['*'], 'ignoreActions' => ['audit/*', 'debug/*', 'site/qrcode'], 'maxAge' => '9999', 'accessRoles' => ['超级管理员']], 'database' => ['class' => \backend\modules\database\Module::className()], 'populac' => ['class' => 'common\\populac\\Populac']], 'components' => ['user' => ['identityCookie' => ['name' => '_backendIdentity', 'path' => '/admin', 'httpOnly' => true]], 'session' => ['name' => 'BACKENDSESSID', 'cookieParams' => ['httpOnly' => true, 'path' => '/admin']], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'errorHandler' => ['errorAction' => 'site/error', 'class' => '\\bedezign\\yii2\\audit\\components\\web\\ErrorHandler'], 'view' => ['theme' => ['pathMap' => ['@mdm/admin/views' => '@backend/views/admin']]], 'request' => ['parsers' => ['application/json' => 'yii\\web\\JsonParser']]], 'params' => $params, 'as access' => ['class' => \mdm\admin\components\AccessControl::className(), 'allowActions' => ['site/qrcode', 'debug/*', 'gii/*']]];