diff options
author | Michal Zimniewicz <michzimny@gmail.com> | 2018-01-27 01:45:34 +0100 |
---|---|---|
committer | Michal Zimniewicz <michzimny@gmail.com> | 2018-01-27 01:45:34 +0100 |
commit | 1f64f78b4c58beb9b919f80527e3c4bd640a292c (patch) | |
tree | e12f7873d752a95a5449e5580a24a89e5b241e2d /tdd-protocol.php | |
parent | 76cc542b4e1ae7e30ef935d4d8d6686db65faa97 (diff) |
add initial version
Diffstat (limited to 'tdd-protocol.php')
-rw-r--r-- | tdd-protocol.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tdd-protocol.php b/tdd-protocol.php new file mode 100644 index 0000000..7f6eb7b --- /dev/null +++ b/tdd-protocol.php @@ -0,0 +1,24 @@ +<?php + +$prefix = $_GET['prefix']; +$round = (int)$_GET['round']; +$board = (int)$_GET['board']; + +require_once('tdd-bootstrap.php'); + +$protocol = new Protocol($prefix, $round, $board); + +// security check +$html_filename = $protocol->get_filename(); +$len = strlen($html_filename); +$request_uri_ending = substr($_SERVER['REQUEST_URI'], -$len-1); +if($request_uri_ending != '/' . $html_filename) { + die('This script cannot be called directly!'); +} +// + +$deals_by_tables = load_deals_for_tables($prefix, $round, $board); +foreach($deals_by_tables as $table => $deal) { + $protocol->set_deal($table, $deal); +} +echo $protocol->output(); |