From a3fb4bd2c53842cf51afa553aa6f4b7d792eba81 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Tue, 24 Mar 2015 14:44:22 -0700 Subject: [PATCH] add DMCA contact form --- app/dmca.rb | 35 +++++++++++++++++++ views/dmca.erb | 69 +++++++++++++++++++++++++++++++++++++ views/dmca/contact_info.erb | 19 ++++++++++ 3 files changed, 123 insertions(+) create mode 100644 app/dmca.rb create mode 100644 views/dmca.erb create mode 100644 views/dmca/contact_info.erb diff --git a/app/dmca.rb b/app/dmca.rb new file mode 100644 index 00000000..384a57a8 --- /dev/null +++ b/app/dmca.rb @@ -0,0 +1,35 @@ +get '/dmca' do + erb :'dmca' +end + +get '/dmca/contact_info' do + content_type :json + {data: erb(:'dmca/contact_info', layout: false)}.to_json +end + +post '/dmca/contact' do + @errors = [] + + if params[:email].empty? || params[:subject].empty? || params[:urls].empty? || params[:body].empty? + @errors << 'Please fill out all fields' + end + + if !recaptcha_valid? + @errors << 'Captcha was not filled out (or was filled out incorrectly)' + end + + if !@errors.empty? + erb :'dmca' + else + EmailWorker.perform_async({ + from: 'web@neocities.org', + reply_to: params[:email], + to: 'dmca@neocities.org', + subject: "[Neocities DMCA Notice]: #{params[:subject]}", + body: "#{params[:urls].to_s}\n#{params[:body].to_s}" + }) + + flash[:success] = 'Your DCMA notification has been sent.' + redirect '/' + end +end diff --git a/views/dmca.erb b/views/dmca.erb new file mode 100644 index 00000000..3a2c3174 --- /dev/null +++ b/views/dmca.erb @@ -0,0 +1,69 @@ + + +
+
+

DMCA Takedown Contact

+
+
+ +
+ <% if !@errors.nil? && !@errors.empty? %> +
+ <% @errors.each do |error| %> +

<%= error%>

+ <% end %> +
+ <% end %> + +

Submit a DMCA copyright takedown notice

+ +

+ If you believe your copyright-protected work is being hosted on Neocities without authorization, you may submit a copyright infringement notification. These requests should only be submitted by the copyright owner or an agent authorized to act on the owner’s behalf. +

+ +
+ Do not make false claims. Misuse of this process may result in the suspension of your account or other legal consequences. +
+ +

+ The fastest and simplest way to notify Neocities of alleged copyright infringement is via this contact form. You can choose to email, phone, fax, or mail us with the contact information displayed after this form, but please note that they will take us much longer to get to than using the form. +

+ +

Submit a copyright complaint

+ +
+ +
+ + + + + + + + + + + + + +
+ <%== recaptcha_tag :challenge, ssl: request.ssl? %> +
+ + +
+
+ +
+
+ + diff --git a/views/dmca/contact_info.erb b/views/dmca/contact_info.erb new file mode 100644 index 00000000..4e807215 --- /dev/null +++ b/views/dmca/contact_info.erb @@ -0,0 +1,19 @@ +

Alternate Contact Information

+

Mailing Address

+

+ Neocities +
+ ATTN: DMCA +
+ 818 SW 3rd Avenue #221-2147 +
+ Portland, OR 97204-2405 +

+

Phone

+

+ 1-503-395-0010 +

+

Fax

+

+ 1-541-238-9273 +