* @package be.bastelstu.chat * @subpackage system.chat.command.commands */ class GbanCommand extends MuteCommand { 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)) { if ($suspension->time > TIME_NOW + $this->time) { throw new \wcf\system\exception\UserInputException('text', WCF::getLanguage()->get('wcf.chat.suspension.exists')); } $editor = new suspension\SuspensionEditor($suspension); $editor->delete(); } $this->suspensionAction = new suspension\SuspensionAction(array(), 'create', array( 'data' => array( 'userID' => $this->user->userID, 'roomID' => null, 'type' => suspension\Suspension::TYPE_BAN, 'time' => TIME_NOW + $this->time ) )); $this->suspensionAction->executeAction(); } }