diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-02-14 16:29:44 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-02-14 16:29:44 +0100 |
commit | a1865fa69e3a90e484e8423e256e1cb969b7e04d (patch) | |
tree | e5cf2c747e9e4e07181c3e4257a2e3177c4ea773 /lib/Travelynx/Controller/Account.pm | |
parent | 6cbbc2b16f059a0d2b1f65a371e3c1e1f4c11fde (diff) |
add privacy setting for showing history and latest arrival timestamp
Diffstat (limited to 'lib/Travelynx/Controller/Account.pm')
-rw-r--r-- | lib/Travelynx/Controller/Account.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index cef79a5..135c52b 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -236,6 +236,19 @@ sub privacy { else { $public_level &= ~0x04; } + + if ( $self->param('history_level') eq 'intern' ) { + $public_level |= 0x10; + $public_level &= ~0x20; + } + elsif ( $self->param('history_level') eq 'extern' ) { + $public_level |= 0x20; + $public_level &= ~0x10; + } + else { + $public_level &= ~0x30; + } + $self->set_privacy( $user->{id}, $public_level ); $self->flash( success => 'privacy' ); @@ -248,6 +261,11 @@ sub privacy { : 'private' ); $self->param( public_comment => $public_level & 0x04 ? 1 : 0 ); + $self->param( + history_level => $public_level & 0x10 ? 'intern' + : $public_level & 0x20 ? 'extern' + : 'private' + ); $self->render( 'privacy', name => $user->{name} ); } } |