Commit f64ec1c9e198d34bfafc2c9fa3e523fa45496df0

Authored by Elena.Budnik
1 parent 038daddc

Private Access

Showing 1 changed file with 7 additions and 4 deletions   Show diff stats
src/DDSERVICES/REST/getGranulesSize.php
... ... @@ -13,8 +13,8 @@
13 13  
14 14 $dataSet = strtr($_GET['id'], $replace);
15 15  
16   - if (file_exists("../GRANULES/$dataSet.json")) {
17   - echo file_get_contents("../GRANULES/$dataSet.json");
  16 + if (file_exists("GRANULES/$dataSet.json")) {
  17 + echo file_get_contents("GRANULES/$dataSet.json");
18 18 exit();
19 19 }
20 20 $ddSys = new DOMDocument('1.0');
... ... @@ -27,7 +27,10 @@
27 27 $main = array();
28 28 $index = array();
29 29  
30   - $location = $VI->item(0)->parentNode->getElementsByTagName("LOCATION")->item(0)->nodeValue;
  30 + $location = $VI->item(0)->parentNode->getElementsByTagName("LOCATION")->item(0)->nodeValue;
  31 +
  32 + if (file_exists($location."RestrictedAccess")) exit(); // PrivateAccess
  33 +
31 34 foreach (glob($location."*.nc.gz") as $granule) {
32 35 $cmd = 'stat --printf="%s" '. $granule;
33 36 $file = basename($granule,".nc.gz");
... ... @@ -36,6 +39,6 @@
36 39 $main[substr($location,strlen(baseDir))] = $index;
37 40  
38 41 $json = json_encode($main);
39   - file_put_contents("../GRANULES/$dataSet.json", $json);
  42 + file_put_contents("GRANULES/$dataSet.json", $json);
40 43 exit($json);
41 44 ?>
... ...