lib/nitro/server/session.rb in nitro-0.7.0 vs lib/nitro/server/session.rb in nitro-0.8.0

- old
+ new

@@ -21,17 +21,17 @@ # This object is typically called in a distributed configuration. # Avoid writting methods that accept or return big objects! # # SOS: This object lives in the Cluster! # -class SessionManager < G::SafeHash +class SessionManager < N::SafeHash # the collection of online users. attr_reader :online def initialize super - @online = G::SafeHash.new + @online = N::SafeHash.new end # Return the number of anonymous sessions. # def anonymous_count @@ -78,16 +78,16 @@ # fixes i made allow for recoding this. for key in $sessions.keys() begin session = $sessions[key] if session.stale? - $log.debug "Session finalized: logging out idle user '#{session.user}'" if $DBG + Logger.debug "Session finalized: logging out idle user '#{session.user}'" if $DBG session.logout() $sessions.delete(key) end rescue Exception, StandardError => e - $log.error "Session gc errror #$!" + Logger.error "Session gc errror #$!" end end end end @@ -136,20 +136,20 @@ def login(request, user) return false if user.banned? @user = user @user.login(request) $sessions.login(@user.oid, @user.name) - $log.info "User '#{user}' logged in!" + Logger.info "User '#{user}' logged in!" return true end # Logout a user # def logout() self.clear() @user.logout() $sessions.logout(@user.oid) - $log.info "User '#{user}' logged out!" + Logger.info "User '#{user}' logged out!" @user = N::AnonymousUser.instance end # #