SECURITY: Support for confirm old as well as new email accounts

This commit is contained in:
Robin Ward
2016-03-07 14:40:11 -05:00
parent d62689fa76
commit 5771d2aee2
47 changed files with 454 additions and 114 deletions

View File

@ -0,0 +1,15 @@
class CreateEmailChangeRequests < ActiveRecord::Migration
def change
create_table :email_change_requests do |t|
t.integer :user_id, null: false
t.string :old_email, length: 513, null: false
t.string :new_email, length: 513, null: false
t.integer :old_email_token_id, null: true
t.integer :new_email_token_id, null: true
t.integer :change_state, null: false
t.timestamps null: false
end
add_index :email_change_requests, :user_id
end
end

View File

@ -0,0 +1,8 @@
class RenameConfirmTranslationKey < ActiveRecord::Migration
def change
execute "UPDATE translation_overrides SET translation_key = 'user_notifications.confirm_new_email.subject_template'
WHERE translation_key = 'user_notifications.authorize_email.subject_template'"
execute "UPDATE translation_overrides SET translation_key = 'user_notifications.confirm_new_email.text_body_template'
WHERE translation_key = 'user_notifications.authorize_email.text_body_template'"
end
end