Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9f6dc2a4
Commit
9f6dc2a4
authored
Oct 18, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only pass abuse report ID to AbuseReportMailer.
parent
dc170516
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
app/controllers/abuse_reports_controller.rb
app/controllers/abuse_reports_controller.rb
+4
-3
app/mailers/abuse_report_mailer.rb
app/mailers/abuse_report_mailer.rb
+7
-3
No files found.
app/controllers/abuse_reports_controller.rb
View file @
9f6dc2a4
...
...
@@ -9,11 +9,12 @@ class AbuseReportsController < ApplicationController
@abuse_report
.
reporter
=
current_user
if
@abuse_report
.
save
message
=
"Thank you for your report. A GitLab administrator will look into it shortly."
redirect_to
root_path
,
notice:
message
if
current_application_settings
.
admin_notification_email
.
present?
AbuseReportMailer
.
delay
.
notify
(
@abuse_report
,
current_application_settings
.
admin_notification_email
)
AbuseReportMailer
.
delay
.
notify
(
@abuse_report
.
id
)
end
message
=
"Thank you for your report. A GitLab administrator will look into it shortly."
redirect_to
root_path
,
notice:
message
else
render
:new
end
...
...
app/mailers/abuse_report_mailer.rb
View file @
9f6dc2a4
class
AbuseReportMailer
<
BaseMailer
include
Gitlab
::
CurrentSettings
def
notify
(
abuse_report
,
to_email
)
@abuse_report
=
abuse_report
def
notify
(
abuse_report
_id
)
@abuse_report
=
AbuseReport
.
find
(
abuse_report_id
)
mail
(
to:
to_email
,
subject:
"[Gitlab] Abuse report filed for `
#{
@abuse_report
.
user
.
username
}
`"
)
mail
(
to:
current_application_settings
.
admin_notification_email
,
subject:
"
#{
@abuse_report
.
user
.
name
}
(
#{
@abuse_report
.
user
.
username
}
) was reported for abuse"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment