public function boards_invitations_create($params = null) { // aka load boards if ($params && isset($params["__partial"])) { return null; } if ($params === null) { $this->requireRequestType("POST"); $params = $_POST; $params["boardid"] = $_GET["boardid"]; } $current_user = $this->requireLogin("You must be logged in to create invitations to a board"); if (!$params["boardid"]) { throw new APIException("Board Id Missing", 400); } if (!$params["invite_list"]) { throw new APIException("Invite List Missing", 400); } if (!$current_user->isMemberOf($params["boardid"])) { throw new APIException("You can only invite people to boards that you belong to", 403); } //TODO: make part of board $board = new SCBoard($params["boardid"]); $sent_list = $board->sendInvites($params["invite_list"]); return $sent_list; }