diff --git a/file/lib/system/command/commands/GunbanCommand.class.php b/file/lib/system/command/commands/GunbanCommand.class.php new file mode 100644 index 0000000..b33d6d4 --- /dev/null +++ b/file/lib/system/command/commands/GunbanCommand.class.php @@ -0,0 +1,32 @@ + + * @package be.bastelstu.chat + * @subpackage system.chat.command.commands + */ +class GunbanCommand extends UnmuteCommand { + /** + * @see \chat\system\command\commands\UnmuteCommand::executeAction() + */ + public function executeAction() { + $room = new \chat\data\room\Room(null, array('roomID' => null)); + + if ($suspension = suspension\Suspension::getSuspensionByUserRoomAndType($this->user, $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')); + } + } +} diff --git a/file/lib/system/command/commands/GunmuteCommand.class.php b/file/lib/system/command/commands/GunmuteCommand.class.php new file mode 100644 index 0000000..e700b80 --- /dev/null +++ b/file/lib/system/command/commands/GunmuteCommand.class.php @@ -0,0 +1,32 @@ + + * @package be.bastelstu.chat + * @subpackage system.chat.command.commands + */ +class GunbanCommand extends UnmuteCommand { + /** + * @see \chat\system\command\commands\UnmuteCommand::executeAction() + */ + public function executeAction() { + $room = new \chat\data\room\Room(null, array('roomID' => null)); + + if ($suspension = suspension\Suspension::getSuspensionByUserRoomAndType($this->user, $room, suspension\Suspension::TYPE_MUTE)) { + $action = new suspension\SuspensionAction(array($suspension), 'delete'); + $action->executeAction(); + } + else { + throw new \wcf\system\exception\UserInputException('text', WCF::getLanguage()->get('wcf.chat.suspension.notExists')); + } + } +} diff --git a/language/de.xml b/language/de.xml index d49252d..9c20313 100644 --- a/language/de.xml +++ b/language/de.xml @@ -123,6 +123,8 @@ + +