Merge pull request #10481 from demarches-simplifiees/super_admin_can_unblock_email
ETQ SuperAdmin, je peux débloquer les emails d'un usager
This commit is contained in:
commit
57e9cccbbd
3 changed files with 16 additions and 0 deletions
|
@ -23,6 +23,13 @@ module Manager
|
|||
end
|
||||
end
|
||||
|
||||
def unblock_mails
|
||||
user = User.find(params[:id])
|
||||
user.update!(email_verified_at: Time.current)
|
||||
flash[:notice] = "Les emails ont été débloqués."
|
||||
redirect_to manager_user_path(user)
|
||||
end
|
||||
|
||||
def resend_confirmation_instructions
|
||||
user = User.find(params[:id])
|
||||
user.resend_confirmation_instructions
|
||||
|
|
|
@ -26,6 +26,14 @@ as well as a link to its edit page.
|
|||
</h1>
|
||||
|
||||
<div class="buttons">
|
||||
<% if user.unverified_email? %>
|
||||
<%= link_to(
|
||||
"Débloquer mails",
|
||||
[:unblock_mails, namespace, page.resource],
|
||||
method: :post,
|
||||
class: "button") %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to(
|
||||
"Modifier",
|
||||
edit_manager_user_path(page.resource),
|
||||
|
|
|
@ -50,6 +50,7 @@ Rails.application.routes.draw do
|
|||
delete 'delete', on: :member
|
||||
post 'resend_confirmation_instructions', on: :member
|
||||
post 'resend_reset_password_instructions', on: :member
|
||||
post 'unblock_mails', on: :member
|
||||
put 'enable_feature', on: :member
|
||||
get 'emails', on: :member
|
||||
put 'unblock_email'
|
||||
|
|
Loading…
Reference in a new issue