summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2016-06-21 23:05:59 +0200
committerjomo <github@jomo.tv>2016-06-21 23:05:59 +0200
commite2c413a8b1c33c9bcf9e1e7191817a3fd8845881 (patch)
treefba1f3edcb4aa1c44b151d1c122c17ae9bdc8895 /app
parentc8e964c23f542811ce60866fb629ef77a65c3899 (diff)
parentdb1c10eb9b89900db2e1f1c48a8d76cf669ab277 (diff)
Merge branch 'master' of https://github.com/Futseh/redstoner.com
Diffstat (limited to 'app')
-rw-r--r--app/controllers/users_controller.rb8
-rw-r--r--app/mailers/redstoner_mailer.rb2
-rw-r--r--app/views/users/show.html.erb3
3 files changed, 10 insertions, 3 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index ae9424e..ff21d8c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -138,6 +138,12 @@ class UsersController < ApplicationController
end
end
+ def resend_mail
+ RedstonerMailer.register_mail(@user, false).deliver_now
+ flash[:notice] = "Check your inbox for the confirmation mail."
+ redirect_to users_path(@user)
+ end
+
def update
if (mod? && current_user.role >= @user.role ) || (@user.is?(current_user) && confirmed?)
if mod?
@@ -344,4 +350,4 @@ class UsersController < ApplicationController
a = [:ign, :email, :password, :password_confirmation, :mail_own_thread_reply, :mail_other_thread_reply, :mail_own_blogpost_comment, :mail_other_blogpost_comment, :mail_mention] + add
params.require(:user).permit(a)
end
-end \ No newline at end of file
+end
diff --git a/app/mailers/redstoner_mailer.rb b/app/mailers/redstoner_mailer.rb
index 38e9956..1b387f8 100644
--- a/app/mailers/redstoner_mailer.rb
+++ b/app/mailers/redstoner_mailer.rb
@@ -44,4 +44,4 @@ class RedstonerMailer < ActionMailer::Base
@user = user
mail(to: @user.email, subject: "Email change on Redstoner.com")
end
-end \ No newline at end of file
+end
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 56ece88..eabe78e 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -23,6 +23,7 @@
<% if !@user.confirmed? %>
<% if @user.is?(current_user) %>
<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 red" %>
<% else %>
<span class="user-unconfirmed">This user hasn't confirmed their email yet!</span>
<% end %>
@@ -107,4 +108,4 @@
<% else %>
<%= render_md(@user.about).html_safe %>
<% end %>
-</div> \ No newline at end of file
+</div>