Skip to content
Extraits de code Groupes Projets
Valider fd6d41dd rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

require authentication for invite actions

parent 62927750
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -6,6 +6,8 @@ require Rails.root.join('lib', 'email_inviter') ...@@ -6,6 +6,8 @@ require Rails.root.join('lib', 'email_inviter')
class InvitationsController < ApplicationController class InvitationsController < ApplicationController
before_filter :authenticate_user!, :only => [:new, :create]
def new def new
@invite_code = current_user.invitation_code @invite_code = current_user.invitation_code
respond_to do |format| respond_to do |format|
...@@ -15,7 +17,7 @@ class InvitationsController < ApplicationController ...@@ -15,7 +17,7 @@ class InvitationsController < ApplicationController
end end
end end
# this is for legacy invites. We try to look the person who sent them the # this is for legacy invites. We try to look the person who sent them the
# invite, and use their new invite code # invite, and use their new invite code
# owe will be removing this eventually # owe will be removing this eventually
# @depreciated # @depreciated
...@@ -49,7 +51,7 @@ class InvitationsController < ApplicationController ...@@ -49,7 +51,7 @@ class InvitationsController < ApplicationController
inviter = EmailInviter.new(params[:email_inviter][:emails], current_user, params[:email_inviter]) inviter = EmailInviter.new(params[:email_inviter][:emails], current_user, params[:email_inviter])
inviter.send! inviter.send!
redirect_to :back, :notice => "Great! Invites were sent off to #{inviter.emails.join(', ')}" redirect_to :back, :notice => "Great! Invites were sent off to #{inviter.emails.join(', ')}"
end end
def check_if_invites_open def check_if_invites_open
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter