summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Traveling.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-08 11:06:17 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-08 11:06:17 +0100
commit561ff4574bb6078ce4c9f72647a9c3d1a92cac6e (patch)
tree1402b28d03434d2c59207f31e2d192b044797bac /lib/Travelynx/Controller/Traveling.pm
parent402a5597f5d095b059e8ee1a4a8b653c3187ff93 (diff)
Allow status visibility to be limited to travelynx users
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 3f8f37e..7b48d28 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -35,7 +35,13 @@ sub user_status {
my $ts = $self->stash('ts');
my $user = $self->get_privacy_by_name($name);
- if ( $user and ( $user->{public_level} & 0x02 ) ) {
+ if (
+ $user
+ and ( $user->{public_level} & 0x02
+ or
+ ( $user->{public_level} & 0x01 and $self->is_user_authenticated ) )
+ )
+ {
my $status = $self->get_user_status( $user->{id} );
my %tw_data = (
@@ -81,6 +87,9 @@ sub user_status {
twitter => \%tw_data,
);
}
+ elsif ( $user->{public_level} & 0x01 ) {
+ $self->render( 'login', redirect_to => $self->req->url );
+ }
else {
$self->render('not_found');
}
@@ -94,7 +103,13 @@ sub public_status_card {
delete $self->stash->{layout};
- if ( $user and ( $user->{public_level} & 0x02 ) ) {
+ if (
+ $user
+ and ( $user->{public_level} & 0x02
+ or
+ ( $user->{public_level} & 0x01 and $self->is_user_authenticated ) )
+ )
+ {
my $status = $self->get_user_status( $user->{id} );
$self->render(
'_public_status_card',