summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Account.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-09-04 18:38:35 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-09-04 18:38:35 +0200
commit7eb5f967f2d85ea3a7846353fbaf666e3a0e2bc5 (patch)
tree5072bd80f44589de6781a640d5d564f035c4ef33 /lib/Travelynx/Controller/Account.pm
parent482fa975b5f50064deb57b651019908c17b71f47 (diff)
profile: limit history to four weeks by default
Diffstat (limited to 'lib/Travelynx/Controller/Account.pm')
-rw-r--r--lib/Travelynx/Controller/Account.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm
index 10200a6..c68a22c 100644
--- a/lib/Travelynx/Controller/Account.pm
+++ b/lib/Travelynx/Controller/Account.pm
@@ -261,6 +261,13 @@ sub privacy {
$public_level &= ~0x30;
}
+ if ( $self->param('history_age') eq 'infinite' ) {
+ $public_level |= 0x40;
+ }
+ else {
+ $public_level &= ~0x40;
+ }
+
$self->users->set_privacy(
uid => $user->{id},
level => $public_level
@@ -281,6 +288,8 @@ sub privacy {
: $public_level & 0x20 ? 'extern'
: 'private'
);
+ $self->param(
+ history_age => $public_level & 0x40 ? 'infinite' : 'month' );
$self->render( 'privacy', name => $user->{name} );
}
}