1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-24 12:31:44 +00:00

Adopt 2FA emails to new Mailer interface (#36005).

Patch by Felix Schäfer.


git-svn-id: http://svn.redmine.org/redmine/trunk@21279 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2021-11-13 09:24:53 +00:00
parent 4ea6d7b98e
commit 43ffba4e82

View File

@ -53,7 +53,7 @@ module Redmine
end end
def deliver_twofa_paired def deliver_twofa_paired
::Mailer.security_notification( ::Mailer.deliver_security_notification(
@user, @user,
User.current, User.current,
{ {
@ -63,7 +63,7 @@ module Redmine
field: "twofa__#{scheme_name}__name", field: "twofa__#{scheme_name}__name",
url: {controller: 'my', action: 'account'} url: {controller: 'my', action: 'account'}
} }
).deliver )
end end
def destroy_pairing!(code) def destroy_pairing!(code)
@ -82,7 +82,7 @@ module Redmine
end end
def deliver_twofa_unpaired def deliver_twofa_unpaired
::Mailer.security_notification( ::Mailer.deliver_security_notification(
@user, @user,
User.current, User.current,
{ {
@ -90,7 +90,7 @@ module Redmine
message: 'twofa_mail_body_security_notification_unpaired', message: 'twofa_mail_body_security_notification_unpaired',
url: {controller: 'my', action: 'account'} url: {controller: 'my', action: 'account'}
} }
).deliver )
end end
def send_code(controller: nil, action: nil) def send_code(controller: nil, action: nil)
@ -115,7 +115,7 @@ module Redmine
# make sure the user using the backup code is the same it's been issued to # make sure the user using the backup code is the same it's been issued to
return false unless @user.present? && @user == user_from_code return false unless @user.present? && @user == user_from_code
::Mailer.security_notification( ::Mailer.deliver_security_notification(
@user, @user,
User.current, User.current,
{ {
@ -124,7 +124,7 @@ module Redmine
message: 'twofa_mail_body_backup_code_used', message: 'twofa_mail_body_backup_code_used',
url: {controller: 'my', action: 'account'} url: {controller: 'my', action: 'account'}
} }
).deliver )
return true return true
end end
@ -136,7 +136,7 @@ module Redmine
token.update_columns value: Redmine::Utils.random_hex(6) token.update_columns value: Redmine::Utils.random_hex(6)
tokens << token tokens << token
end end
::Mailer.security_notification( ::Mailer.deliver_security_notification(
@user, @user,
User.current, User.current,
{ {
@ -144,7 +144,7 @@ module Redmine
message: 'twofa_mail_body_backup_codes_generated', message: 'twofa_mail_body_backup_codes_generated',
url: {controller: 'my', action: 'account'} url: {controller: 'my', action: 'account'}
} }
).deliver )
tokens tokens
end end