mirror of
https://github.com/neocities/neocities.git
synced 2025-07-12 05:48:11 +02:00
no password reset send/undelete for banned sites
This commit is contained in:
parent
c43b68005a
commit
b1e0b3c894
1 changed files with 13 additions and 1 deletions
|
@ -12,6 +12,13 @@ post '/send_password_reset' do
|
||||||
|
|
||||||
sites = Site.get_recovery_sites_with_email params[:email]
|
sites = Site.get_recovery_sites_with_email params[:email]
|
||||||
|
|
||||||
|
sites.each do |site|
|
||||||
|
if site.is_banned
|
||||||
|
flash[:error] = 'Sorry, we cannot restore this account.'
|
||||||
|
redirect '/'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if sites.length > 0
|
if sites.length > 0
|
||||||
token = SecureRandom.uuid.gsub('-', '')+'-'+Time.now.to_i.to_s
|
token = SecureRandom.uuid.gsub('-', '')+'-'+Time.now.to_i.to_s
|
||||||
sites.each do |site|
|
sites.each do |site|
|
||||||
|
@ -70,9 +77,14 @@ get '/password_reset_confirm' do
|
||||||
redirect '/'
|
redirect '/'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if reset_site.is_banned
|
||||||
|
flash[:error] = 'Sorry, we cannot restore this account.'
|
||||||
|
redirect '/'
|
||||||
|
end
|
||||||
|
|
||||||
if reset_site.is_deleted
|
if reset_site.is_deleted
|
||||||
unless reset_site.undelete!
|
unless reset_site.undelete!
|
||||||
flash[:error] = "Sorry, we cannot restore this account."
|
flash[:error] = 'Sorry, we cannot restore this account.'
|
||||||
redirect '/'
|
redirect '/'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue