summaryrefslogtreecommitdiffstats
path: root/app/views/users/_form.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/users/_form.html.erb')
-rw-r--r--app/views/users/_form.html.erb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index bb20a4f9d..b9054a3b0 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -42,6 +42,19 @@
<p><%= f.check_box :generate_password %></p>
<p><%= f.check_box :must_change_passwd %></p>
</div>
+ <p>
+ <label><%=l :setting_twofa -%></label>
+ <% if @user.twofa_active? %>
+ <%=l 'twofa_currently_active', twofa_scheme_name: l("twofa__#{@user.twofa_scheme}__name") -%><br/>
+ <% if @user == User.current # administrators cannot deactivate their own 2FA without confirmation code %>
+ <%= link_to l('button_disable'), { controller: 'twofa', action: 'deactivate_init', scheme: @user.twofa_scheme }, method: :post -%>
+ <% else %>
+ <%= link_to l('button_disable'), { controller: 'twofa', action: 'admin_deactivate', user_id: @user }, method: :post -%>
+ <% end %>
+ <% else %>
+ <%=l 'twofa_not_active' %>
+ <% end %>
+ </p>
</fieldset>
</div>