Commit 1f2fdc617833bcaddcbee5df99909eaa46290dea
1 parent
7ba2947a
-Product carousel fix
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
controllers/OrderController.php
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | use artweb\artbox\components\SmsSender; | 5 | use artweb\artbox\components\SmsSender; |
| 6 | use artweb\artbox\ecommerce\models\OrderSearch; | 6 | use artweb\artbox\ecommerce\models\OrderSearch; |
| 7 | + use common\models\User; | ||
| 7 | use phpDocumentor\Reflection\Types\Null_; | 8 | use phpDocumentor\Reflection\Types\Null_; |
| 8 | use Yii; | 9 | use Yii; |
| 9 | use yii\helpers\ArrayHelper; | 10 | use yii\helpers\ArrayHelper; |
| @@ -289,9 +290,13 @@ | @@ -289,9 +290,13 @@ | ||
| 289 | } | 290 | } |
| 290 | 291 | ||
| 291 | $model = $this->findModel($id); | 292 | $model = $this->findModel($id); |
| 292 | - | 293 | + |
| 294 | + /** | ||
| 295 | + * @var User $user | ||
| 296 | + */ | ||
| 297 | + $user = \Yii::$app->user->identity; | ||
| 293 | if ($model->isBlocked() && $model->edit_id !== \Yii::$app->user->id) { | 298 | if ($model->isBlocked() && $model->edit_id !== \Yii::$app->user->id) { |
| 294 | - if (!\Yii::$app->user->identity->isAdmin()) { | 299 | + if (!$user->isAdmin()) { |
| 295 | throw new ForbiddenHttpException(); | 300 | throw new ForbiddenHttpException(); |
| 296 | } | 301 | } |
| 297 | } | 302 | } |