Show
Ignore:
Timestamp:
02/25/10 15:56:33 (2 years ago)
Author:
gbastien
Message:
  • Added possibility to have a deployed geolocated node not show on map (quick fix) (#706)
  • When producing anonymised data export, two files are produced, one for the geolocated nodes and one for the connections (#705)
  • Additions and bug fixes to web service: can now logout and auth returns both error code and message
  • Starting work on #707 as needed
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/admin/stats.php

    r1292 r1453  
    8383                $stats_title = _("Network information for")." '".$networkObject->getName()."'"; 
    8484        } 
     85        elseif (isset($_REQUEST['file']) && isset($_REQUEST['type'])) { 
     86            $filename = $_REQUEST['file']; 
     87            $type = $_REQUEST['type']; 
     88            if (User :: getCurrentUser()->DEPRECATEDisSuperAdmin())  { 
     89            // The file is valid for one hour, because it contains sensitive data and we don't want to open a security breach 
     90            if (file_exists($filename) && (filectime($filename) > (time() - 60*60)) ) { 
     91                header('Content-Type: application/octet-stream'); 
     92              header('Content-Disposition: inline; filename="anonymised_'.$type.'.sql"'); 
     93              header("Content-Transfer-Encoding: binary"); 
     94              header("Pragma: no-cache"); 
     95              header("Expires: 0"); 
     96              $fp=fopen($filename,"r"); 
     97              print fread($fp,filesize($filename)); 
     98              fclose($fp); 
     99              exit(); 
     100            } else { 
     101                if (!file_exists($filename)) { 
     102                    throw new Exception(sprintf(_("File %s does not exist"),  $filename)); 
     103                } 
     104                if (filectime($filename) > (time() - 60*60)) { 
     105                    throw new Exception(sprintf(_("The statistics file for anonymised_%s.sql has expired."), $type)); 
     106                } 
     107            } 
     108            } else { 
     109                throw new Exception(_("These reports are only available to server administrators.")); 
     110            } 
     111        } 
    85112        else { 
    86113            $stats_title = null;