diff --git a/app/controllers/registrant/domain_delete_confirms_controller.rb b/app/controllers/registrant/domain_delete_confirms_controller.rb index ae4d8cb5f..bfc481771 100644 --- a/app/controllers/registrant/domain_delete_confirms_controller.rb +++ b/app/controllers/registrant/domain_delete_confirms_controller.rb @@ -20,8 +20,11 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController @registrant_verification = RegistrantVerification.new(domain_id: @domain.id, domain_name: @domain.name, verification_token: params[:token]) + + initiator = current_user ? current_user.username : t(:user_not_authorized) + if params[:rejected] - if @registrant_verification.domain_registrant_delete_reject!("email link #{current_user.username}") + if @registrant_verification.domain_registrant_delete_reject!("email link #{initiator}") flash[:notice] = t(:registrant_domain_verification_rejected) redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true) else @@ -29,7 +32,7 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController return render 'show' end elsif params[:confirmed] - if @registrant_verification.domain_registrant_delete_confirm!("email link #{current_user.username}") + if @registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}") flash[:notice] = t(:registrant_domain_verification_confirmed) redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true) else diff --git a/app/controllers/registrant/domain_update_confirms_controller.rb b/app/controllers/registrant/domain_update_confirms_controller.rb index 75f313ea8..daa695818 100644 --- a/app/controllers/registrant/domain_update_confirms_controller.rb +++ b/app/controllers/registrant/domain_update_confirms_controller.rb @@ -20,8 +20,11 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController @registrant_verification = RegistrantVerification.new(domain_id: @domain.id, domain_name: @domain.name, verification_token: params[:token]) + + initiator = current_user ? current_user.username : t(:user_not_authorized) + if params[:rejected] - if @registrant_verification.domain_registrant_change_reject!("email link #{current_user.username}") + if @registrant_verification.domain_registrant_change_reject!("email link, #{initiator}") flash[:notice] = t(:registrant_domain_verification_rejected) redirect_to registrant_domain_update_confirm_path(@domain.id, rejected: true) else @@ -29,7 +32,7 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController return render 'show' end elsif params[:confirmed] - if @registrant_verification.domain_registrant_change_confirm!("email link #{current_user.username}") + if @registrant_verification.domain_registrant_change_confirm!("email link, #{initiator}") flash[:notice] = t(:registrant_domain_verification_confirmed) redirect_to registrant_domain_update_confirm_path(@domain.id, confirmed: true) else diff --git a/config/locales/en.yml b/config/locales/en.yml index a807c53e8..1da83d9d5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -940,3 +940,4 @@ en: edit_pw: 'Edit Pw' optional: 'Optional' test_registrar: "Test registrar" + user_not_authorized: "user not authorized"