@jsonrpc_method('plugins.is_authenticated')
def plugins_is_authenticated(request, sessionid):
 engine = import_module(settings.SESSION_ENGINE)
 session = engine.SessionStore(sessionid)
 try:
  user_id = session[auth.SESSION_KEY]
  backend_path = session[auth.BACKEND_SESSION_KEY]
  backend = auth.load_backend(backend_path)
  user = backend.get_user(user_id)
 except KeyError:
  http_auth = sessionid.decode('base64')
  request = type('request', (object,), {'META': {'HTTP_AUTHORIZATION': http_auth}})
  if FreeBasicAuthentication().is_authenticated(request):
   user = request.user
  else:
   return False
 if (user and user.is_authenticated):
  return True
 return False

@ jsonrpc_method ( 'plugins.is_authenticated' ) def plugins_is_authenticated ( request , sessionid ) : engine = import_module ( settings . SESSION_ENGINE ) session = engine . SessionStore ( sessionid ) try : user_id = session [ auth . SESSION_KEY ] backend_path = session [ auth . BACKEND_SESSION_KEY ] backend = auth . load_backend ( backend_path ) user = backend . get_user ( user_id ) except KeyError : http_auth = sessionid . decode ( 'base64' ) request = type ( 'request' , ( object , ) , { 'META' : { 'HTTP_AUTHORIZATION' : http_auth } } ) if FreeBasicAuthentication ( ) . is_authenticated ( request ) : user = request . user else : return False if ( user and user . is_authenticated ) : return True return False
given a sessionid .