Class: SessionsController
Instance Method Summary
collapse
#dispatch, #get_locales, #is_dcmgr?, #set_application, #set_locale
Instance Method Details
#create ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/sessions_controller.rb', line 13
def create
user = User.authenticate(params[:login], params[:password])
@error_message = ''
if user
self.current_user = user
User.update_last_login(user.id)
redirect_back_or_default('/', :notice => "Logged in successfully")
else
@error_message = I18n.t('error_message.sign_in')
@login = params[:login]
render :action => 'new'
end
end
|
#destroy ⇒ Object
28
29
30
31
|
# File 'app/controllers/sessions_controller.rb', line 28
def destroy
logout_killing_session!
redirect_back_or_default('/', :notice => "You have been logged out.")
end
|
9
10
11
|
# File 'app/controllers/sessions_controller.rb', line 9
def information
render :layout => false
end
|
#new ⇒ Object
5
6
7
|
# File 'app/controllers/sessions_controller.rb', line 5
def new
@user = User.new
end
|