29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/shibboleth-rails/user_model_additions.rb', line 29
def update_usage_stats(request, args = {})
if args[:login]
if self.respond_to?(:login_count)
self.login_count ||= 0
self.login_count += 1
end
if self.respond_to?(:current_login_at)
self.last_login_at = self.current_login_at if self.respond_to?(:last_login_at)
self.current_login_at = Time.now
end
if self.respond_to?(:current_login_ip)
self.last_login_ip = self.current_login_ip if self.respond_to?(:last_login_ip)
self.current_login_ip = request.remote_ip
end
self.login_callback(request, args) if self.respond_to?(:login_callback)
save(:validate => false)
end
self.request_callback(request, args) if self.respond_to?(:request_callback)
end
|