mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user