mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Take care of global suspensions as well
This commit is contained in:
parent
e8607eaf56
commit
874b5009a2
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user