allow mods to resend confirmation emails for other users

This commit is contained in:
jomo
2016-06-21 23:41:04 +02:00
parent e0ac5fac13
commit 81d9fabe7b
2 changed files with 2 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ class UsersController < ApplicationController
end end
def resend_mail def resend_mail
if @user.is?(current_user) && !confirmed? if (@user.is?(current_user) || mod) && !confirmed?
RedstonerMailer.register_mail(@user, false).deliver_now RedstonerMailer.register_mail(@user, false).deliver_now
flash[:notice] = "Check your inbox for the confirmation mail." flash[:notice] = "Check your inbox for the confirmation mail."
else else

View File

@@ -21,7 +21,7 @@
<% end %> <% end %>
<% if !@user.confirmed? %> <% if !@user.confirmed? %>
<% if @user.is?(current_user) %> <% if @user.is?(current_user) || mod? %>
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span> <span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
<%= button_to "Resend the confirmation mail", resend_mail_user_path, class: "btn dark", form_class: "inline-block", data: {confirm: "Did you check your spam folder?"} %> <%= button_to "Resend the confirmation mail", resend_mail_user_path, class: "btn dark", form_class: "inline-block", data: {confirm: "Did you check your spam folder?"} %>
<% else %> <% else %>