Unverified Commit f69d8d05 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

avoid in-line display of user data export

It's typically too large for the browser
parent 4e01cc00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3288,7 +3288,7 @@ sub startup {
	$authed_r->get('/account/mail')->to('account#change_mail');
	$authed_r->get('/account/name')->to('account#change_name');
	$authed_r->get('/account/select_backend')->to('account#backend_form');
	$authed_r->get('/export.json')->to('account#json_export');
	$authed_r->get('/account/export')->to('account#json_export');
	$authed_r->get('/history.json')->to('traveling#json_history');
	$authed_r->get('/history.csv')->to('traveling#csv_history');
	$authed_r->get('/history')->to('traveling#history');
+5 −1
Original line number Diff line number Diff line
@@ -1563,10 +1563,14 @@ sub account {

sub json_export {
	my ($self) = @_;
	my $uid = $self->current_user->{id};
	my $user   = $self->current_user;
	my $uid    = $user->{id};
	my $name   = $user->{name};

	my $db = $self->pg->db;

	$self->res->headers->content_disposition(
		"attachment; filename=travelynx-export-${name}.json;");
	$self->render(
		json => {
			account    => $db->select( 'users', '*', { id => $uid } )->hash,
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@
	<div class="col s12">
		<h2>Export</h2>
		<ul>
			<li><a href="/export.json">Rohdaten</a> (Kein API-Ersatz, das Format kann sich jederzeit ändern)</li>
			<li><a href="/account/export">Rohdaten</a> (Kein API-Ersatz, das Format kann sich jederzeit ändern)</li>
		</ul>
	</div>
</div>