fix secure route on httpbasicauth
This commit is contained in:
parent
f24319d961
commit
45fc756011
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user