Sha256: 2f8b7c7b1621e1dd591887b3f8f199b25367f4a5c78af117bb18dd360d348192
Contents?: true
Size: 1.08 KB
Versions: 7
Compression:
Stored size: 1.08 KB
Contents
class UcbRails::UserSessionManager::Base attr_accessor :uid def login(uid) raise NotImplementedError end def current_user(uid) raise NotImplementedError end def log_request(user) end def logout(user) end def people_ou_entry(uid_in=nil) self.uid = uid_in if uid_in.present? @people_ou_entry ||= begin if @people_ou_entry = UcbRails::LdapPerson::Finder.find_by_uid(uid) @people_ou_entry else UcbRails.logger.debug "#{self.class} people_ou_entry not found for uid: #{uid.inspect}" nil end end end private def active_user @active_user ||= UcbRails::User.active.find_by_uid(uid) end def active_admin_user @active_user ||= UcbRails::User.active.admin.find_by_uid(uid) end def ldap_person_user_wrapper(ldap_person_entry) UcbRails::UserSessionManager::LdapPersonUserWrapper.new(ldap_person_entry) end class << self def current_user=(user) Thread.current[:current_user] = user end def current_user Thread.current[:current_user] end end end
Version data entries
7 entries across 7 versions & 1 rubygems