X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/9b4770e85ce3add247c6462002ca910f6ba103da..5fd5cba6038d0ed97adb735cd24cc70c26335a3e:/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]