diff --git a/backend/controllers/AccountsController.php b/backend/controllers/AccountsController.php index 4511f1e..880faf8 100755 --- a/backend/controllers/AccountsController.php +++ b/backend/controllers/AccountsController.php @@ -8,28 +8,45 @@ use common\models\DicCities; use Yii; use common\models\Accounts; use common\models\AccountsSearch; + use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; - +use yii\filters\AccessControl; /** * AccountsController implements the CRUD actions for Accounts model. */ class AccountsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Accounts models. * @return mixed diff --git a/backend/controllers/AccountsVinController.php b/backend/controllers/AccountsVinController.php index 04e7689..dc285eb 100755 --- a/backend/controllers/AccountsVinController.php +++ b/backend/controllers/AccountsVinController.php @@ -8,19 +8,37 @@ use common\models\AccountsVinSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * AccountsVinController implements the CRUD actions for AccountsVin model. */ class AccountsVinController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/ArtHistoryController.php b/backend/controllers/ArtHistoryController.php index ce4437a..acbb21e 100755 --- a/backend/controllers/ArtHistoryController.php +++ b/backend/controllers/ArtHistoryController.php @@ -8,6 +8,7 @@ use common\models\ArtHistorySearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * ArtHistoryController implements the CRUD actions for ArtHistory model. @@ -15,13 +16,30 @@ use yii\filters\VerbFilter; class ArtHistoryController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/BrandsController.php b/backend/controllers/BrandsController.php index cffb86f..163117e 100755 --- a/backend/controllers/BrandsController.php +++ b/backend/controllers/BrandsController.php @@ -8,6 +8,7 @@ use common\models\BrandsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * BrandsController implements the CRUD actions for Brands model. @@ -16,13 +17,30 @@ class BrandsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/BrandsReplaceController.php b/backend/controllers/BrandsReplaceController.php index a11a25f..bdc8bc9 100755 --- a/backend/controllers/BrandsReplaceController.php +++ b/backend/controllers/BrandsReplaceController.php @@ -8,6 +8,7 @@ use common\models\BrandsReplaceSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * BrandsReplaceController implements the CRUD actions for BrandsReplace model. @@ -16,13 +17,30 @@ class BrandsReplaceController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/CartController.php b/backend/controllers/CartController.php index 332883a..2dc00c9 100755 --- a/backend/controllers/CartController.php +++ b/backend/controllers/CartController.php @@ -8,6 +8,7 @@ use common\models\CartBillsSearch; use backend\components\base\BaseController; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * CartController implements the CRUD actions for CartBills model. @@ -15,7 +16,34 @@ use yii\filters\VerbFilter; class CartController extends BaseController { public $layout = "/column"; - + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'logout' => ['post'], + ], + ], + ]; + } /** * Lists all CartBills models. * @return mixed diff --git a/backend/controllers/CatController.php b/backend/controllers/CatController.php index 4bb57af..5d15f30 100755 --- a/backend/controllers/CatController.php +++ b/backend/controllers/CatController.php @@ -8,24 +8,41 @@ use common\models\CatSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * CatController implements the CRUD actions for Cat model. */ class CatController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Cat models. * @return mixed diff --git a/backend/controllers/CrossingUploadController.php b/backend/controllers/CrossingUploadController.php index cb323c6..8274e33 100755 --- a/backend/controllers/CrossingUploadController.php +++ b/backend/controllers/CrossingUploadController.php @@ -10,6 +10,7 @@ namespace backend\controllers; use backend\components\base\BaseController; use common\components\CustomVarDamp; +use yii\filters\VerbFilter; use yii\filters\AccessControl; use backend\models\UploadFileCrossingForm; use backend\models\DetailsCrosses; @@ -20,31 +21,35 @@ class CrossingUploadController extends BaseController { public $layout = "/column"; - /** - * @inheritdoc - */ - public function behaviors() + + /** + * @inheritdoc + */ + public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'rules' => [ [ - 'actions' => ['index', 'result'], + 'actions' => ['login', 'error', 'download-photo','delete-image','result' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], 'allow' => true, 'roles' => ['@'], ], ], ], -// 'verbs' => [ -// 'class' => VerbFilter::className(), -// 'actions' => [ -// 'logout' => ['post'], -// ], -// ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'logout' => ['post'], + ], + ], ]; } - /** * @inheritdoc */ diff --git a/backend/controllers/CurrencyController.php b/backend/controllers/CurrencyController.php index ca623d9..9c5fcdb 100755 --- a/backend/controllers/CurrencyController.php +++ b/backend/controllers/CurrencyController.php @@ -8,6 +8,7 @@ use common\models\CurrencySearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * CurrencyController implements the CRUD actions for Currency model. @@ -15,18 +16,34 @@ use yii\filters\VerbFilter; class CurrencyController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Currency models. * @return mixed diff --git a/backend/controllers/DeliveriesController.php b/backend/controllers/DeliveriesController.php index 8823d83..405f8c1 100755 --- a/backend/controllers/DeliveriesController.php +++ b/backend/controllers/DeliveriesController.php @@ -8,6 +8,7 @@ use common\models\DeliveriesSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * DeliveriesController implements the CRUD actions for Deliveries model. @@ -16,13 +17,30 @@ class DeliveriesController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/DetailsController.php b/backend/controllers/DetailsController.php index 719c644..200b796 100755 --- a/backend/controllers/DetailsController.php +++ b/backend/controllers/DetailsController.php @@ -8,6 +8,7 @@ use common\models\DetailsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * DetailsController implements the CRUD actions for Details model. @@ -16,13 +17,30 @@ class DetailsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/DetailsCrossesController.php b/backend/controllers/DetailsCrossesController.php index b967177..19c54ab 100755 --- a/backend/controllers/DetailsCrossesController.php +++ b/backend/controllers/DetailsCrossesController.php @@ -8,6 +8,7 @@ use common\models\DetailsCrossesSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * DetailsCrossesController implements the CRUD actions for DetailsCrosses model. @@ -15,13 +16,30 @@ use yii\filters\VerbFilter; class DetailsCrossesController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/DetailsDescriptionController.php b/backend/controllers/DetailsDescriptionController.php index 2a271f1..3f015d0 100644 --- a/backend/controllers/DetailsDescriptionController.php +++ b/backend/controllers/DetailsDescriptionController.php @@ -11,6 +11,7 @@ use yii\data\ActiveDataProvider; use yii\web\HttpException; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * DetailsDescriptionController implements the CRUD actions for DetailsDescription model. @@ -19,13 +20,30 @@ class DetailsDescriptionController extends BaseController { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/DicStatusesController.php b/backend/controllers/DicStatusesController.php index 2d993bc..50db4c9 100755 --- a/backend/controllers/DicStatusesController.php +++ b/backend/controllers/DicStatusesController.php @@ -8,6 +8,7 @@ use common\models\DicStatusesSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * DicStatusesController implements the CRUD actions for DicStatuses model. @@ -15,13 +16,30 @@ use yii\filters\VerbFilter; class DicStatusesController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/EmailsController.php b/backend/controllers/EmailsController.php index 96782e3..175a58c 100755 --- a/backend/controllers/EmailsController.php +++ b/backend/controllers/EmailsController.php @@ -8,19 +8,37 @@ use common\models\EmailsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * EmailsController implements the CRUD actions for Emails model. */ class EmailsController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/ImportersController.php b/backend/controllers/ImportersController.php index 8e5f758..1431223 100755 --- a/backend/controllers/ImportersController.php +++ b/backend/controllers/ImportersController.php @@ -8,6 +8,7 @@ use backend\models\ImportersSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * ImportersController implements the CRUD actions for Importers model. @@ -15,13 +16,30 @@ use yii\filters\VerbFilter; class ImportersController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/ImportersPrefixController.php b/backend/controllers/ImportersPrefixController.php index b3ecbf1..17219fb 100755 --- a/backend/controllers/ImportersPrefixController.php +++ b/backend/controllers/ImportersPrefixController.php @@ -8,6 +8,7 @@ use backend\models\ImportersPrefixSearch; use backend\components\base\BaseController; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * ImportersPrefixController implements the CRUD actions for ImportersPrefix model. @@ -15,14 +16,30 @@ use yii\filters\VerbFilter; class ImportersPrefixController extends BaseController { public $layout = "/column"; - + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/ManufacturersController.php b/backend/controllers/ManufacturersController.php index 01ac19c..5af00af 100755 --- a/backend/controllers/ManufacturersController.php +++ b/backend/controllers/ManufacturersController.php @@ -8,6 +8,7 @@ use common\models\ManufacturersSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * ManufacturersController implements the CRUD actions for Manufacturers model. @@ -16,18 +17,34 @@ class ManufacturersController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Manufacturers models. * @return mixed diff --git a/backend/controllers/MarginsController.php b/backend/controllers/MarginsController.php index e81f411..936f04f 100755 --- a/backend/controllers/MarginsController.php +++ b/backend/controllers/MarginsController.php @@ -8,6 +8,7 @@ use common\models\MarginsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * MarginsController implements the CRUD actions for Margins model. @@ -16,13 +17,30 @@ class MarginsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/MarginsGroupsController.php b/backend/controllers/MarginsGroupsController.php index 7adcc32..160e4fe 100755 --- a/backend/controllers/MarginsGroupsController.php +++ b/backend/controllers/MarginsGroupsController.php @@ -10,6 +10,7 @@ use common\models\MarginsGroupsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * MarginsGroupsController implements the CRUD actions for MarginsGroups model. @@ -18,13 +19,30 @@ class MarginsGroupsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/MarginsImportersController.php b/backend/controllers/MarginsImportersController.php index 56e1a57..cf46a0f 100755 --- a/backend/controllers/MarginsImportersController.php +++ b/backend/controllers/MarginsImportersController.php @@ -8,6 +8,7 @@ use common\models\MarginsImportersSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; use backend\models\Importers; use common\models\Margins; @@ -19,18 +20,34 @@ class MarginsImportersController extends Controller public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all MarginsImporters models. * @return mixed diff --git a/backend/controllers/MarginsImportersImportController.php b/backend/controllers/MarginsImportersImportController.php index 698b2ec..998d3fa 100755 --- a/backend/controllers/MarginsImportersImportController.php +++ b/backend/controllers/MarginsImportersImportController.php @@ -10,6 +10,7 @@ use common\models\MarginsImportersImportSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * MarginsImportersImportController implements the CRUD actions for MarginsImportersImport model. @@ -19,13 +20,30 @@ class MarginsImportersImportController extends Controller public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/NewsController.php b/backend/controllers/NewsController.php index 22dc66d..662eaae 100755 --- a/backend/controllers/NewsController.php +++ b/backend/controllers/NewsController.php @@ -10,6 +10,7 @@ use common\models\NewsSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; use yii\web\UploadedFile; use backend\components\ImgResizer; @@ -20,13 +21,30 @@ class NewsController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/OfficesController.php b/backend/controllers/OfficesController.php index 2cd19be..0ceffeb 100755 --- a/backend/controllers/OfficesController.php +++ b/backend/controllers/OfficesController.php @@ -9,24 +9,41 @@ use common\models\OfficesSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * OfficesController implements the CRUD actions for Offices model. */ class OfficesController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Offices models. * @return mixed diff --git a/backend/controllers/PageController.php b/backend/controllers/PageController.php index 19c43af..c8005b4 100755 --- a/backend/controllers/PageController.php +++ b/backend/controllers/PageController.php @@ -8,19 +8,37 @@ use common\models\PageSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * PageController implements the CRUD actions for Page model. */ class PageController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/ParserController.php b/backend/controllers/ParserController.php index 0a1ebbb..041098f 100755 --- a/backend/controllers/ParserController.php +++ b/backend/controllers/ParserController.php @@ -38,17 +38,22 @@ class ParserController extends BaseController 'class' => AccessControl::className(), 'rules' => [ [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], 'allow' => true, 'roles' => ['@'], ], ], ], -// 'verbs' => [ -// 'class' => VerbFilter::className(), -// 'actions' => [ -// 'logout' => ['post'], -// ], -// ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'logout' => ['post'], + ], + ], ]; } diff --git a/backend/controllers/PartnersController.php b/backend/controllers/PartnersController.php index 0f9704d..dcd5be6 100755 --- a/backend/controllers/PartnersController.php +++ b/backend/controllers/PartnersController.php @@ -8,24 +8,41 @@ use common\models\PartnersSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * PartnersController implements the CRUD actions for Partners model. */ class PartnersController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Partners models. * @return mixed diff --git a/backend/controllers/PayMessagesController.php b/backend/controllers/PayMessagesController.php index 4c7ea44..3bad34d 100755 --- a/backend/controllers/PayMessagesController.php +++ b/backend/controllers/PayMessagesController.php @@ -8,19 +8,37 @@ use common\models\PayMessagesSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * PayMessagesController implements the CRUD actions for PayMessages model. */ class PayMessagesController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/PriceMailingController.php b/backend/controllers/PriceMailingController.php index d6cce4e..1edf5d2 100755 --- a/backend/controllers/PriceMailingController.php +++ b/backend/controllers/PriceMailingController.php @@ -8,19 +8,36 @@ use common\models\PriceMailingSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; - +use yii\filters\AccessControl; /** * PriceMailingController implements the CRUD actions for PriceMailing model. */ class PriceMailingController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/RgGrupController.php b/backend/controllers/RgGrupController.php index eb09621..16ae8f7 100755 --- a/backend/controllers/RgGrupController.php +++ b/backend/controllers/RgGrupController.php @@ -14,6 +14,7 @@ use common\components\CustomVarDamp; use common\components\parsers\MailAttachmentsSaver; use common\models\Margins; use common\models\MarginsGroups; +use yii\filters\VerbFilter; use yii\filters\AccessControl; use Yii; use yii\web\UploadedFile; @@ -35,17 +36,22 @@ class RgGrupController extends BaseController 'class' => AccessControl::className(), 'rules' => [ [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], 'allow' => true, 'roles' => ['@'], ], ], ], -// 'verbs' => [ -// 'class' => VerbFilter::className(), -// 'actions' => [ -// 'logout' => ['post'], -// ], -// ], + 'verbs' => [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'logout' => ['post'], + ], + ], ]; } diff --git a/backend/controllers/SettingsMerchantsListController.php b/backend/controllers/SettingsMerchantsListController.php index 5d340e9..9349d28 100755 --- a/backend/controllers/SettingsMerchantsListController.php +++ b/backend/controllers/SettingsMerchantsListController.php @@ -8,19 +8,37 @@ use common\models\SettingsMerchantsListSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * SettingsMerchantsListController implements the CRUD actions for SettingsMerchantsList model. */ class SettingsMerchantsListController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/SiteController.php b/backend/controllers/SiteController.php index 5fc05d2..20adb51 100755 --- a/backend/controllers/SiteController.php +++ b/backend/controllers/SiteController.php @@ -65,6 +65,7 @@ class SiteController extends BaseController public function actionLogin() { + $this->layout = '/none'; if (!\Yii::$app->user->isGuest) { return $this->goHome(); } diff --git a/backend/controllers/SliderController.php b/backend/controllers/SliderController.php index 0b196ab..0ef07f4 100755 --- a/backend/controllers/SliderController.php +++ b/backend/controllers/SliderController.php @@ -8,24 +8,41 @@ use common\models\SliderSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * SliderController implements the CRUD actions for Slider model. */ class SliderController extends Controller { + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; } - /** * Lists all Slider models. * @return mixed diff --git a/backend/controllers/TeamController.php b/backend/controllers/TeamController.php index 5fdfb69..f0b2657 100755 --- a/backend/controllers/TeamController.php +++ b/backend/controllers/TeamController.php @@ -8,6 +8,7 @@ use common\models\TeamSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * TeamController implements the CRUD actions for Team model. @@ -15,13 +16,30 @@ use yii\filters\VerbFilter; class TeamController extends Controller { public $layout = '/column'; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/TeamGroupController.php b/backend/controllers/TeamGroupController.php index 1c25984..f1b26b0 100755 --- a/backend/controllers/TeamGroupController.php +++ b/backend/controllers/TeamGroupController.php @@ -8,6 +8,7 @@ use common\models\TeamGroupSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use yii\filters\AccessControl; /** * TeamGroupController implements the CRUD actions for TeamGroup model. @@ -16,13 +17,30 @@ class TeamGroupController extends Controller { public $layout = '/column'; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/controllers/UserController.php b/backend/controllers/UserController.php index 8229bc8..e7c26d0 100755 --- a/backend/controllers/UserController.php +++ b/backend/controllers/UserController.php @@ -5,6 +5,7 @@ namespace backend\controllers; use Yii; use backend\models\User; use backend\models\UserSearch; +use yii\filters\AccessControl; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; @@ -16,13 +17,30 @@ class UserController extends Controller { public $layout = "/column"; + /** + * @inheritdoc + */ public function behaviors() { return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'allow' => true, + ], + [ + 'actions' => ['logout', 'index'], + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ - 'delete' => ['post'], + 'logout' => ['post'], ], ], ]; diff --git a/backend/views/layouts/column.php b/backend/views/layouts/column.php index bf69e6e..bb6f654 100755 --- a/backend/views/layouts/column.php +++ b/backend/views/layouts/column.php @@ -320,7 +320,7 @@ $this->beginContent('@app/views/layouts/main.php'); ['label' => 'Бренды', 'url' => ['brands/index']], ['label' => 'Марки авто', 'url' => ['manufacturers/index']], ['label' => 'Статусы заказов', 'url' => ['currency/index']], - ['label' => 'Типы доставок', 'url' => ['currency/index']], + ['label' => 'Типы доставок', 'url' => ['deliveries/index']], ['label' => 'Категории товаров', 'url' => ['currency/index']], ['label' => 'Vin коды', 'url' => ['currency/index']], ['label' => 'Запросы по номеру', 'url' => ['currency/index']], diff --git a/backend/views/layouts/none.php b/backend/views/layouts/none.php new file mode 100644 index 0000000..aae13c7 --- /dev/null +++ b/backend/views/layouts/none.php @@ -0,0 +1,9 @@ +beginContent('@app/views/layouts/main.php'); +?> + + + +endContent() ?> \ No newline at end of file diff --git a/common/models/Accounts.php b/common/models/Accounts.php index b998f90..f49ad77 100755 --- a/common/models/Accounts.php +++ b/common/models/Accounts.php @@ -48,6 +48,10 @@ use Yii; class Accounts extends \yii\db\ActiveRecord { + public $re_pass; + public $surname; + public $verifyCode; + /** * @inheritdoc */ @@ -71,16 +75,19 @@ class Accounts extends \yii\db\ActiveRecord { return [ [['if_manager', 'margin_id', 'country', 'city', 'rating', 'is_active', 'is_firm', 'office_id', 'is_scribe', 'set_manager_id', 'car', 'mod', 'deliveries', 'scode'], 'integer'], - [['email', 'pass', 'name', 'phones', 'comment', 'dt', 'set_manager_id'], 'required'], + [['company','email', 'pass', 'name','surname', 'phones', 'comment', 'dt', 'set_manager_id'], 'required'], [['comment'], 'string'], [['balance'], 'number'], - [['email', 'name', 'firm_site'], 'string', 'max' => 150], - [['pass'], 'string', 'max' => 30], + [['email', 'name','surname', 'firm_site'], 'string', 'max' => 150], + [['pass','re_pass'], 'string', 'max' => 30], [['phones', 'phones2', 'phones3'], 'string', 'max' => 50], [['address', 'firm_inn', 'firm_bank'], 'string', 'max' => 254], [['last_loginin'], 'string', 'max' => 15], [['snumb', 'firm_ur_adr', 'firm_fiz_adr', 'firm_code_eg', 'firm_rs', 'firm_mfo', 'company'], 'string', 'max' => 255], - [['email'], 'unique'] + [['email'], 'unique'], + [['email'], 'email'], + ['re_pass', 'compare', 'compareAttribute' => 'pass'], + ['verifyCode', 'captcha'], ]; } diff --git a/common/models/MarginsGroupsSearch.php b/common/models/MarginsGroupsSearch.php index 10b54bc..5102315 100755 --- a/common/models/MarginsGroupsSearch.php +++ b/common/models/MarginsGroupsSearch.php @@ -21,7 +21,6 @@ class MarginsGroupsSearch extends MarginsGroups return [ [['id',], 'integer'], [['group', 'timestamp', 'importer_id', 'margin_id'], 'safe'], - [['koef'], 'number'], ]; } @@ -64,12 +63,11 @@ class MarginsGroupsSearch extends MarginsGroups $query->andFilterWhere([ 'id' => $this->id, 'timestamp' => $this->timestamp, + Margins::tableName().'.name' => $this->margin_id, ]); $query->andFilterWhere(['like', 'group', $this->group]); $query->andFilterWhere(['like', Importers::tableName().'.name', $this->importer_id]); - $query->andFilterWhere(['like', Margins::tableName().'.name', $this->margin_id]); - $query->andFilterWhere(['like', MarginsGroups::tableName().'.koef', $this->koef]); return $dataProvider; } diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index f29b9e8..dd15053 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -13,6 +13,12 @@ use common\widgets\Alert; use \yii\widgets\Menu; use \yii\helpers\Url; use common\models\Callback; +use \common\models\Accounts; +use \yii\helpers\ArrayHelper; +use \common\models\DicCities; +use \common\models\Deliveries; +use yii\captcha\Captcha; + ?> beginPage() ?> @@ -380,133 +386,230 @@ use common\models\Callback;