Commit fba123c8db5a0f54e09dabe792e965e13f70ca73

Authored by Yarik
1 parent c20d5820

test

backend/config/main.php
@@ -13,7 +13,14 @@ return [ @@ -13,7 +13,14 @@ return [
13 'id' => 'app-backend', 13 'id' => 'app-backend',
14 'basePath' => dirname(__DIR__), 14 'basePath' => dirname(__DIR__),
15 'controllerNamespace' => 'backend\controllers', 15 'controllerNamespace' => 'backend\controllers',
16 - 'bootstrap' => ['log'], 16 + 'bootstrap' => [
  17 + 'log',
  18 + function() {
  19 + if(!\Yii::$app->user->can('viewAdmin')) {
  20 + return \Yii::$app->response->redirect('/');
  21 + }
  22 + }
  23 + ],
17 'modules' => [ 24 'modules' => [
18 'permit' => [ 25 'permit' => [
19 'class' => 'developeruz\db_rbac\Yii2DbRbac', 26 'class' => 'developeruz\db_rbac\Yii2DbRbac',
frontend/models/SearchPerformerForm.php
@@ -242,18 +242,18 @@ @@ -242,18 +242,18 @@
242 'or', 242 'or',
243 [ 243 [
244 'like', 244 'like',
245 - 'user.firstname',  
246 - $this->search, 245 + 'LOWER("user"."firstname")',
  246 + mb_strtolower($this->search),
247 ], 247 ],
248 [ 248 [
249 'like', 249 'like',
250 - 'user.lastname',  
251 - $this->search, 250 + 'LOWER("user"."lastname")',
  251 + mb_strtolower($this->search),
252 ], 252 ],
253 [ 253 [
254 'like', 254 'like',
255 - 'company_info.name',  
256 - $this->search, 255 + 'LOWER("company_info"."name")',
  256 + mb_strtolower($this->search),
257 ], 257 ],
258 ]); 258 ]);
259 } 259 }