From 81d9fabe7bf2d8249402dea99871ea0a8897f746 Mon Sep 17 00:00:00 2001 From: jomo Date: Tue, 21 Jun 2016 23:41:04 +0200 Subject: allow mods to resend confirmation emails for other users --- app/controllers/users_controller.rb | 2 +- app/views/users/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index bd511df..db46cd8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -139,7 +139,7 @@ class UsersController < ApplicationController end def resend_mail - if @user.is?(current_user) && !confirmed? + if (@user.is?(current_user) || mod) && !confirmed? RedstonerMailer.register_mail(@user, false).deliver_now flash[:notice] = "Check your inbox for the confirmation mail." else diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 0a5431c..e371a09 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -21,7 +21,7 @@ <% end %> <% if !@user.confirmed? %> - <% if @user.is?(current_user) %> + <% if @user.is?(current_user) || mod? %> Please confirm your email <%= @user.email %> ! <%= 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 %> -- cgit v1.2.3