Index: app/controllers/application_controller.rb =================================================================== --- app/controllers/application_controller.rb (revision 14622) +++ app/controllers/application_controller.rb (working copy) @@ -101,8 +101,10 @@ # Check the settings cache for each request Setting.check_cache # Find the current user - User.current = find_current_user - logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger + User.current = find_current_user.tap do |user| + user.update_column(:last_login_on, Time.now) if user + logger.info(" Current user: " + (user ? "#{user.login} (id=#{user.id})" : "anonymous")) if logger + end end # Returns the current user or nil if no user is logged in Index: app/models/user.rb =================================================================== --- app/models/user.rb (revision 14622) +++ app/models/user.rb (working copy) @@ -225,7 +225,6 @@ end end end - user.update_column(:last_login_on, Time.now) if user && !user.new_record? && user.active? user rescue => text raise text @@ -234,10 +233,6 @@ # Returns the user who matches the given autologin +key+ or nil def self.try_to_autologin(key) user = Token.find_active_user('autologin', key, Setting.autologin.to_i) - if user - user.update_column(:last_login_on, Time.now) - user - end end def self.name_formatter(formatter = nil) @@ -554,7 +549,7 @@ end end end - + hash.each do |role, projects| projects.uniq! end