diff --git a/file/lib/data/user/UserAction.class.php b/file/lib/data/user/UserAction.class.php index 9d9b87c..7f65653 100644 --- a/file/lib/data/user/UserAction.class.php +++ b/file/lib/data/user/UserAction.class.php @@ -12,12 +12,21 @@ * @subpackage data.user */ class UserAction extends \wcf\data\AbstractDatabaseObjectAction { + /** + * @see \wcf\data\AbstractDatabaseObjectAction::$className + */ protected $className = 'wcf\data\user\UserEditor'; + /** + * Validates invite preparation. + */ public function validatePrepareInvite() { // Todo: Proper validation } + /** + * Prepares invites. + */ public function prepareInvite() { $followingList = new \wcf\data\user\follow\UserFollowingList(); $followingList->getConditionBuilder()->add('user_follow.userID = ?', array(WCF::getUser()->userID)); @@ -33,12 +42,11 @@ public function prepareInvite() { ); } + /** + * Validates invites. + */ public function validateInvite() { - $this->recipients = (isset($_POST['recipients'])) ? $_POST['recipients'] : null; - - if (!$this->recipients) { - throw new \wcf\system\exception\UserInputException("recipients"); - } + if (!isset($this->parameters['recipients'])) throw new \wcf\system\exception\UserInputException("recipients"); if (WCF::getUser()->chatRoomID) { $this->room = \chat\data\room\RoomCache::getInstance()->getRoom(WCF::getUser()->chatRoomID); @@ -48,7 +56,10 @@ public function validateInvite() { } } + /** + * Invites users. + */ public function invite() { - \wcf\system\user\notification\UserNotificationHandler::getInstance()->fireEvent('invited', 'be.bastelstu.chat.room', new \chat\system\user\notification\object\RoomUserNotificationObject($this->room), $this->recipients, [ 'userID' => WCF::getUser()->userID ]); + \wcf\system\user\notification\UserNotificationHandler::getInstance()->fireEvent('invited', 'be.bastelstu.chat.room', new \chat\system\user\notification\object\RoomUserNotificationObject($this->room), $this->parameters['recipients'], array('userID' => WCF::getUser()->userID)); } } diff --git a/language/de.xml b/language/de.xml index af66711..b79d5af 100644 --- a/language/de.xml +++ b/language/de.xml @@ -162,7 +162,7 @@ Probieren Sie, den Chat neu zu laden