Added autologin feature (disabled by default).

To enable this feature, go to administration settings and choose a duration for autologin.
When enabled, a checkbox on the login form lets users activate autologin.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@514 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-05-06 12:49:32 +00:00
parent 56513a8c66
commit 7eb6471559
16 changed files with 72 additions and 14 deletions

View File

@@ -40,6 +40,13 @@ class ApplicationController < ActionController::Base
# check if login is globally required to access the application
def check_if_login_required
# no check needed if user is already logged in
return true if logged_in_user
# auto-login feature
autologin_key = cookies[:autologin]
if autologin_key && Setting.autologin?
self.logged_in_user = User.find_by_autologin_key(autologin_key)
end
require_login if Setting.login_required?
end