don't allow other users or confirmed users to resend confirmation email
This commit is contained in:
@@ -139,8 +139,12 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def resend_mail
|
def resend_mail
|
||||||
RedstonerMailer.register_mail(@user, false).deliver_now
|
if @user.is?(current_user) && !confirmed?
|
||||||
flash[:notice] = "Check your inbox for the confirmation mail."
|
RedstonerMailer.register_mail(@user, false).deliver_now
|
||||||
|
flash[:notice] = "Check your inbox for the confirmation mail."
|
||||||
|
else
|
||||||
|
flash[:alert] = "You're not allowed to resend this user's confirmation email"
|
||||||
|
end
|
||||||
redirect_to user_path(@user)
|
redirect_to user_path(@user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user