Sha256: 65941b06f75c83b956631ead1ce69135c9bf996f2f8157bb4cc205a89b9d3e49

Contents?: true

Size: 518 Bytes

Versions: 61

Compression:

Stored size: 518 Bytes

Contents

module Spider; module Auth
    
    module AuthenticationTracking
        
        def self.included(mod)
            mod.element :last_login, DateTime, :label => _('Last login'), :read_only => true
            mod.element :login_count, Fixnum, :label => _('Login count'), :read_only => true
        end
        
        def authenticated(method)
            self.login_count ||= 0
            self.login_count += 1
            self.last_login = DateTime.now
            save
        end
        
    end
    
end; end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-1.0.0 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.39 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.38 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.37 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.35 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.34 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.33 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.32 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.31 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.30 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.29 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.28 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.27 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.26 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.26.pre1 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.25 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.24 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.23 apps/core/auth/models/mixins/authentication_tracking.rb
spiderfw-0.6.22 apps/core/auth/models/mixins/authentication_tracking.rb