Blame view

php/rest/getDataset.php 632 Bytes
50fd9404   Elena.Budnik   getDataset()
1
2
3
4
5
6
7
<?php
/**
 * @file getDataset.php
 * @brief  REST interface for service getDataset
 */
 
//ini_set("allow_url_fopen", true);
5e2ea05e   Elena.Budnik   update REST
8
	require_once '../config.php';
50fd9404   Elena.Budnik   getDataset()
9

5e2ea05e   Elena.Budnik   update REST
10
11
12
13
14
	if (!key_exists("token", $_GET)) 
	{
		$result = array('success' => false, 'message' => "Authentication is required for this webservice.");
		exit(json_encode($result));
	}
50fd9404   Elena.Budnik   getDataset()
15

5e2ea05e   Elena.Budnik   update REST
16
17
18
19
20
21
22
23
24
	$amda_ws = new WebServer();
	
	if ($amda_ws->getNewToken()['token'] != $_GET["token"]) 
	{
		$result = array('success' => false, 'status' => 'expired', 'message' => "Token expired. Please authenticate again.");
	} else 
	{
		$result = $amda_ws->getDataset($_GET);
	}
50fd9404   Elena.Budnik   getDataset()
25

5e2ea05e   Elena.Budnik   update REST
26
	echo json_encode($result);
b8194303   Elena.Budnik   getPlot final
27
?>