Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Commit

Permalink
Fix direct object reference
Browse files Browse the repository at this point in the history
  • Loading branch information
VandorpeDavid committed Sep 4, 2016
1 parent b9f3890 commit 17b16fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/frontend/registration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Frontend::RegistrationController < Frontend::FrontendController

before_filter :load_club!
before_filter :load_member, :only => [:show, :update]
before_filter :verify_club

def load_member
@member = Member.unscoped.find(session[:member_id]) if session[:member_id]
Expand Down Expand Up @@ -146,4 +147,8 @@ def load_eid_member_attributes
sex = attributes[key_prefix + "gender"]
@member.sex = {'1' => 'm', '2' => 'f'}[sex] || @member.sex
end

def verify_club
raise 'This club doesn\'t use website registration' unless @club.registration_method == 'website'
end
end

0 comments on commit 17b16fb

Please sign in to comment.