X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=Memories%2FPhoto.pm;h=939af0078b69d502ffe4491a5fa83bdd31cf682e;hb=f0714c81057768b31c81cdef67fd7a9317a4f8b9;hp=5ce8d956145728a8906e6f6418b78aba0893cd95;hpb=2fbbd5523381d92d751d9930ccd2993449a508da;p=memories.git diff --git a/Memories/Photo.pm b/Memories/Photo.pm index 5ce8d95..939af00 100644 --- a/Memories/Photo.pm +++ b/Memories/Photo.pm @@ -211,6 +211,14 @@ sub comment :Exported {} sub tagedit :Exported {} sub similar :Exported {} sub sized :Exported {} +sub delete :Exported { + my ($self, $r, $photo) = @_; + if ($photo and $photo->uploader == $r->user) { + $photo->delete; + $r->message("Photo deleted!"); + } + $r->template("frontpage"); +} use Class::DBI::Plugin::Pager; use Class::DBI::Plugin::AbstractCount;