diff --git a/src/routes.php b/src/routes.php index e68c9ee..b71a2fa 100644 --- a/src/routes.php +++ b/src/routes.php @@ -7,6 +7,7 @@ use Slim\Http\Response; $app->add(new Tuupola\Middleware\HttpBasicAuthentication([ "path" => ["/inscriptos", "inscriptoscsv"], /* or ["/admin", "/api"] */ "realm" => "Protected", + "secure" => true, "users" => [ "admin" => "puntofijo" ] @@ -77,8 +78,9 @@ $app->get('/inscriptos', function(Request $request, Response $response, array $a $app->get('/inscriptoscsv', function(Request $request, Response $response, array $args){ $this->logger->info("GDDWorkshop '/practicalinfo' route"); $dbfile = $this->settings['db']['path']; - exec('sqlite3 -header -csv '.$dbfile.' "select * from registro" > "inscriptos.csv"'); - $file = 'inscriptos.csv'; + $file = 'inscriptos-surface2018.csv'; + exec('sqlite3 -header -csv '.$dbfile.' "select * from registro" > "'.$file.'"'); + $fh = fopen($file,"rb"); $stream = new \Slim\Http\Stream($fh); return $response->withHeader('Content-Type', 'application/force-download')