From e433e46b36251359c9543267521609ce45030c31 Mon Sep 17 00:00:00 2001 From: n1rwana Date: Mon, 21 Aug 2023 12:47:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=80=D0=B5=D0=B4=D0=B8=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B0=D0=B2=D0=B0=D1=82=D0=B0=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=B0=20(#967)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/Presenters/PhotosPresenter.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/PhotosPresenter.php b/Web/Presenters/PhotosPresenter.php index 345b2c60..9d64ba20 100644 --- a/Web/Presenters/PhotosPresenter.php +++ b/Web/Presenters/PhotosPresenter.php @@ -1,6 +1,6 @@ notFound(); if(is_null($this->user) || $this->user->id != $ownerId) $this->flashFail("err", "Ошибка доступа", "Недостаточно прав для модификации данного ресурса."); - + + $redirect = $photo->getAlbum()->getOwner() instanceof User ? "/id0" : "/club" . $ownerId; + $photo->isolate(); $photo->delete(); $this->flash("succ", "Фотография удалена", "Эта фотография была успешно удалена."); - $this->redirect("/id0"); + $this->redirect($redirect); } }