mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Add UnbanCommand
This commit is contained in:
parent
7fff5eaafe
commit
6bb29146c6
30
file/lib/system/command/commands/UnbanCommand.class.php
Normal file
30
file/lib/system/command/commands/UnbanCommand.class.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace chat\system\command\commands;
|
||||
use \chat\data\suspension;
|
||||
use \chat\util\ChatUtil;
|
||||
use \wcf\data\user\User;
|
||||
use \wcf\system\WCF;
|
||||
|
||||
/**
|
||||
* Bans a user.
|
||||
*
|
||||
* @author Tim Düsterhus
|
||||
* @copyright 2010-2013 Tim Düsterhus
|
||||
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class UnbanCommand extends UnmuteCommand {
|
||||
/**
|
||||
* @see \chat\system\command\commands\UnmuteCommand::executeAction()
|
||||
*/
|
||||
public function executeAction() {
|
||||
if ($suspension = suspension\Suspension::getSuspensionByUserRoomAndType($this->user, $this->room, suspension\Suspension::TYPE_BAN)) {
|
||||
$action = new suspension\SuspensionAction(array($suspension), 'delete');
|
||||
$action->executeAction();
|
||||
}
|
||||
else {
|
||||
throw new \wcf\system\exception\UserInputException('text', WCF::getLanguage()->get('wcf.chat.suspension.notExists'));
|
||||
}
|
||||
}
|
||||
}
|
@ -117,6 +117,7 @@
|
||||
<item name="chat.message.5.gmute"><![CDATA[hat {@$link} bis {@$expires|plainTime} global geknebelt.]]></item>
|
||||
<item name="chat.message.5.gban"><![CDATA[hat {@$link} bis {@$expires|plainTime} global gebannt.]]></item>
|
||||
<item name="chat.message.5.unmute"><![CDATA[hat {@$link} entknebelt.]]></item>
|
||||
<item name="chat.message.5.unban"><![CDATA[hat {@$link} entbannt.]]></item>
|
||||
|
||||
<item name="chat.message.color.success"><![CDATA[Die Farbe wurde erfolgreich geändert.]]></item>
|
||||
</category>
|
||||
|
Loading…
Reference in New Issue
Block a user