X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=Memories.pm;h=1a0b994edd3a96dc15f0a68b23443608421b5be8;hb=7d238800e0117998a191d02f398fec1b7b879277;hp=8536d1793c5d524800df05b49ab60344c6dbd86d;hpb=090e12c1f7141a6d5a25014fc33e9b1cc382c0b7;p=memories.git diff --git a/Memories.pm b/Memories.pm index 8536d17..1a0b994 100644 --- a/Memories.pm +++ b/Memories.pm @@ -1,7 +1,7 @@ package Memories; use strict; our $VERSION = "1.2"; -use Maypole::Application qw(Upload Authentication::UserSessionCookie -Debug); +use Maypole::Application qw(Authentication::UserSessionCookie); use HTML::TagCloud; use URI; use Memories::Config; @@ -81,7 +81,7 @@ sub additional_data { } $r->{template_args}{now} = Time::Piece->new; if ($r->session) { - (tied %{$r->session})->{lock_manager}->clean('/var/lib/memories/sessionlock', 3600) #remove files older than 1 hour + (tied %{$r->session})->{lock_manager}->clean(Memories->config->{auth}{session_args}{LockDirectory}, 3600) #remove files older than 1 hour } return $r->do_rss if ($r->params->{format} =~ /rss/) } @@ -92,6 +92,11 @@ sub authenticate { return DECLINED if $self->path =~/static|store/; # XXX $r->get_user; if (!$r->user and $self->path =~ /upload/) { $r->template("login"); } + # Don't let 'em go until they've fixed it + if ($r->session and $r->session->{quarantined} and $self->path !~ /js$/) { + $r->table("photo"); $r->action("quarantine"); + $r->model_class("Memories::Photo"); + } return OK; }