From 3de5de7db2b7eebe000c6534bfd020405921ccdc Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 2 May 2019 10:05:15 +0200 Subject: Finish public-facing exposed user status (opt-in) --- lib/Travelynx/Controller/Account.pm | 4 ++-- lib/Travelynx/Controller/Traveling.pm | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 44babfa..f7d3a75 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -222,12 +222,12 @@ sub privacy { $public_level &= ~0x02; } $self->set_privacy( $user->{id}, $public_level ); + $self->redirect_to('account'); } else { $self->param( public_status => $public_level & 0x02 ? 1 : 0 ); + $self->render( 'privacy', name => $user->{name} ); } - - $self->render( 'privacy', name => $user->{name} ); } sub change_mail { diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index cf704ec..ee94913 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -50,6 +50,8 @@ sub public_status_card { my $name = $self->stash('name'); my $user = $self->get_privacy_by_name($name); + delete $self->stash->{layout}; + if ( $user and ( $user->{public_level} & 0x02 ) ) { my $status = $self->get_user_status( $user->{id} ); $self->render( -- cgit v1.2.3