#NEWLINE# def __init__( self , user , fromip , _sessionid = None , _created = None , scopes = [ 'auth' ] ) : #NEWLINE# #INDENT# self . username = user . name #NEWLINE# self . uid = UCache . UCache . SearchUser ( self . username ) #NEWLINE# if ( _sessionid is None ) : #NEWLINE# #INDENT# self . sessionid = Util . RandomStr ( SESSIONID_LEN ) #NEWLINE# self . created = datetime . datetime . now ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sessionid = _sessionid #NEWLINE# self . created = _created #NEWLINE# #UNINDENT# self . user = UserManager . UserManager . LoadUser ( user . name ) #NEWLINE# self . _userinfo = None #NEWLINE# self . utmpent = ( - 1 ) #NEWLINE# self . _fromip = fromip #NEWLINE# self . scopes = scopes #NEWLINE# SessionManager . Insert ( self ) #NEWLINE# if ( _sessionid is None ) : #NEWLINE# #INDENT# SessionManager . Record ( self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# SessionManager . Update ( self )