2015-08-06 08:03:27 -04:00
|
|
|
class AbuseReportsController < ApplicationController
|
|
|
|
def new
|
|
|
|
@abuse_report = AbuseReport.new
|
|
|
|
@abuse_report.user_id = params[:user_id]
|
2016-01-12 12:36:28 -05:00
|
|
|
@ref_url = params.fetch(:ref_url, '')
|
2015-08-06 08:03:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
@abuse_report = AbuseReport.new(report_params)
|
|
|
|
@abuse_report.reporter = current_user
|
|
|
|
|
|
|
|
if @abuse_report.save
|
2016-01-04 18:59:42 -05:00
|
|
|
@abuse_report.notify
|
2015-10-18 05:58:45 -04:00
|
|
|
|
|
|
|
message = "Thank you for your report. A GitLab administrator will look into it shortly."
|
2016-01-04 18:46:43 -05:00
|
|
|
redirect_to @abuse_report.user, notice: message
|
2015-08-06 08:03:27 -04:00
|
|
|
else
|
|
|
|
render :new
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def report_params
|
2016-01-04 18:46:43 -05:00
|
|
|
params.require(:abuse_report).permit(%i(
|
|
|
|
message
|
|
|
|
user_id
|
|
|
|
))
|
2015-08-06 08:03:27 -04:00
|
|
|
end
|
|
|
|
end
|