From 74afa106e08633c6ecdbcf6932f969107de2ad43 Mon Sep 17 00:00:00 2001 From: sualko Date: Wed, 2 Sep 2020 10:05:36 +0200 Subject: [PATCH] refactor: use identical comparision --- lib/Controller/JoinController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/JoinController.php b/lib/Controller/JoinController.php index 196da6e..97f0034 100644 --- a/lib/Controller/JoinController.php +++ b/lib/Controller/JoinController.php @@ -87,14 +87,14 @@ class JoinController extends Controller { $displayname = $user->getDisplayName(); $userId = $user->getUID(); - if ($room->access == Room::ACCESS_INTERNAL_RESTRICTED && !$this->permission->isUser($room, $userId)) { + if ($room->access === Room::ACCESS_INTERNAL_RESTRICTED && !$this->permission->isUser($room, $userId)) { throw new NoPermissionException(); } if ($this->permission->isAdmin($room, $userId)) { $presentation = new Presentation($u, $filename); } - } elseif ($room->access === Room::ACCESS_INTERNAL || $room->access == Room::ACCESS_INTERNAL_RESTRICTED) { + } elseif ($room->access === Room::ACCESS_INTERNAL || $room->access === Room::ACCESS_INTERNAL_RESTRICTED) { return new RedirectResponse($this->getLoginUrl()); } elseif (empty($displayname) || strlen($displayname) < 3 || ($room->access === Room::ACCESS_PASSWORD && $password !== $room->password)) { $response = new TemplateResponse($this->appName, 'join', [