1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-04 23:40:08 +00:00

Fix typos

This commit is contained in:
Tim Düsterhus 2013-06-22 18:28:50 +02:00
parent e6e4cb5225
commit 9848b5820b
5 changed files with 78 additions and 76 deletions

View File

@ -13,8 +13,7 @@
<h1>{lang}chat.acp.suspension.list{/lang}</h1> <h1>{lang}chat.acp.suspension.list{/lang}</h1>
</header> </header>
{if $objects|count} <form method="post" action="{link controller='ChatSuspensionList' application='chat'}{/link}">
<form method="post" action="{link controller='ChatSuspensionList' application='chat'}{/link}">
<div class="container containerPadding marginTop"> <div class="container containerPadding marginTop">
<fieldset> <fieldset>
<legend>{lang}wcf.global.filter{/lang}</legend> <legend>{lang}wcf.global.filter{/lang}</legend>
@ -69,8 +68,9 @@
<div class="formSubmit"> <div class="formSubmit">
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" /> <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
</div> </div>
</form> </form>
{if $objects|count}
{capture assign=additionalParameters}{* {capture assign=additionalParameters}{*
*}{if $userID}&userID={$userID}{/if}{* *}{if $userID}&userID={$userID}{/if}{*
*}{if $issuerUserID}&issuerUserID={$issuerUserID}{/if}{* *}{if $issuerUserID}&issuerUserID={$issuerUserID}{/if}{*

View File

@ -48,24 +48,24 @@ public function canEnter(\wcf\data\user\User $user = null) {
if ($ph->getPermission($this, 'mod.canAlwaysEnter')) return true; if ($ph->getPermission($this, 'mod.canAlwaysEnter')) return true;
if ($ph->getPermission($this, 'mod.canBan')) return true; if ($ph->getPermission($this, 'mod.canBan')) return true;
$canEnter = $ph->getPermission($this, 'user.canEnter'); if (!$ph->getPermission($this, 'user.canEnter')) return false;
$suspensions = Suspension::getSuspensionsForUser($user->getDecoratedObject()); $suspensions = Suspension::getSuspensionsForUser($user->getDecoratedObject());
// room suspension // room suspension
if ($canEnter && isset($suspensions[$this->roomID][Suspension::TYPE_BAN])) { if (isset($suspensions[$this->roomID][Suspension::TYPE_BAN])) {
if ($suspensions[$this->roomID][Suspension::TYPE_BAN]->isValid()) { if ($suspensions[$this->roomID][Suspension::TYPE_BAN]->isValid()) {
$canEnter = false; return false;
} }
} }
// global suspension // global suspension
if ($canEnter && isset($suspensions[null][Suspension::TYPE_BAN])) { if (isset($suspensions[null][Suspension::TYPE_BAN])) {
if ($suspensions[null][Suspension::TYPE_BAN]->isValid()) { if ($suspensions[null][Suspension::TYPE_BAN]->isValid()) {
$canEnter = false; return false;
} }
} }
return $canEnter; return true;
} }
/** /**
@ -86,24 +86,24 @@ public function canWrite(\wcf\data\user\User $user = null) {
if ($ph->getPermission($this, 'mod.canAlwaysWrite')) return true; if ($ph->getPermission($this, 'mod.canAlwaysWrite')) return true;
if ($ph->getPermission($this, 'mod.canMute')) return true; if ($ph->getPermission($this, 'mod.canMute')) return true;
$canEnter = $ph->getPermission($this, 'user.canWrite'); if (!$ph->getPermission($this, 'user.canWrite')) return false;
$suspensions = Suspension::getSuspensionsForUser($user->getDecoratedObject()); $suspensions = Suspension::getSuspensionsForUser($user->getDecoratedObject());
// room suspension // room suspension
if ($canEnter && isset($suspensions[$this->roomID][Suspension::TYPE_MUTE])) { if (isset($suspensions[$this->roomID][Suspension::TYPE_MUTE])) {
if ($suspensions[$this->roomID][Suspension::TYPE_MUTE]->isValid()) { if ($suspensions[$this->roomID][Suspension::TYPE_MUTE]->isValid()) {
$canWrite = false; return false;
} }
} }
// global suspension // global suspension
if ($canEnter && isset($suspensions[null][Suspension::TYPE_MUTE])) { if (isset($suspensions[null][Suspension::TYPE_MUTE])) {
if ($suspensions[null][Suspension::TYPE_MUTE]->isValid()) { if ($suspensions[null][Suspension::TYPE_MUTE]->isValid()) {
$canWrite = false; return false;
} }
} }
return $canWrite; return true;
} }
/** /**

View File

@ -44,10 +44,12 @@ public function isVisible($user = null) {
if ($user === null) $user = WCF::getUser(); if ($user === null) $user = WCF::getUser();
$user = new \wcf\data\user\UserProfile($user); $user = new \wcf\data\user\UserProfile($user);
$ph = new \chat\system\permission\PermissionHandler($user->getDecoratedObject()); $ph = new \chat\system\permission\PermissionHandler($user->getDecoratedObject());
if ($user->getPermission('admin.chat.canManageSuspensions')) return true; if ($user->getPermission('admin.chat.canManageSuspensions')) return true;
if ($user->getPermission('mod.chat.canG'.$this->type)) return true; if ($user->getPermission('mod.chat.canG'.$this->type)) return true;
if (!$this->room) return false; if (!$this->roomID) return false;
if ($ph->getPermission($this->getRoom(), 'mod.can'.ucfirst($this->type))) return true; if ($ph->getPermission($this->getRoom(), 'mod.can'.ucfirst($this->type))) return true;
return false; return false;
} }

View File

@ -89,15 +89,15 @@ public function executeAction() {
public function checkPermission() { public function checkPermission() {
parent::checkPermission(); parent::checkPermission();
$this->room = $this->commandHandler->getRoom();
if (WCF::getSession()->getPermission('admin.chat.canManageSuspensions')) return; if (WCF::getSession()->getPermission('admin.chat.canManageSuspensions')) return;
$this->room = $this->commandHandler->getRoom();
$ph = new \chat\system\permission\PermissionHandler(); $ph = new \chat\system\permission\PermissionHandler();
if (static::IS_GLOBAL) { if (static::IS_GLOBAL) {
WCF::getSession()->checkPermission('mod.chat.canG'.static::SUSPENSION_TYPE); WCF::getSession()->checkPermissions((array) 'mod.chat.canG'.static::SUSPENSION_TYPE);
} }
else { else {
if (!WCF::getSession()->checkPermission('mod.chat.canG'.static::SUSPENSION_TYPE)) { if (!WCF::getSession()->getPermission('mod.chat.canG'.static::SUSPENSION_TYPE)) {
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst(static::SUSPENSION_TYPE))) { if (!$ph->getPermission($this->room, 'mod.can'.ucfirst(static::SUSPENSION_TYPE))) {
throw new \wcf\system\exception\PermissionDeniedException(); throw new \wcf\system\exception\PermissionDeniedException();
} }

View File

@ -58,15 +58,15 @@ public function executeAction() {
public function checkPermission() { public function checkPermission() {
parent::checkPermission(); parent::checkPermission();
$this->room = $this->commandHandler->getRoom();
if (WCF::getSession()->getPermission('admin.chat.canManageSuspensions')) return; if (WCF::getSession()->getPermission('admin.chat.canManageSuspensions')) return;
$this->room = $this->commandHandler->getRoom();
$ph = new \chat\system\permission\PermissionHandler(); $ph = new \chat\system\permission\PermissionHandler();
if (static::IS_GLOBAL) { if (static::IS_GLOBAL) {
WCF::getSession()->checkPermission('mod.chat.canG'.static::SUSPENSION_TYPE); WCF::getSession()->checkPermission((array) 'mod.chat.canG'.static::SUSPENSION_TYPE);
} }
else { else {
if (!WCF::getSession()->checkPermission('mod.chat.canG'.static::SUSPENSION_TYPE)) { if (!WCF::getSession()->getPermission('mod.chat.canG'.static::SUSPENSION_TYPE)) {
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst(static::SUSPENSION_TYPE))) { if (!$ph->getPermission($this->room, 'mod.can'.ucfirst(static::SUSPENSION_TYPE))) {
throw new \wcf\system\exception\PermissionDeniedException(); throw new \wcf\system\exception\PermissionDeniedException();
} }