Recaptcha support added when reporting screenshots

There's lots of spam recently. We need to do something against it.
This commit is contained in:
Christoph Haas 2016-07-21 11:29:25 +02:00
parent 85b9f1014f
commit ff0b93380a
5 changed files with 16 additions and 4 deletions

View file

@ -177,10 +177,12 @@ class PackagesController < ApplicationController
# Receive an anonymous report from a user to have a screenshot removed.
def report_screenshot
@screenshot = Screenshot.find(params[:id])
@screenshot.delete_reason = params[:delete_reason]
@screenshot.markedfordelete = true
@screenshot.save!
flash['notice'] = "Screenshot reported. The moderators will deal with it."
if verify_recaptcha
@screenshot.delete_reason = params[:delete_reason]
@screenshot.markedfordelete = true
@screenshot.save!
flash['notice'] = "Screenshot reported. The moderators will deal with it."
end
redirect_to :back
end