]> git.decadent.org.uk Git - memories.git/commitdiff
Stop anonymous uploads
authorSimon Cozens <simon@simon-cozens.org>
Mon, 12 Feb 2007 21:13:58 +0000 (21:13 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Mon, 12 Feb 2007 21:13:58 +0000 (21:13 +0000)
git-svn-id: http://svn.simon-cozens.org/memories/trunk@31 041978f6-d955-411f-a9d7-1d8545c9c3c7

Memories.pm
Memories/Photo.pm

index 0aebf11fab5cf447bbdadd0b047c800ffbf725b3..8536d1793c5d524800df05b49ab60344c6dbd86d 100644 (file)
@@ -91,6 +91,7 @@ sub authenticate {
    my ($self, $r) = @_;
    return DECLINED if $self->path =~/static|store/; # XXX
    $r->get_user;
+   if (!$r->user and $self->path =~ /upload/) { $r->template("login"); }
    return OK; 
 }
 
index eef30194cba202444604288434fd44cdf8fd1e67..57a53c46d93b9c68471195f0ac070e3206444fa3 100644 (file)
@@ -45,7 +45,6 @@ sub do_upload :Exported {
     my ($self, $r) = @_;
     my %upload = $r->upload("photo");
 
-    # XXX Stop anonymous uploads!
     my $photo = $self->create({
         uploader => $r->user,
         uploaded => Time::Piece->new(),