diff --git a/file/lib/acp/form/RoomAddForm.class.php b/file/lib/acp/form/RoomAddForm.class.php index 76f3c56..f875891 100644 --- a/file/lib/acp/form/RoomAddForm.class.php +++ b/file/lib/acp/form/RoomAddForm.class.php @@ -38,6 +38,13 @@ class RoomAddForm extends \wcf\form\AbstractForm { */ public $topic = ''; + /** + * Maximum number of users + * + * @var integer + */ + public $maxUsers = 0; + /** * @see \wcf\page\AbstractPage::__construct() */ @@ -67,6 +74,7 @@ public function readFormParameters() { if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title'); if (I18nHandler::getInstance()->isPlainValue('topic')) $this->topic = I18nHandler::getInstance()->getValue('topic'); + if (isset($_POST['maxUsers']) $this->maxUsers = intval($_POST['maxUsers']); } /** @@ -90,7 +98,8 @@ public function save() { // save room $this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array_merge($this->additionalFields, array( 'title' => $this->title, - 'topic' => $this->topic + 'topic' => $this->topic, + 'maxUsers' => $this->maxUsers )))); $this->objectAction->executeAction(); $returnValues = $this->objectAction->getReturnValues(); @@ -116,7 +125,7 @@ public function save() { } \wcf\system\acl\ACLHandler::getInstance()->save($roomID, $this->objectTypeID); - \wcf\system\acl\ACLHandler::getInstance()->disableAssignVariables(); + \wcf\system\acl\ACLHandler::getInstance()->disableAssignVariables(); \chat\system\permission\PermissionHandler::clearCache(); $this->saved(); @@ -144,6 +153,7 @@ public function assignVariables() { 'action' => 'add', 'title' => $this->title, 'topic' => $this->topic, + 'maxUsers' => $this->maxUsers, 'objectTypeID' => $this->objectTypeID )); }