Added password reset via admin panel

This commit is contained in:
mgabdev
2019-08-28 16:13:56 -04:00
parent 3b1cfd4253
commit 30c30c696a
5 changed files with 46 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
- content_for :page_title do
= t('admin.accounts.change_password.title', username: @account.acct)
= simple_form_for(@user, url: admin_account_path(@account.id), html: { method: :put }) do |f|
= render 'shared/error_messages', object: @user
= f.input :email, placeholder: t('simple_form.labels.defaults.email'), input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }
= f.input :password, autocomplete: "off", placeholder: t('simple_form.labels.defaults.new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.new_password') }
= f.input :password_confirmation, autocomplete: "off", placeholder: t('simple_form.labels.defaults.confirm_new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_new_password') }
.actions
= f.button :button, t('admin.accounts.set_new_password'), type: :submit

View File

@@ -221,6 +221,9 @@
- elsif !@account.local? || @account.user_approved?
= link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@account.id, type: 'suspend'), class: 'button button--destructive' if can?(:suspend, @account)
- if @account.local?
= link_to t('admin.accounts.change_password.button'), edit_admin_account_path(@account.id), class: 'button'
- unless @account.local?
- if DomainBlock.where(domain: @account.domain).exists?
= link_to t('admin.domain_blocks.undo'), admin_instance_path(@account.domain), class: 'button'