abstimm-idD/php-public/index.php
Sven Seeberg 5c64f76c81
Add API endpoint to export result
* Export PGP signed result file with option to sync.
* Return sha256 sum of file and key ID.
2020-10-29 17:14:08 +01:00

22 lines
513 B
PHP

<?php
require_once("../functions.php");
$cfg = init();
header('Content-Type: application/json');
if($_SERVER["REQUEST_URI"] == '/get_ids') {
$data = get_voting_ids($cfg);
echo json_encode($data);
} else if($_SERVER["REQUEST_URI"] == '/register_event') {
$data = register_event($cfg);
echo json_encode($data);
} else if($_SERVER["REQUEST_URI"] == '/export_result') {
$data = export_result($cfg);
echo json_encode($data);
}
else {
echo json_encode(array("error" => "no route"));
}
?>