2013-05-30 17:16:43 +00:00
|
|
|
<?php
|
|
|
|
namespace chat\system\command\commands;
|
|
|
|
use \chat\data\suspension;
|
|
|
|
use \chat\util\ChatUtil;
|
|
|
|
use \wcf\data\user\User;
|
|
|
|
use \wcf\system\WCF;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unbans a user globally.
|
|
|
|
*
|
|
|
|
* @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 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)) {
|
2013-06-22 12:40:54 +00:00
|
|
|
$action = new suspension\SuspensionAction(array($suspension), 'revoke', array(
|
|
|
|
'revoker' => WCF::getUser()->userID
|
|
|
|
));
|
2013-05-30 17:16:43 +00:00
|
|
|
$action->executeAction();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new \wcf\system\exception\UserInputException('text', WCF::getLanguage()->get('wcf.chat.suspension.notExists'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|