From 40d8e91008b7d76ce6b9398484c591eb51c85bdb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 31 Jan 2010 11:10:57 -0800 Subject: * Added a few files that were missing in the repo. * New HGInventoryService which allows restricted access to inventory while outside --- .../Inventory/InventoryServerInConnector.cs | 46 +++------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'OpenSim/Server/Handlers/Inventory') diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 3c92209..53db739 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs @@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Inventory { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private IInventoryService m_InventoryService; + protected IInventoryService m_InventoryService; private bool m_doLookup = false; @@ -54,11 +54,12 @@ namespace OpenSim.Server.Handlers.Inventory //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME); private string m_userserver_url; - private string m_ConfigName = "InventoryService"; + protected string m_ConfigName = "InventoryService"; public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) : base(config, server, configName) { + m_ConfigName = configName; IConfig serverConfig = config.Configs[m_ConfigName]; if (serverConfig == null) throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); @@ -328,46 +329,9 @@ namespace OpenSim.Server.Handlers.Inventory /// /// /// - public bool CheckAuthSession(string session_id, string avatar_id) + public virtual bool CheckAuthSession(string session_id, string avatar_id) { - if (m_doLookup) - { - m_log.InfoFormat("[INVENTORY IN CONNECTOR]: checking authed session {0} {1}", session_id, avatar_id); - - //if (m_session_cache.getCachedSession(session_id, avatar_id) == null) - //{ - // cache miss, ask userserver - Hashtable requestData = new Hashtable(); - requestData["avatar_uuid"] = avatar_id; - requestData["session_id"] = session_id; - ArrayList SendParams = new ArrayList(); - SendParams.Add(requestData); - XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams); - XmlRpcResponse UserResp = UserReq.Send(m_userserver_url, 3000); - - Hashtable responseData = (Hashtable)UserResp.Value; - if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE") - { - m_log.Info("[INVENTORY IN CONNECTOR]: got authed session from userserver"); - //// add to cache; the session time will be automatically renewed - //m_session_cache.Add(session_id, avatar_id); - return true; - } - //} - //else - //{ - // // cache hits - // m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache"); - // return true; - //} - - m_log.Warn("[INVENTORY IN CONNECTOR]: unknown session_id, request rejected"); - return false; - } - else - { - return true; - } + return true; } } -- cgit v1.1