diff options
Diffstat (limited to 'http/api-inc.php')
-rw-r--r-- | http/api-inc.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index 1364195..7780e64 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -250,18 +250,18 @@ class ApiPklV2 extends ApiPklV1 { class ApiPklV3 extends ApiPklV2 { function check_parameters() { - if (!isset($this->parameters['manual']) || !isset($this->parameters['manual']['min_points']) || !isset($this->parameters['manual']['tournament_weight'])) { - $this->ensure_parameters(array('tournament_rank')); - if ($this->parameters['tournament_rank'] == ApiPkl::RANK_BNET) { - $this->ensure_parameters(array('boards')); - } - if (isset($this->parameters['boards'])) { - $this->check_values($this->parameters, array( - 'boards' => function($r) { return ctype_digit($r); } - )); - $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); + if (isset($this->parameters['tournament_rank']) && $this->parameters['tournament_rank'] == ApiPkl::RANK_BNET) { + $this->ensure_parameters(array('boards', 'type')); + if ($this->parameters['type'] == 4) { + throw new ParametersException('Parameter: type has incorrect value (' . $this->parameters['type'] . ') for BridgeNET tournament'); } } + if (isset($this->parameters['boards'])) { + $this->check_values($this->parameters, array( + 'boards' => function($r) { return ctype_digit($r); } + )); + $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); + } return parent::check_parameters(); } |