diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index a1ea018..76b09a7 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -109,10 +109,7 @@ class TorrentController extends AbstractController [ 'session' => [ - 'user' => $user - ], - 'user' => - [ + 'user' => $user, 'id' => $user->getId(), 'moderator' => $user->isModerator() ], diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a11291a..574a1e4 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -210,11 +210,13 @@ class UserController extends AbstractController [ 'session' => [ - 'user' => $user + 'user' => $user, + 'owner' => $user->getId() === $userTarget->getId(), + 'moderator' => $user->isModerator() ], 'user' => [ 'id' => $userTarget->getId(), - 'address' => $userTarget->getId() === $user->getId() ? $userTarget->getAddress() : false, + 'address' => $userTarget->getAddress(), 'moderator' => $userTarget->isModerator(), 'approved' => $userTarget->isApproved(), 'status' => $userTarget->isStatus(), diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index bd09bf9..364ac67 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -73,7 +73,7 @@ - {% if user.moderator %} + {% if session.moderator %} - {% if user.address %} + {% if session.owner or session.moderator %}
diff --git a/templates/default/user/info.html.twig b/templates/default/user/info.html.twig index 4ed5e35..8391fb9 100644 --- a/templates/default/user/info.html.twig +++ b/templates/default/user/info.html.twig @@ -33,7 +33,7 @@
{{ 'Common'|trans }}
{{ 'Address' | trans }} @@ -68,7 +68,7 @@ {% if user.status %} {{ 'Active' | trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -77,7 +77,7 @@ {% endif %} {% else %} {{ 'Disabled' | trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -94,7 +94,7 @@ {% if user.approved %} {{ 'Yes'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -103,7 +103,7 @@ {% endif %} {% else %} {{ 'No'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -118,9 +118,9 @@ {{ 'Moderator' | trans }} - {% if user.moderator %} + {% if session.moderator %} {{ 'Yes'| trans }} - {% if user.moderator %} + {% if session.moderator %} @@ -129,7 +129,7 @@ {% endif %} {% else %} {{ 'No'| trans }} - {% if user.moderator %} + {% if session.moderator %}