mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Set email validation grandfathering for May 16th. All new sites will need to validate email.
This commit is contained in:
parent
a2a6a40438
commit
f97ebd9781
4 changed files with 6 additions and 4 deletions
2
app.rb
2
app.rb
|
@ -28,7 +28,7 @@ before do
|
|||
@api = true
|
||||
content_type :json
|
||||
elsif request.path.match /^\/webhooks\//
|
||||
# Skips the CSRF check for stripe web hooks
|
||||
# Skips the CSRF/validation check for stripe web hooks
|
||||
elsif email_not_validated? && !(request.path =~ /^\/site\/.+\/confirm_email|^\/settings\/change_email|^\/signout|^\/welcome|^\/plan/)
|
||||
redirect "/site/#{current_site.username}/confirm_email"
|
||||
else
|
||||
|
|
|
@ -232,7 +232,7 @@ post '/site/:username/confirm_email' do
|
|||
redirect '/settings#email'
|
||||
end
|
||||
|
||||
redirect '/'
|
||||
redirect '/tutorial'
|
||||
else
|
||||
flash[:error] = 'You must enter a valid token.'
|
||||
redirect "/site/#{current_site.username}/confirm_email"
|
||||
|
|
|
@ -125,5 +125,7 @@ def dont_browser_cache
|
|||
end
|
||||
|
||||
def email_not_validated?
|
||||
current_site && current_site.parent? && !current_site.is_education && !current_site.email_confirmed && !current_site.supporter? && Site::EMAIL_VALIDATION_CUTOFF_DATE < Time.now
|
||||
return false if current_site && current_site.created_at < Site::EMAIL_VALIDATION_CUTOFF_DATE
|
||||
|
||||
current_site && current_site.parent? && !current_site.is_education && !current_site.email_confirmed && !current_site.supporter?
|
||||
end
|
||||
|
|
|
@ -121,7 +121,7 @@ class Site < Sequel::Model
|
|||
maximum_site_files: 2000
|
||||
)
|
||||
|
||||
EMAIL_VALIDATION_CUTOFF_DATE = Time.now - 1
|
||||
EMAIL_VALIDATION_CUTOFF_DATE = Time.parse('May 16, 2016')
|
||||
|
||||
def self.newsletter_sites
|
||||
Site.select(:email).
|
||||
|
|
Loading…
Add table
Reference in a new issue