Merge branch 'master' of https://bitbucket.org/gmcb/surfaces2018
This commit is contained in:
commit
17c1a8d821
@ -7,6 +7,7 @@ use Slim\Http\Response;
|
|||||||
$app->add(new Tuupola\Middleware\HttpBasicAuthentication([
|
$app->add(new Tuupola\Middleware\HttpBasicAuthentication([
|
||||||
"path" => ["/inscriptos", "inscriptoscsv"], /* or ["/admin", "/api"] */
|
"path" => ["/inscriptos", "inscriptoscsv"], /* or ["/admin", "/api"] */
|
||||||
"realm" => "Protected",
|
"realm" => "Protected",
|
||||||
|
"secure" => true,
|
||||||
"users" => [
|
"users" => [
|
||||||
"admin" => "puntofijo"
|
"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){
|
$app->get('/inscriptoscsv', function(Request $request, Response $response, array $args){
|
||||||
$this->logger->info("GDDWorkshop '/practicalinfo' route");
|
$this->logger->info("GDDWorkshop '/practicalinfo' route");
|
||||||
$dbfile = $this->settings['db']['path'];
|
$dbfile = $this->settings['db']['path'];
|
||||||
exec('sqlite3 -header -csv '.$dbfile.' "select * from registro" > "inscriptos.csv"');
|
$file = 'inscriptos-surface2018.csv';
|
||||||
$file = 'inscriptos.csv';
|
exec('sqlite3 -header -csv '.$dbfile.' "select * from registro" > "'.$file.'"');
|
||||||
|
|
||||||
$fh = fopen($file,"rb");
|
$fh = fopen($file,"rb");
|
||||||
$stream = new \Slim\Http\Stream($fh);
|
$stream = new \Slim\Http\Stream($fh);
|
||||||
return $response->withHeader('Content-Type', 'application/force-download')
|
return $response->withHeader('Content-Type', 'application/force-download')
|
||||||
|
Loading…
Reference in New Issue
Block a user