X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/da8a3c5c6efcad4e4a5424a09c0479f7ee52a9ec..57a193789d1f48a856816c357483cfd7c621cd9d:/app/controllers/voter_controller.rb diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index c063469..a912824 100644 --- a/app/controllers/voter_controller.rb +++ b/app/controllers/voter_controller.rb @@ -19,8 +19,10 @@ class VoterController < ApplicationController @voter = OpenVoter.find(:all, :conditions => ["session_id = ? and election_id = ?", session.session_id, @election.id])[0] - - @voter = OpenVoter.new unless @voter + + unless @voter and not @voter.election.kiosk + @voter = OpenVoter.new + end @voter.election = @election @voter.session_id = session.session_id @@ -121,6 +123,8 @@ class VoterController < ApplicationController if @voter.election.embeddable? and params[:embed] == "true" \ and @voter.election.early_results? redirect_to :action => :results, :id => @password, :embed => 'true' + elsif @voter.election.kiosk and params[:kiosk] = "true" + redirect_to :action => "kiosk_ready", :id => @password, :kiosk => true else render :action => 'thanks' end @@ -176,7 +180,13 @@ class VoterController < ApplicationController redirect_to :action => 'index' end end - + + def kiosk_ready + if not authenticate + redirect_to :action => 'index', :kiosk => true + end + end + private def authenticate password = params[:id]