end
def confirm
- @voter.vote.confirm!
-
- if @voter.election.embeddable? and params[:embed] == "true" \
- and @voter.election.early_results?
- redirect_to :action => :results, :id => @password, :embed => 'true'
- elsif not(@voter.election.verifiable) \
- and @voter.election.kiosk and params[:kiosk] == "true"
- redirect_to :action => "kiosk_ready", :id => @password, :kiosk => true
+ if @voter.vote.confirm!
+ if @voter.election.embeddable? and params[:embed] == "true" \
+ and @voter.election.early_results?
+ redirect_to :action => :results, :id => @password, :embed => 'true'
+ elsif not(@voter.election.verifiable) \
+ and @voter.election.kiosk and params[:kiosk] == "true"
+ redirect_to :action => "kiosk_ready", :id => @password, :kiosk => true
+ else
+ render :action => 'thanks'
+ end
else
- render :action => 'thanks'
+ redirect_to :action => 'index'
end
end
end
def results
- if @voter.election.early_results? \
- or @voter.election.enddate < Time.now
+ if authenticate and
+ (@voter.election.early_results? \
+ or @voter.election.enddate < Time.now)
@election = @voter.election
@sidebar_content = \
# when (a) there is no voter or (b) when there is a voter but
# it's kiosk mode on the right page, rewrite with a blank voter
- if not(@voter) \
+ if ((not @voter) and (election.enddate < Time.now)) \
or (params[:action] == 'kiosk_ready' and election.kiosk)
@voter = OpenVoter.new unless @voter
end