diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index 1b48d02..7934def 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -49,11 +49,17 @@ public function canEnter() { $suspensions = ChatSuspension::getSuspensionsForUser(); $canEnter = $ph->getPermission($this, 'user.canEnter'); - if (isset($suspensions[$this->roomID][ChatSuspension::TYPE_BAN])) { + if ($canEnter && isset($suspensions[$this->roomID][ChatSuspension::TYPE_BAN])) { if ($suspensions[$this->roomID][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) { $canEnter = false; } } + if ($canEnter && isset($suspensions[null][ChatSuspension::TYPE_BAN])) { + if ($suspensions[null][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) { + $canEnter = false; + } + } + return $canEnter || $ph->getPermission($this, 'mod.canAlwaysEnter'); } @@ -67,11 +73,16 @@ public function canWrite() { $suspensions = ChatSuspension::getSuspensionsForUser(); $canWrite = $ph->getPermission($this, 'user.canWrite'); - if (isset($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE])) { + if ($canWrite && isset($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE])) { if ($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) { $canWrite = false; } } + if ($canWrite && isset($suspensions[null][ChatSuspension::TYPE_MUTE])) { + if ($suspensions[null][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) { + $canWrite = false; + } + } return $canWrite || $ph->getPermission($this, 'mod.canAlwaysWrite'); }