Class: Admin::WelcomeController
- Defined in:
- app/controllers/admin/welcome_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 |
# File 'app/controllers/admin/welcome_controller.rb', line 5 def index redirect_to admin_pages_url end |
#login ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/admin/welcome_controller.rb', line 9 def login if request.post? login = params[:user][:login] password = params[:user][:password] announce_invalid_user unless self.current_user = User.authenticate(login, password) end if current_user if params[:remember_me] current_user.remember_me end redirect_to (session[:return_to] || welcome_url) session[:return_to] = nil end end |
#logout ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/admin/welcome_controller.rb', line 25 def logout [:session_token] = { :expires => 1.day.ago } self.current_user.forget_me if self.current_user self.current_user = nil announce_logged_out redirect_to login_url end |