Blame view

php/rest/getOrbites.php 651 Bytes
16035364   Benjamin Renard   First commit
1
<?php
16035364   Benjamin Renard   First commit
2

70880168   Nathanael Jourdane   Add rate limit on...
3
4
5
6
7
8
9
/**
 * @file getParameter.php
 * @brief  REST interface for service getParameter
 *
 *
 * @version $Id:  $
 */
16035364   Benjamin Renard   First commit
10

70880168   Nathanael Jourdane   Add rate limit on...
11
require_once '../config.php';
16035364   Benjamin Renard   First commit
12

70880168   Nathanael Jourdane   Add rate limit on...
13
14
$amda_ws = new WebServer();

a394ee09   Nathanael Jourdane   bugFix token
15
16
17
18
19
20
if (!key_exists("token", $_GET)) {
    $result = array('success' => false, 'message' => "E01: Authentication is required for this webservice.");
} else if ($amda_ws->getNewToken()['token'] != $_GET["token"]) {
    $result = array('success' => false, 'message' => "E02: Token expired. Please authenticate again.");
} else {
    $result = $amda_ws->getOrbites($_GET);
70880168   Nathanael Jourdane   Add rate limit on...
21
22
}

70880168   Nathanael Jourdane   Add rate limit on...
23
24
25
26
27
if ($result['success']) {
    echo $result['dataFileURLs'];
} else {
    echo $result['message'];
}
16035364   Benjamin Renard   First commit
28
29

?>