protected function beforeAction($action)
 {
     parent::beforeAction($action);
     $roles = ['1'];
     $role = \Yii::app()->user->role;
     if (array_intersect($role, $roles)) {
         return true;
     } else {
         throw new CHttpException(403, 'Ошибка прав доступа.');
     }
 }
 /**
  * Отображает Расход по указанному идентификатору
  *
  * @param integer $id Идинтификатор Расход для отображения
  *
  * @return void
  */
 protected function beforeAction($action)
 {
     parent::beforeAction($action);
     if ($action->id == 'create') {
         $roles = ['1', '2', '3', '4', '5'];
         $role = \Yii::app()->user->role;
         if (array_intersect($role, $roles)) {
             return true;
         } else {
             $this->redirect('/');
         }
     } else {
         $this->redirect('/');
     }
 }
Ejemplo n.º 3
0
 /**
  *
  */
 public function init()
 {
     $this->productRepository = Yii::app()->getComponent('productRepository');
     $this->attributeFilter = Yii::app()->getComponent('attributesFilter');
     parent::init();
 }
Ejemplo n.º 4
0
 public function init()
 {
     $this->productRepository = Yii::app()->getComponent('productRepository');
     parent::init();
 }
Ejemplo n.º 5
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->generator = Yii::app()->getComponent('sitemapGenerator');
 }
Ejemplo n.º 6
0
 public function init()
 {
     Yii::import('application.modules.zendsearch.vendors.*');
     require_once 'Zend/Search/Lucene.php';
     parent::init();
 }
Ejemplo n.º 7
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->feedback = Yii::app()->getComponent('feedback');
 }
Ejemplo n.º 8
0
 /**
  *
  */
 public function init()
 {
     $this->productRepository = new ProductRepository();
     parent::init();
 }
Ejemplo n.º 9
0
 protected function beforeAction($action)
 {
     $id = Yii::app()->getRequest()->getQuery('service');
     $this->service = Yii::app()->getComponent('eauth')->getIdentity($id);
     return parent::beforeAction($action);
 }
Ejemplo n.º 10
0
 /**
  *
  */
 public function init()
 {
     $this->cart = Yii::app()->cart;
     $this->couponManager = Yii::app()->cart->couponManager;
     parent::init();
 }
Ejemplo n.º 11
0
 /**
  * Инициализируем контроллер:
  *
  * @return void
  **/
 public function init()
 {
     parent::init();
     $this->layout = 'withsidebar';
 }