1 class SiteController < ApplicationController
6 # if the person claims they are logged in
9 # check to see that we actually have record of them
10 if User.find_all(["id = ?", session[:user].id]).length == 1
11 # if we have record of them, grab the list of their elections
12 session[:user] = User.find(session[:user].id)
13 @current_elections = session[:user].elections.sort do |a,b|
14 b.enddate <=> a.enddate
17 # if we have no record of them, set the session id back to
18 # nothing and start again