Module: Gitkite::ApplicationHelper

Defined in:
app/helpers/gitkite/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_user!Object



13
14
15
16
17
18
19
# File 'app/helpers/gitkite/application_helper.rb', line 13

def authenticate_user!
  if !current_user
    flash.alert = "Sign in to continue"
    session[:previous_url] = request.fullpath
    redirect_to gitkite.
  end
end

#current_userObject



3
4
5
6
7
8
9
10
11
# File 'app/helpers/gitkite/application_helper.rb', line 3

def current_user
  user_id = session[:user]

  if(user_id)
    User.find(user_id)
  else
    false
  end
end