Sha256: a729269009b0c1f0df6dc72ea959ca6923e94d6cdd8892dad23a568441143e9d

Contents?: true

Size: 749 Bytes

Versions: 13

Compression:

Stored size: 749 Bytes

Contents

module UcbRails
  module UserSessionManager
    class ActiveInUserTable < Base

      def login(uid)
        self.uid = uid
        
        if user_table_entry && people_ou_entry
          UcbRails::UserLdapService.update_user_from_ldap_entry(people_ou_entry).tap do |user|
            user.touch(:last_login_at)
          end
        else
          false
        end
      end
      
      def current_user(uid)
        UcbRails::User.find_by_uid(uid)
      end

      def log_request(user)
        user.present? and user.touch(:last_request_at)
      end

      def logout(user)
        user.present? and user.touch(:last_logout_at)
      end
      
      private
      
      def user_table_entry
        active_user
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ucb_rails-0.0.14 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.13 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.12 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.11 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.10 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.9 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.8 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.7 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.6 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.5 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.4 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.3 app/models/ucb_rails/user_session_manager/active_in_user_table.rb
ucb_rails-0.0.2 app/models/ucb_rails/user_session_manager/active_in_user_table.rb