refactor: use identical comparision

pull/75/head
sualko 2020-09-02 10:05:36 +02:00
parent b549a3391b
commit 74afa106e0
1 changed files with 2 additions and 2 deletions

View File

@ -87,14 +87,14 @@ class JoinController extends Controller {
$displayname = $user->getDisplayName(); $displayname = $user->getDisplayName();
$userId = $user->getUID(); $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(); throw new NoPermissionException();
} }
if ($this->permission->isAdmin($room, $userId)) { if ($this->permission->isAdmin($room, $userId)) {
$presentation = new Presentation($u, $filename); $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()); return new RedirectResponse($this->getLoginUrl());
} elseif (empty($displayname) || strlen($displayname) < 3 || ($room->access === Room::ACCESS_PASSWORD && $password !== $room->password)) { } elseif (empty($displayname) || strlen($displayname) < 3 || ($room->access === Room::ACCESS_PASSWORD && $password !== $room->password)) {
$response = new TemplateResponse($this->appName, 'join', [ $response = new TemplateResponse($this->appName, 'join', [